alex@... (Alex McLintock) writes:
> Can anyone suggest ways to learn how to fine tune a MySQL
> database? I seem to have lots and lots of sleeping database
> connections from my Slashcode sites. They are filling up the
> available number of connections on my new machine resulting in
> lots of failed pages and eventually entire site failure.
How do you know the unused connections have anything to do with
your failed pages?
> mysql -V mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu
> Does the mod_perl not use some kind of DB connection pooling?
No, mod_perl (and Slash) don't use connection pooling. With MySQL
there is no reason to, creating new connections is supercheap
compared to most other DBs. What we do instead is have our httpd
processes make sure their connections are valid before using them,
and if mysqld wants to expire an old connection handle, Slash has
no problem with that.
If you really are running out of connections, try this in your
[mysqld] section of your my.cnf file, to raise your connection cap
or lower the time before mysqld lets go of an unused connection:
set-variable =3D max_connections=3D1200
set-variable =3D wait_timeout=3D10
Those are Slashdot's settings for our main DB. You probably won't
benefit from a timeout so low or a connection cap so high, so play
But keep reading...
> The first suspect is this....
> /etc/init.d/mysqld start
> Starting MySQL: [ OK ]
> [root@... mytop-1.0]# 040117 10:00:42 mysqld started
> Cannot initialize InnoDB as 'innodb_data_file_path' is not set.
No, that has nothing to do with number of connections. It means you
need to set your InnoDB data file path.
You really should be on 4.0.x instead of 3.23.x... it is more stable,
much faster, and among other things its default configuration
supports InnoDB without you having to fuss around :)