Mysql – Random Connections to MySQL refused (Error 111)

dbiMySQLperlssl

A Perl/CGI webapp that has been running fine for almost a year has started to randomly been unable to connect to a remotely hosted MySQL. The Error thrown is :

Can't connect to MySQL server on 'xx.x.xxx.xx' (111)

Reloading the page often solves the problem
The client is using Perl, DBI and SSL to connect to MySQL using the same configuration file each time.

MySQL 5.0 Server Running RH EL5

  • Quad-Core AMD Opteron(tm) Processor 2374 HE, 8 cores
  • Real Memory: 15.73 GB total, 11.81 GB used
  • allows networking in my.cnf

  • max-connections are not being met

  • load is low.

  • The servers firewall is open to
    the client's subnet.

  • The mysql user has permissions
    from the client's subnet.

I have my host looking into the problem but so far we're all stumped as to way the occasional connection is (increasingly getting refused)

Any advice what to check that would cause the random refusal of connections?

Best Answer

The cause was do to a infrastructure problem with my host. My Scripts were hosted in a Cloud environment. A "neighbor" on the node was was exhausting all the outbound ports. Once the host managed the traffic better by adding capacity the problem stopped.

I'm guessing that I was getting the (111) error because by the time the connections were able to get to the database server through the clouds firewall they were considered timed out.