<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    I made a patch for server reconnect -- I had no access to a computer
    with redis lib installed for the moment, hopefully it compiles. If
    you can try and tell the result, it would be great, I can commit
    then.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    On 1/16/12 12:15 PM, Javier Gallart wrote:
    <blockquote
cite="mid:CACviLGYvAYc+eHG2uNstiQdXXecizGWH7Y23QHkRSwBqjnj3Ug@mail.gmail.com"
      type="cite">Hi Daniel<br>
      <br>
      <div class="gmail_quote">On Mon, Jan 16, 2012 at 9:47 AM,
        Daniel-Constantin Mierla <span dir="ltr">&lt;<a
            moz-do-not-send="true" href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor="#FFFFFF" text="#000000"> Hello,
            <div class="im"><br>
              <br>
              On 1/13/12 12:27 PM, Javier Gallart wrote:
              <blockquote type="cite">Hi Daniel
                <div><br>
                </div>
                <div>both values are null.</div>
              </blockquote>
            </div>
            ok, could be a hint that the connection is down and try a
            reconnect...
            <div class="im"><br>
              <br>
              <blockquote type="cite">
                <div>I might have found something: apparently some of
                  the sockets kamailio-&gt;redis were inactive for a
                  while and were being closed in the redis end.</div>
              </blockquote>
              <br>
            </div>
            Do you know if there is a keepalive mechanism that reddis
            offers, or a command to set the timeout value from the
            client side?<br>
          </div>
        </blockquote>
        <div><br>
        </div>
        <div>In redis config file the only related value I've seen is
          "timeout". If set to 0, the server never disconnects inactive
          clients. From the client perspective, what about this:&nbsp;<a
            moz-do-not-send="true"
            href="http://www.redis.io/commands/ping">http://www.redis.io/commands/ping</a></div>
        <div><br>
        </div>
        <div>Regards</div>
        <div><br>
        </div>
        <div>Javi</div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor="#FFFFFF" text="#000000"> Cheers,<br>
            Daniel<br>
            <br>
            <blockquote type="cite">
              <div>
                <div class="h5">
                  <div> This is redis default config:</div>
                  <div>
                    <div># Close the connection after a client is idle
                      for N seconds (0 to disable)</div>
                    <div>timeout 600</div>
                    <div><br>
                    </div>
                    <div>I've set the timeout value to 0 to confirm if
                      this is actually the problem.&nbsp;</div>
                    <div> <br>
                    </div>
                    <div>In case it might be useful for somebody, we've
                      used lsof in recurrent mode to monitor the sockets
                      status:</div>
                    <div><br>
                    </div>
                    <div>server# lsof -i :6379 -r 5"m===%T===" &nbsp;| grep
                      -e == -e kamailio</div>
                    <div>
                      <div>===05:28:26===</div>
                      <div>kamailio &nbsp;13365 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58622 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:34994-&gt;localhost:6379
                        (ESTABLISHED)</div>
                      <div>kamailio &nbsp;13366 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58626 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:34995-&gt;localhost:6379
                        (ESTABLISHED)</div>
                      <div>kamailio &nbsp;13367 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58628 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:34996-&gt;localhost:6379
                        (ESTABLISHED)</div>
                      <div>kamailio &nbsp;13368 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58632 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:34997-&gt;localhost:6379
                        (ESTABLISHED)</div>
                      <div>kamailio &nbsp;13369 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58649 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35000-&gt;localhost:6379
                        (ESTABLISHED)</div>
                      <div>kamailio &nbsp;13370 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58661 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35003-&gt;localhost:6379
                        (ESTABLISHED)</div>
                      <div>kamailio &nbsp;13376 kamailio &nbsp; 10u &nbsp;IPv4 &nbsp;58710 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35013-&gt;localhost:6379
                        (ESTABLISHED)</div>
                      <div>kamailio &nbsp;13377 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58705 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35012-&gt;localhost:6379
                        (ESTABLISHED)</div>
                      <div>kamailio &nbsp;13378 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58695 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35008-&gt;localhost:6379
                        (ESTABLISHED)</div>
                      <div>kamailio &nbsp;13381 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58691 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35006-&gt;localhost:6379
                        (ESTABLISHED)</div>
                      <div>kamailio &nbsp;13382 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58693 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35007-&gt;localhost:6379
                        (ESTABLISHED)</div>
                      <div>===05:28:31===</div>
                      <div>kamailio &nbsp;13365 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58622 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:34994-&gt;localhost:6379
                        (ESTABLISHED)</div>
                      <div>kamailio &nbsp;13366 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58626 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:34995-&gt;localhost:6379
                        (CLOSE_WAIT)</div>
                      <div>kamailio &nbsp;13367 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58628 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:34996-&gt;localhost:6379
                        (ESTABLISHED)</div>
                      <div>kamailio &nbsp;13368 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58632 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:34997-&gt;localhost:6379
                        (CLOSE_WAIT)</div>
                      <div>kamailio &nbsp;13369 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58649 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35000-&gt;localhost:6379
                        (CLOSE_WAIT)</div>
                      <div>kamailio &nbsp;13370 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58661 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35003-&gt;localhost:6379
                        (CLOSE_WAIT)</div>
                      <div>kamailio &nbsp;13376 kamailio &nbsp; 10u &nbsp;IPv4 &nbsp;58710 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35013-&gt;localhost:6379
                        (CLOSE_WAIT)</div>
                      <div>kamailio &nbsp;13377 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58705 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35012-&gt;localhost:6379
                        (CLOSE_WAIT)</div>
                      <div>kamailio &nbsp;13378 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58695 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35008-&gt;localhost:6379
                        (CLOSE_WAIT)</div>
                      <div>kamailio &nbsp;13381 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58691 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35006-&gt;localhost:6379
                        (CLOSE_WAIT)</div>
                      <div>kamailio &nbsp;13382 kamailio &nbsp; &nbsp;4u &nbsp;IPv4 &nbsp;58693 &nbsp;
                        &nbsp; &nbsp;0t0 &nbsp;TCP localhost:35007-&gt;localhost:6379
                        (CLOSE_WAIT)</div>
                    </div>
                    <div><br>
                    </div>
                    <div>Regards</div>
                    <div><br>
                    </div>
                    <div>Javi</div>
                    <div><br>
                    </div>
                    <div class="gmail_quote">On Fri, Jan 13, 2012 at
                      9:35 AM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a
                          moz-do-not-send="true"
                          href="mailto:miconda@gmail.com"
                          target="_blank">miconda@gmail.com</a>&gt;</span>
                      wrote:<br>
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">Hello,
                        <div><br>
                          <br>
                          On 1/13/12 8:00 AM, Javier Gallart wrote:<br>
                          <blockquote class="gmail_quote"
                            style="margin:0 0 0 .8ex;border-left:1px
                            #ccc solid;padding-left:1ex"> Hi all<br>
                            <br>
                            I have started making some tests with the
                            ndb_redis module. So far we have not
                            stressed the module (no more than 5 HGET
                            &nbsp;commands/second at maximum). It works well,
                            but with at some point it starts failing.
                            The failures are easily found because the
                            logs always show this:<br>
                            INFO: &lt;core&gt; [main.c:811]: INFO:
                            signal 13 received<br>
                          </blockquote>
                        </div>
                        this due to a broken connection. What do you get
                        in redis reply and info variables?
                        <div><br>
                          <br>
                          <blockquote class="gmail_quote"
                            style="margin:0 0 0 .8ex;border-left:1px
                            #ccc solid;padding-left:1ex"> After that the
                            redis value is always null. If I restart
                            kamailio it starts working again.<br>
                            I've run kamailio with debug=4 but I haven't
                            seen more useful information. On the redis
                            side, I could find nothing in the logs
                            either, the number of clientes connected is
                            alway much less than the configured maximum,
                            Any idea?<br>
                            On the other hand, if I restart redis we
                            need to restart kamailio to restore the
                            connections. Is the reconnection to redis on
                            the roadmap?<br>
                          </blockquote>
                          <br>
                        </div>
                        It should not be that complex, there is the code
                        for initializing the connection, it should be
                        reused for doing it again in case of failure.<br>
                        <br>
                        Cheers,<br>
                        Daniel<span><font color="#888888"><br>
                            <br>
                            -- <br>
                            Daniel-Constantin Mierla -- <a
                              moz-do-not-send="true"
                              href="http://www.asipto.com"
                              target="_blank">http://www.asipto.com</a><br>
                            <a moz-do-not-send="true"
                              href="http://linkedin.com/in/miconda"
                              target="_blank">http://linkedin.com/in/miconda</a>
                            -- <a moz-do-not-send="true"
                              href="http://twitter.com/miconda"
                              target="_blank">http://twitter.com/miconda</a><br>
                            <br>
                          </font></span></blockquote>
                    </div>
                    <br>
                  </div>
                  <br>
                  <fieldset></fieldset>
                  <br>
                </div>
              </div>
              <pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
            </blockquote>
            <div class="im"> <br>
              <pre cols="72">-- 
Daniel-Constantin Mierla -- <a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a moz-do-not-send="true" href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a> -- <a moz-do-not-send="true" href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a></pre>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
  </body>
</html>