Re: tcp/ip performance problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 1, 2008 at 12:07 PM, Sridhar Samudrala <sri@xxxxxxxxxx> wrote:
>
> On Wed, 2008-10-01 at 11:05 -0700, Pranav Desai wrote:
>> On Wed, Oct 1, 2008 at 10:28 AM, Sridhar Samudrala <sri@xxxxxxxxxx> wrote:
>> >
>> > On Wed, 2008-10-01 at 16:55 +0300, Pekka Savola wrote:
>> > > On Wed, 1 Oct 2008, Vitaly Ivanov wrote:
>> > > > We have solved this problem. We had tuned TCP/IP stack in Linux Kernel
>> > > > but it hadn't helped us because there was very law value backlog in
>> > > > listen function
>> > > > int listen(int sockfd, int backlog);
>> > > > This function is used in nginx and lighttp demons. In nginx this value
>> > > > had been set to 511 and in lighttp to 1024. We set both value to 65535
>> > > > or -1 and solve our problem. Now we have about 700Mbit per second
>> > > > instead 70.
>> > >
>> > > Good catch.  I wonder if there is any way to figure out the listen
>> > > backlog (except using strace) for a socket, e.g. using a system level
>> > > tool?
>> >
>> > Yes. The max listen backlog and the current listen backlog values
>> > for listening sockets are available via Recv-Q and Send-Q fields
>> > in 'netstat' and 'ss' output as well as tx_queue and rx_queue
>> > under cat /proc/net/tcp
>> >
>>
>> How do you get the max value reached, it seems to only give the
>> current value, which is very instantaneous.
>
> max value refers to the value that is passed by the app as the
> backlog parameter to the listen() call.
>>

hmm, actually I was looking for max queue length reached ... during
the run of the listening program. Is there any such value available ?

>> Also, is this the number of connections waiting to be accepted by the
>> user program or the number of bytes on an already accepted connection
>> not copied to the user program ?
>>
>> according to netstat man page:
>>
>>   Recv-Q
>>        The count of bytes not copied by the user program connected to
>> this socket.
>
> This description corresponds to an ESTABLISHED socket. Patches to
> oveload these fields for listening sockets went in sometime last year,
> but the man pages are not updated.

patch to netstat ? so the /proc/...rx_queue should be ok to use to get
this number ? or were there some additional values exposed by the
kernel.

Thanks

-- Pranav


> In case of a listening socket, Recv-Q indicates the current number of
> pending connections waiting to be accepted and Send-Q indicates the
> maximum length upto which the accept queue can grow(same as backlog
> parameter to the listen() call).
>
> Thanks
> Sridhar
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux