472,145 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

mySQL problems

Hello,
I've developed a program using python that have to connect to a mysql
server several times.

In a local machine (running the program in the same machine where the
mysql server is) I have no problems. I can run several instances of the
program at the same time with no problem.

Them problem arrives when I try to distribute the tasks to different
machines, for example, in a cluster. In this situation, the machine that
runs the python program is different than the machine that hosts the
database.

If I run the python program only an other machine, only one run of the
program, there is no problem. But, If I run the program in different
machines, all of them connecting to the same database server, randomly,
it crash. Crash all running programs! at the same time.

The output is clear:

File "/cgl/programs/ChemBang/config.py", line 67, in mysql
db = MySQLdb.connect(host=HOST, user="USER",
passwd="PASSWD",db="DATABASE")
File "/usr/local/lib/python2.5/site-packages/PIL/__init__.py", line
74, in Connect

File "build/bdist.linux-x86_64/egg/MySQLdb/connections.py", line 170,
in __init__
_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL
server on 'HOST' (110)")
It is clearly related with the connection to the mySQL server. As I
said, it only happens when there are more than one programs running in
different machines (or in the same) but conecting to a mysql server that
is in an other machine. And... it is random, sometimes happens and
sometimes no...

Any idea?

Thanks!

Regards,
Alfons.

--
------------
Alfons Nonell-Canals, PhD
Chemogenomics Lab
Research Group on Biomedical Informatics (GRIB) - IMIM/UPF
Barcelona Biomedical Research Park (PRBB)
C/ Doctor Aiguader, 88 - 08003 Barcelona
al***********@upf.edu - http://cgl.imim.es
Tel. +34933160528

http://alfons.elmeuportal.cat
http://www.selenocisteina.info

Oct 28 '08 #1
2 2536
In message <ma**************************************@python.o rg>, Alfons
Nonell-Canals wrote:
_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL
server on 'HOST' (110)")
Error 110 is ETIMEDOUT (Connection timed out).
Oct 31 '08 #2
Alfons Nonell-Canals wrote:
Hello,
I've developed a program using python that have to connect to a mysql
server several times.

In a local machine (running the program in the same machine where the
mysql server is) I have no problems. I can run several instances of the
program at the same time with no problem.

Them problem arrives when I try to distribute the tasks to different
machines, for example, in a cluster. In this situation, the machine that
runs the python program is different than the machine that hosts the
database.

If I run the python program only an other machine, only one run of the
program, there is no problem. But, If I run the program in different
machines, all of them connecting to the same database server, randomly,
it crash. Crash all running programs! at the same time.

The output is clear:

File "/cgl/programs/ChemBang/config.py", line 67, in mysql
db = MySQLdb.connect(host=HOST, user="USER",
passwd="PASSWD",db="DATABASE")
File "/usr/local/lib/python2.5/site-packages/PIL/__init__.py", line
74, in Connect

File "build/bdist.linux-x86_64/egg/MySQLdb/connections.py", line 170,
in __init__
_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL
server on 'HOST' (110)")
That's not a crash. That's a normal event when the server is out
of resources. You can catch the exception and retry.

If that's happening frequently, either there's a network problem,
or the server has inadequate socket or MySQL resources configured.

Do a SHOW PROCESSLIST on the server to see what it's doing.
You may have clients which are keeping idle connections open and
tying up server resources.

John Nagle
Nov 17 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Lenz Grimmer | last post: by
reply views Thread by Anil Garg | last post: by
14 posts views Thread by Jim Sabatke | last post: by
3 posts views Thread by Kirk Soodhalter | last post: by
2 posts views Thread by pc | last post: by
5 posts views Thread by Frances | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.