Google Answers Logo
View Question
 
Q: 'MySQL error 11 woes ( No Answer,   2 Comments )
Question  
Subject: 'MySQL error 11 woes
Category: Computers > Programming
Asked by: daveg-ga
List Price: $4.00
Posted: 26 Jun 2002 04:12 PDT
Expires: 26 Jul 2002 04:12 PDT
Question ID: 33440
I am running a perl script which is accessing a Database on a
different
server.  The script runs 24/7, but occasionaly I see the proccess fail
with the following error:

DBI->connect failed: Can't connect to MySQL server on 'linux990' (11)

Note: linux990 is the name of my machine I am trying to connect to.

Although the error is brought back from mysql, I believe the error
code (11) could originate from the system.  If i type "perror 11" on
my command promt I get: "Resource temporarily unavailable".


I am aware that this error is generated when the connection to the
mysql socket fails, but in my perl code I ensure the connection is
attempted several times, each time with a greater timeout!

Can anyone tell me what the problem is and how to solve it?

Perl - version 5.005_03
Mysql - version 9.38
Linux kernel - version 2.4.17

Many Thanks
David

Clarification of Question by daveg-ga on 26 Jun 2002 05:38 PDT
To clarify the question:

- This problem occurs intermitently 

- Mysql has a limit of 100 processes and this is never reached - I
know this because I have executed a test script to open 101
connections and the error reported is completely different.  Also I do
ensure that all connections are closed soon after sql queries are
executed

- All code contains debugging prints showing that the error occurs
when I attempt to connect the the database.

- the sql queries executed have no faults.

- I have not been able to systematically been able to reproduce this
error.
Answer  
There is no answer at this time.

Comments  
Subject: Re: 'MySQL error 11 woes
From: yruss-ga on 26 Jun 2002 04:59 PDT
 
I don't know exactly what your problem might be- you might try adding
some debugging to your perl script. Try and find out what the queries
that are failing are... I've read that sql syntax problems can
sometimes give an error like this. Also, make sure you close your
connections so you don't use all your sockets.

The major reasons one gets `Resource temporary unavailable` are:

- You have used up all file descriptors or number of processes.
- You are out of memory
- You have a bug in your (g)libc library.

You may try running a ps command on the remote machine when the query
fails to see what is using up the resources. sticking a simple
system "ssh linux990 ps -aux"
each time it retries might do the trick.

I don't know if this will work since it seems to be that you can't
connect to the server but try `mysqladmin processlist status` or
'mysqladmin extended-status' to see what is going on in the server.

For tips on increasing mysql performance see:
http://www.mysql.com/information/presentations/presentation-oscon2000-20000719/index.html
Subject: Re: 'MySQL error 11 woes
From: tkil-ga on 26 Jun 2002 22:37 PDT
 
How often is this script being called?  At least one thread:

   http://archive.develooper.com/dbi-users@perl.org/msg00609.html

Indicates that this is a common response by the "local" machine,
telling you that you have simply run out of outgoing sockets, and
need to wait for them to be freed up.  They give the magic
incantation for increasing the limit on BSD (at least I think
that's where they are), but equivalent measures exist on most
modern OSs.

yruss's comment was very close, I'd just add "You have used up
all the outgoing sockets on the machine running the script" to
his list of reasons.

(There is also the possible case of "Error 11" as related to
flakey hardware under Linux, typically exhibiting itself under
heavy loads such as repeated kernel compiles, etc.  How heavily
loaded are these machines (both front-end and DB server)?)

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy