<div dir="ltr">I increased tcp_rd_buf_size, but it did not help.<div>I don&#39;t think this is the problem.</div><div><br></div><div>In tcp_read.c:</div><div><div>int tcp_read(struct tcp_connection *c, int* flags)</div><div>

{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>int bytes_free, bytes_read;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>struct tcp_req *r;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>int fd;</div>

<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>r=&amp;c-&gt;req;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fd=c-&gt;fd;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>bytes_free=r-&gt;b_size- (int)(r-&gt;pos - r-&gt;buf);</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if (unlikely(bytes_free==0)){</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>LOG(L_ERR, &quot;ERROR: tcp_read: buffer overrun, dropping\n&quot;);</div>

<div><span class="Apple-tab-span" style="white-space:pre">                </span>r-&gt;error=TCP_REQ_OVERRUN;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>return -1;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>

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

</blockquote></div><br></div></div></div>