[YBA] TCP connection rate

[YBA] TCP connection rate

Jonathan Ben Avraham yba at tkos.co.il
Mon Feb 2 18:13:38 IST 2009


Hi Marc,
The .NET client has a bug that prevents use of persistent MySQL 
connections. The application is already cached up the wazoo.

Where would I look in the kernel to see if it is rejecting the connections 
as opposed to MySQL? Or is this just unlikely given that the hardware is 
fairly robust?
Thanks,

  - yba


On Mon, 2 Feb 2009, marc at swiftouch.com wrote:

> Date: Mon, 2 Feb 2009 18:28:21 +0200 (IST)
> From: marc at swiftouch.com
> To: Jonathan Ben Avraham <yba at tkos.co.il>
> Cc: Gilad Ben-Yossef <gilad at codefidence.com>, ILUG <linux-il at cs.huji.ac.il>
> Subject: Re: [YBA] TCP connection rate
> 
> Hi all
>
> Without delving into the stack behaviour, I would try the (potentially) 
> cheaper route - is there a possibility of amalgamating queries to the 
> database, thereby reducing the per second metric? Or - perish the thought 
> (caveat emptor, I am not acquainted with the app) - caching replies at the 
> client?
>
> I am not sure the netstat trick can work in this case - both since (as YBA 
> noted) the connexions are brief and because netstat deals with connections 
> very late in their lifecycle. I am not sure how connexions pending on the 
> stack would show up.
>
> M
>
> ---MAV
> Marc. Volovic
> +972-54-467-6764
> marc at swiftouch.com
> Sent from my iPhone
>
> On Feb 2, 2009, at 5:06 PM, Jonathan Ben Avraham <yba at tkos.co.il> wrote:
>
>> Hi Gilad,
>> Thanks. The problem is that the connections are exceedingly short-lived. By 
>> the time I type in "netstat -na" already 1000 of them have come and gone.
>> 
>> - yba
>> 
>> 
>> On Mon, 2 Feb 2009, Gilad Ben-Yossef wrote:
>> 
>>> Date: Mon, 02 Feb 2009 16:29:23 +0200
>>> From: Gilad Ben-Yossef <gilad at codefidence.com>
>>> To: Jonathan Ben Avraham <yba at tkos.co.il>
>>> Cc: ILUG <linux-il at cs.huji.ac.il>
>>> Subject: Re: [YBA] TCP connection rate
>>> Jonathan Ben Avraham wrote:
>>> 
>>>> Dear list members,
>>>> What limits the rate that the Linux kernel TCP stack can accept new 
>>>> connections? How is that rate related to the rate that the application 
>>>> listening on a port can handle the connections? That is, if I try to 
>>>> connect and get ECONNREFUSED is there a way for me to know if I got it 
>>>> because the kernel could not handle the connection rate or if I got it 
>>>> because I had more connection attempts than the backlog parameter of my 
>>>> listen() call? In other words, do I need to tune the kernel or the 
>>>> application (MySQL) for the desired high connection rate and how would I 
>>>> know?
>>> 
>>> Just check what the value of the backlog parameter is and then use netstat 
>>> to watch the application connections when you get ECONNREFUSED error. If 
>>> the number of connections in netstat is equal (or at least very close to) 
>>> the backlog parameter then it's the backlog parameter, otherwise it's 
>>> something else.
>>> 
>>> Gilad
>>> 
>>> 
>> 
>> -- 
>> EE 77 7F 30 4A 64 2E C5  83 5F E7 49 A6 82 29 BA    ~. .~   Tk Open Systems
>> =}------------------------------------------------ooO--U--Ooo------------{=
>>    - yba at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
>> 
>> _______________________________________________
>> Linux-il mailing list
>> Linux-il at cs.huji.ac.il
>> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

-- 
  EE 77 7F 30 4A 64 2E C5  83 5F E7 49 A6 82 29 BA    ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
      - yba at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -



More information about the Linux-il mailing list