Re: PHP and mySQL getting smashed...

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

 



On Wed, May 17, 2006 6:55 am, Russell Jones wrote:
> I have a site that is getting 30K+ traffic daily and it is smashing
> mySQL -
> any ideas on what to do to make the mysql connections more efficient,
> or
> anything in general. No bandwidth issue here, just the server getting
> killed.

It depends on the application.

For something with many reads and fewer writes like a forum or basic,
if busy, e-commerce you'd consider setting up MySQL replication with
one master for WRITE operations and multiple slaves for SELECT
operations.

For something with a high write/read ratio such as eBay, that would be
a wildly-unsuitable solution.

Your best bet is to ask the MySQL folks, honestly, since it's unlikely
that anything in PHP is going to be "the answer" to this one.

If you have RAM to spare, you could:
Configure /etc/my.cnf to have N + X connections
Use http://php.net/mysql_pconnect

N would be the number of Apache Max children

X would be a "few" spare connections so that, if, say, you NEED to use
shell 'mysql' monitor to DO something, the fact that ALL N connections
are taken by Apache, won't lock you out.

There are significant RAM issues with pconnect, as well as some bugs
in various versions of PHP/MySQL that make this answer a no-go.  Tread
carefully.

But it's at least an on-topic answer, even if an incomplete and maybe
downright bad answer.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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