List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 7 1999 4:20pm
Subject:problems to connect to a working mysqld
View as plain text  
>>>>> "Benjamin" == Benjamin Pflugmann <philemon@stripped> writes:

Benjamin> Hi.
Benjamin> I have come about a strange problem, that I never encountered before.
Benjamin> I doubt that it has its origin at mysql. But maybe some of you
Benjamin> encountered it before and/or I have to tweak some mysql parameters.

Benjamin> Although mysqld is working and connections are accepted, when I run my
Benjamin> benchmarks, from time to time the clients get "Can't connect to MySQL
Benjamin> server on neo (11)" errors (11 = Resource temporarily not available).

Benjamin> I have reduced the problem to the following script (tcsh):

Benjamin> while ( 1 )
Benjamin>   mysql -B -hneo -u... -p... -e "select 1+1"
Benjamin> end

Benjamin> It runs fine, then after some time (between about 10 seconds and a
Benjamin> minute), I get the errors mentioned above for all invocations during
Benjamin> some seconds (between about 1 and 20) and then it works again. This
Benjamin> happens periodically. This script loops about 50 times per second.

Benjamin> The script runs on the database server itself. I did not get this
Benjamin> errors from a remote client nor when connection via localhost (leaving
Benjamin> -hneo out) until yet.

Benjamin> When I start the script in several terminals, the 'error periods'
Benjamin> occur more often and on all terminals at the same time, but neither on
Benjamin> the remote connections nor via the UNIX socket.

Benjamin> So it sounds like a problem in handling TCP connections from
Benjamin> localhost. So - as I said - it's possible that this is not directly
Benjamin> mysql related.

Benjamin> Anyone has an idea where to start search, how to limit the
Benjamin> possibilities (e.g. a similar test for TCP connections not involving
Benjamin> MySQL without writing everything new) or anything else?

Benjamin> It sounds as if the system is running out of some resources, but I
Benjamin> cannot imagine which, since it is a simple sequentiell loop.


The problem is that when you close a TCP/IP socket there is a timeout
of up to 30 seconds until the resources are properly freed.  This
means that after a while you will run out of free TCP/IP sockets.

Are you running Linux?  I haven't seen this problem in Linux 2.0.x but 
I definitely have this problem with 2.2.5 !  Someone claimed that this 
may be fixed in Linux 2.2.11, but I haven't had time to check this!

problems to connect to a working mysqldBenjamin Pflugmann3 Sep
  • problems to connect to a working mysqldMichael Widenius8 Sep
    • Re: problems to connect to a working mysqldBenjamin Pflugmann8 Sep
  • Re: BUG report (CREATE TEMPORARY TABLES problem) 4.0.2/4.0.3-bk snapshotSinisa Milivojevic3 Aug