On Wed, 18 Apr 2001, Jesse E. Stay II wrote:

> I'm having a problem, which has occured before, in which I keep getting "Too
> Many Connections" Errors in my logs on the web server for MySQL.  I am using
> Apache::DBI to connect.  I fixed the problem before by just increasing the
> max_connections.  Unfortunately, I am at the max amount of max_connections
> (the MySQL docs say that in order to increase it, you have to compile it in
> with the code, which I would rather not do.), and I cannot add any more.  If
> I switch to just regular DBI, will that solve my problem, or what else could
> be causing this problem to occur?  I've got my boss breathing down my neck,
> and I'm unsure what answer to give him.

Here's some random thoughts:

If you have more Apache processes running than you have maximum
connections (I think the hard maximum is around 1000), then you will run
out of connections.

One thing you could try is setting "MaxClients" in httpd.conf to your
max_connections. This will prevent Apache from spawning too many
processes, but may cause people viewing your website to have to wait
longer.

If you use the normal DBI instead of Apache::DBI, then connections will be
non-persistent and you'll have more to go around, at the cost of slightly
slower website response time.

There might be a problem somewhere that is causing your system to use up
more MySQL connections than it should. 1000 is a lot of connections, and
it shouldn't use that many unless your website is very heavily loaded. (I
had a website that got 3 million page views a month and it fit in 40
simultaneous connections, but it was all static files so queries could be
served quickly.)

-Philip Mak ([EMAIL PROTECTED])


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to