List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:November 8 1999 11:09pm
Subject:Re: Problem with MySQL connections
View as plain text  
>>>>> "Tani" == Tani Hosokawa <unknown@stripped> writes:

Tani> On Sat, 30 Oct 1999, Shane Wegner wrote:
>> >  > using two servers, a web server and an SQL server.  The web server
> uses
>> >  > mod_perl and libDBI_perl and uses persistant TCP connections to the
> MySQL
>> >  > server.
>> >  > 
>> >  > During busy times, MySQL seems to start refusing connections with this
> error
>> >  > message.
>> >  > Lost connection to MySQL server during query
>> >  > This is during the connection stage and not during a query.  This
> error
>> >  > seems to occur when there are about 200 connections to MySQL.  At
> first I
>> >  > thought it was the open file or inode limit as we are using Linux
> 2.0.36 on
>> >  > the database server so I cranked them up as follows.
>> > 
>> > You need to do two things only:
>> > 
>> > - increase connect_timeout value, and when you jump to 3.23.xx ,
>> > wait_timeout value
>> > 
>> > - if that does not help, you should recompile your Linux kernel, to
>> > support more prcesses, as already described in this mailing list.
>> Hi,
>> 
>> Thanks for the suggestion.  I tried increasing connect_timeout to 30 but is
>> still says the same thing.  Thing is, it doesn't seem to wait 30 seconds to
>> say it yet a show variables shows connect_timeout at 30.
>> 
>> As for process limits,  when this error is happening, there are only 250
>> process running according to "ps ax".  Doesn't Linux have like a 32767
>> process limit?

Tani> Linux (default) has 256 max processes per user, and 512 per system.   This
Tani> can be increased by recompiling your kernel and editing
Tani> /usr/src/linux/include/linux/tasks.h.  However, I suspect that the problem
Tani> actually lies with MySQL, since I'm getting a similar problem, and with
Tani> only 30-40 MySQL connections.

Tani> ---
Tani> tani hosokawa
Tani> river styx internet

Hi!

Can you produce a test case of this?  MySQL only depends on the
availability of threads (and the -O max_connections parameter)
and shouldn't have any internal limit for the number of connections it 
can handle.

Do you get anything in the log files when MySQL aborts the connection?

Note that one fairly common reason for problems with MySQL on Linux is 
an old glibc library.  I suggest you upgrade your glibc to the newest
available for you Linux distribution and then upgrade the number of
files and processes to 2048 and try again.

Regards,
Monty
Thread
Problem with MySQL connectionsShane Wegner29 Oct
  • Re: Problem with MySQL connectionssinisa30 Oct
    • Re: Problem with MySQL connectionsShane Wegner31 Oct
      • Re: Problem with MySQL connectionsTani Hosokawa2 Nov
        • Re: Problem with MySQL connectionsMichael Widenius9 Nov