>Occasionally, I get a "Too many connections" error from MySQL on my
There are several versions of this limit:
max_connections is server-wide.
max_user_connections is a limit on any particular MySQL user. 0
indicates no limit (subject to the server-wide limit). This limit
prevents one user going nuts blocking out the other users. Because
of oversell, it probably won't prevent half the users blocking out
the other half, which is likely your problem.
A MySQL user, after 5.0.3, may have a connections resource limit.
If this is specified, it overrides max_user_connections.
This may not be used much by hosting companies as MySQL 5.0 adoption
and using its features may not be widespread yet.
What you may be looking for in a host is a large value of:
max_connections minus the sum of max_user_connections for all the
other users (in other words, the number of connections reserved
exclusively for you, no matter how piggy the others get).
Note that persistent connections (using PHP, for example) can make
this problem MUCH, MUCH WORSE. Suppose Apache is configured for a
maximum of 50 processes (it can only handle 50 simultaneous hits,
any others wait. This isn't a particularly generous configuration).
You have 40 users, each with their own login and database. With
persistent connections, and all sites reasonably active, eventually
you'll hit 40 connections in each of 50 processes = 2000 connections.
Even if the site never gets more than one hit a minute combined for
all customers, and has never needed more than 5 simultaneous
connections in a year.