Re: How can a script tell if there's a MySQL problem?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 9, 2009 at 11:07 AM, Per Jessen <per@xxxxxxxxxxxx> wrote:

> Brian Dunning wrote:
>
> > I have one server that's pretty busy and runs into "Too many
> > connections" from MySQL from time to time, and needs to have MySQL
> > restarted to clear it up.
>
> You need to restart MySQL just because of too many connections??
>
> > I've tried everything I can think of to have PHP take note of this
> > error but continue executing with other stuff, but no matter what I
> > try the PHP script stops whenever it encounters this and just displays
> > "Too many connections."
>
> Isn't that error returned by mysql_connect()?  Just write your code to
> work without the database connection.
>
>
> /Per Jessen, Zürich
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
1. Make sure you are freeing up all resources as soon as you can ->
mysql_close();

2. Change the my.cnf file connection number to a larger amount -> *
max_connections*

3. cache what you can (memcache, apc, filesystem, etc)

-- 

Bastien

Cat, the other other white meat

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux