There
was a discussion of this a while back. Mysql has a limit on the number
of connections it can handle. Every triple (apache process, webwork
course, read/write) gets its own connection to mysql, and the
connections are persistent. As a result, you can exhaust your
connection limit.
One way to ease this is to set replace webworkRead with webworkWrite in
you conf files. With mysql, there is no real reason why these need
different connections. I think this is different with gdbm where the
write connection will lock the database, but mysql only locks while
modifications are occurring. In particular, if webworkWrite just does a
read, mysql won't lock the database (or table or row). Doing this cuts
your connections in half, which may be enough.
The other thing is to start mysql with variables set to allow more
connections. In my experience with it so far, there is no real problem
with this. We have a big operation, and my big server currently has 169
connections, all of which are resting 99.999% of the time. Setting the
variable can be done via a command line argument, or through a
/etc/my.conf file (different versions of mysql support different
methods of doing this, so you may have to experiment).
For command line arguments, I use
/usr/bin/safe_mysqld --set-variable max_connections=5000 --set-variable table_cache=256
On machines where I use my.conf, the section reads:
[mysqld] port = 3306 socket = /var/run/mysql/mysql.sock skip-locking key_buffer = 16M max_allowed_packet = 1M table_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K myisam_sort_buffer_size = 8M max_connections = 5000
Most of these are defaults. The max_connections is the value I am pumping up.
John
<| Post or View Comments |>
|