<div dir="ltr">Thanks. your suggestions worked!<div>Amit.<br><br><div class="gmail_quote">On Thu, Jan 3, 2013 at 5:15 PM, Klaus Darilion <span dir="ltr">&lt;<a href="mailto:klaus.mailinglists@pernau.at" target="_blank">klaus.mailinglists@pernau.at</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ups.<div class="im"><br>
<br>
On 03.01.2013 15:11, Klaus Darilion wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How much traffic do you want to send?<br>
<br>
When does the problem happen? At which message size does it happen?<br>
<br>
I just wonder that the normal options which works for us do not work for<br>
you and t<br>
</blockquote></div>
and the problem is code related.<br>
<br>
1. Check if Kamailio really uses the buffer size you have configured (via sercmd config framework):<br>
# kamctl sercmd cfg.get tcp rd_buf_size<br>
<br>
2. Test on which message size the problems start. Attached is a perl script which allows you to generate OPTIONS messages with a specified message size, e.g:<br>
<br>
# ./<a href="http://send-tcp-message.pl" target="_blank">send-tcp-message.pl</a> <a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a> <a href="tel:2048" value="+9722048" target="_blank">2048</a><br>
<br>
<br>
regards<br>
Klaus<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<br>
regards<br>
Klaus<br>
<br>
On 03.01.2013 14:21, Amit Elbaz wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I increased tcp_rd_buf_size, but it did not help.<br>
I don&#39;t think this is the problem.<br>
<br>
In tcp_read.c:<br>
int tcp_read(struct tcp_connection *c, int* flags)<br>
{<br>
int bytes_free, bytes_read;<br>
struct tcp_req *r;<br>
int fd;<br>
<br>
r=&amp;c-&gt;req;<br>
fd=c-&gt;fd;<br>
bytes_free=r-&gt;b_size- (int)(r-&gt;pos - r-&gt;buf);<br>
if (unlikely(bytes_free==0)){<br>
LOG(L_ERR, &quot;ERROR: tcp_read: buffer overrun, dropping\n&quot;);<br>
r-&gt;error=TCP_REQ_OVERRUN;<br>
return -1;<br>
}<br>
<br>
how to i increase r-&gt;b_size ?<br>
<br>
Thanks for you help, Amit.<br>
<br>
On Wed, Jan 2, <a href="tel:2013" value="+9722013" target="_blank">2013</a> at 6:51 PM, Klaus Darilion<br>
&lt;<a href="mailto:klaus.mailinglists@pernau.at" target="_blank">klaus.mailinglists@pernau.at</a> &lt;mailto:<a href="mailto:klaus.mailinglists@pernau.at" target="_blank">klaus.mailinglists@<u></u>pernau.at</a>&gt;&gt;<br>


wrote:<br>
<br>
    Hi!<br>
<br>
    -b is the receive buffer of the socket in the OS (for UDP tweaking,<br>
    I do not know if this is relevant for TCP), so not related to this<br>
    problem as this problem happens inside Kamailio.<br>
<br>
    Actually 15K is rather small, really strange that you get errors.<br>
    So, I did some tests:<br>
<br>
    1. tcp_rd_buf_size must be increased. The documentation is bad as it<br>
    meantions &quot;TCP datagram&quot; but actually means the maximum size of SIP<br>
    (or HTTP) message that can be received.<br>
<br>
    2. tcp_rd_buf_size is internally limited to 16MBytes. If you need<br>
    more, you have to change the code in:<br>
    tcp_options.c:  { &quot;rd_buf_size&quot;, CFG_VAR_INT | CFG_ATOMIC, 512,<br>
    16777216,  0,         0,<br>
<br>
    3. If you use real large message you may need to increase the<br>
    private memory, and if you forward it with tm module, also the<br>
    shared memory.<br>
<br>
    regards<br>
    Klaus<br>
<br>
<br>
    Am 02.01.2013 13:59, schrieb Amit Elbaz:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    this still does not solve the problem.<br>
    I&#39;ve also tried running Kamailio with *-b 32768* option.<br>
<br>
    here are the logs:<br>
<br>
    Jan  2 14:54:24 debdev kamailio<a href="tel:%5B2580" value="+9722580" target="_blank">[2580</a> &lt;tel:%5B2580&gt;]: ERROR: &lt;core&gt;<br>
    [tcp_read.c:344]: ERROR: tcp_read: buffer overrun, dropping<br>
    Jan  2 14:54:24 debdev kamailio<a href="tel:%5B2580" value="+9722580" target="_blank">[2580</a> &lt;tel:%5B2580&gt;]: ERROR: &lt;core&gt;<br>
    [tcp_read.c:1127]: ERROR: tcp_read_req: error reading<br>
<br>
    Thanks for your help.<br>
<br>
    On Wed, Jan 2, <a href="tel:2013" value="+9722013" target="_blank">2013</a> &lt;tel:<a href="tel:2013" value="+9722013" target="_blank">2013</a>&gt; at 1:17 PM, Andrew Pogrebennyk<br>
    &lt;<a href="mailto:apogrebennyk@sipwise.com" target="_blank">apogrebennyk@sipwise.com</a> &lt;mailto:<a href="mailto:apogrebennyk@sipwise.com" target="_blank">apogrebennyk@sipwise.<u></u>com</a>&gt;&gt; wrote:<br>
<br>
        Hi,<br>
        you may try changing the tcp_rd_buf_size and tcp_conn_wq_max:<br>
<br>
<a href="http://www.kamailio.org/wiki/cookbooks/3.3.x/core#tcp_conn_wq_max" target="_blank">http://www.kamailio.org/wiki/<u></u>cookbooks/3.3.x/core#tcp_conn_<u></u>wq_max</a><br>
<br>
        And since this in development mailing list I&#39;d like to point<br>
        at what<br>
        seem an iaccuracy in documentation: several options refer to<br>
        the core<br>
        parameter called tcp_write_buf, which isn&#39;t described in the<br>
        cookbook:<br>
<br>
        tcp_conn_wq_max<br>
        Maximum bytes queued for write allowed per connection.<br>
        Attempting to<br>
        queue more bytes would result in an error and in the<br>
        connection being<br>
        closed (too slow). If *tcp_write_buf* is not enabled, it has<br>
        no effect.<br>
<br>
        I hope Daniel or someone who knows reads this..<br>
<br>
        BR,<br>
        Andrew<br>
<br>
        On 01/02/2013 10:38 AM, Amit Elbaz wrote:<br>
        &gt; Hi,<br>
        &gt;<br>
        &gt; While sending a big TCP SIP message (15K+), I get &quot;tcp_read:<br>
        buffer<br>
        &gt; overrun, dropping&quot; message.<br>
        &gt; this happens after a few fragments have been sent, and then<br>
        i get this<br>
        &gt; message and the connection resets.<br>
        &gt; is it possible to set the max-buffer size through<br>
        configuration? if so,<br>
        &gt; where?<br>
        &gt;<br>
        &gt; Thanks, Amit.<br>
        &gt;<br>
        &gt;<br>
        &gt; ______________________________<u></u>_________________<br>
        &gt; sr-dev mailing list<br>
        &gt; <a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a><br>
&lt;mailto:<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-<u></u>router.org</a>&gt;<br>
        &gt; <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/<u></u>cgi-bin/mailman/listinfo/sr-<u></u>dev</a><br>
        &gt;<br>
<br>
<br>
        ______________________________<u></u>_________________<br>
        sr-dev mailing list<br>
        <a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a> &lt;mailto:<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-<u></u>router.org</a>&gt;<br>
        <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/<u></u>cgi-bin/mailman/listinfo/sr-<u></u>dev</a><br>
<br>
<br>
<br>
<br>
    ______________________________<u></u>_________________<br>
    sr-dev mailing list<br>
    <a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a>  &lt;mailto:<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-<u></u>router.org</a>&gt;<br>
    <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/<u></u>cgi-bin/mailman/listinfo/sr-<u></u>dev</a><br>
</blockquote>
<br>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a><br>
</div></div><a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/<u></u>cgi-bin/mailman/listinfo/sr-<u></u>dev</a><br>
</blockquote>
</blockquote></div><br></div></div>