FAQ
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
alfons.nonell at upf.edu - http://cgl.imim.es
Tel. +34933160528

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

Search Discussions

  • Tino Wildenhain at Oct 28, 2008 at 12:45 pm
    Hi,

    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: ....
    _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...
    Maybe there is a certain connection limit which hits if your client
    programms reconnect in random order? I saw this on some PHP web sites.

    Probably some configuration adjustments and persistent connections
    could help you in this situation.

    Also, was the choice of MySQL a conscious one?

    Regards
    Tino
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: smime.p7s
    Type: application/x-pkcs7-signature
    Size: 3241 bytes
    Desc: S/MIME Cryptographic Signature
    URL: <http://mail.python.org/pipermail/python-list/attachments/20081028/b6fb0e43/attachment.bin>
  • Alfons Nonell-Canals at Oct 28, 2008 at 1:53 pm
    Hi,

    Maybe there is a certain connection limit which hits if your client
    programms reconnect in random order? I saw this on some PHP web sites.

    Probably some configuration adjustments and persistent connections
    could help you in this situation.
    I know I can check it but I am not the admin of the server where the
    mySQL server is and before to check it with the sysadmin I would like to
    discard other possibilities (they ask me to do this before) :-(
    Also, was the choice of MySQL a conscious one?
    Yes, the choice of MySQL is conscious because I have to manage huge
    amounts of data and I already have some experience in mySQL which makes
    it easier.

    Regards,
    Alfons.

    Regards
    Tino
    --
    ------------
    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
    alfons.nonell at upf.edu - http://cgl.imim.es
    Tel. +34933160528

    http://alfons.elmeuportal.cat
    http://www.selenocisteina.info
  • Tino Wildenhain at Oct 28, 2008 at 2:14 pm

    Alfons Nonell-Canals wrote:
    Hi,

    Maybe there is a certain connection limit which hits if your client
    programms reconnect in random order? I saw this on some PHP web sites.

    Probably some configuration adjustments and persistent connections
    could help you in this situation.
    I know I can check it but I am not the admin of the server where the
    mySQL server is and before to check it with the sysadmin I would like to
    discard other possibilities (they ask me to do this before) :-(
    Well in this case just open as many connections in a loop
    as you can and watch for the outcome.
    Also, was the choice of MySQL a conscious one?
    Yes, the choice of MySQL is conscious because I have to manage huge
    amounts of data and I already have some experience in mySQL which makes
    it easier.
    But with no other open source database I presume? Watch out! There are
    lots of diamonds beside your way :-)

    Regards
    Tino

    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: smime.p7s
    Type: application/x-pkcs7-signature
    Size: 3241 bytes
    Desc: S/MIME Cryptographic Signature
    URL: <http://mail.python.org/pipermail/python-list/attachments/20081028/e01c66ef/attachment.bin>
  • Lawrence D'Oliveiro at Oct 31, 2008 at 9:54 pm
    In message <mailman.3154.1225192902.3487.python-list at python.org>, Alfons
    Nonell-Canals wrote:
    _mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL
    server on 'HOST' (110)")
    Error 110 is ETIMEDOUT (Connection timed out).

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedOct 28, '08 at 11:21a
activeOct 31, '08 at 9:54p
posts5
users3
websitepython.org

People

Translate

site design / logo © 2021 Grokbase