I have a Perl application on one Linux box (vanilla RedHat 7) that talks
to MySql on another Linux box (also vanilla RedHat 7) through DBI over
TCP/IP.
I am using
DBI-1.14
Msql-Mysql-modules-1.2215
mysql-3.22.32
perl 5.6.0
Application is called by Apache-1.3.15 running mod_perl
Application uses Apache::DBI
Normally everything works fine - the client can access the database on
the server without any problems. However, if a very large number of independent
database accesses happen in a very short space of time (say 4000 in 5 seconds)
I get the error:
Can't connect to MySQL server on '195.89.166.15' (11)
and the connect fails. If you wait a few seconds, then it will
recover and start letting you connect again.
A "show status;" on MySQL shows nothing
extraordinary - only 6 connections have
been made...
+--------------------------+----------+
| Aborted_clients | 0 |
| Aborted_connects | 0 |
| Created_tmp_tables | 282 |
| Delayed_insert_threads | 0 |
| Delayed_writes | 0 |
| Delayed_errors | 0 |
| Flush_commands | 1 |
| Handler_delete | 2 |
| Handler_read_first | 6 |
| Handler_read_key | 75057 |
| Handler_read_next | 184464 |
| Handler_read_rnd | 13815742 |
| Handler_update | 224 |
| Handler_write | 792 |
| Key_blocks_used | 79 |
| Key_read_requests | 147009 |
| Key_reads | 78 |
| Key_write_requests | 221 |
| Key_writes | 218 |
| Max_used_connections | 6 |
| Not_flushed_key_blocks | 0 |
| Not_flushed_delayed_rows | 0 |
| Open_tables | 40 |
| Open_files | 74 |
| Open_streams | 0 |
| Opened_tables | 44 |
| Questions | 217570 |
| Running_threads | 4 |
| Slow_queries | 0 |
| Uptime | 142287 |
+--------------------------+----------+
... so I'm a bit baffled as to where to look. This seems
to happen *consistently* when the accesses reach 4000 or
so in a short space of time, and doesn't happen
when the database and the app are on the same
machine.
I realise that this is partially off-topic for this list - but
it seemed to be a good starting point as it is DBI that
is sending me back an error that I don't really understand.
Many thanks,
Chris Allen
[EMAIL PROTECTED]