Hi,

mySQL 3.23.49 on Debian GNU/Linux 3.0, Kernel 2.4.19 on a Xeon 2 Ghz (1
CPU) and 2 GB DDR-RAM. The following problem arises:

All mysqld processes (UNIX) consume too much CPU power. There are
usually a 4-10 active processes that want 30% to 99.9% of CPU power -
EACH of them. "top" just showed me 8 mySQL procs with each demanding 30%
of CPU. The load average of the system is at 20 right now. It also came
to my attention that there are plenty of mySQL-processes (processes
within mySQL) simply sleeping and never closing. 

I did the following to investigate the problem:

- "mysqladmin processlist" always brought up "Too many connections".
Therefore I changed the max_connections value to 500 for a test.
However, that would basically take the system down or bring it into a
unusable state as mySQL processes would build up and build up even more
and never close (especially the ones marked as "Sleep"). After a couple
minutes almost all 500 connections were used up. Load average was beyond
20.

- Test-wise I switched "wait_timeout" and "interactive_timeout" from 8
days (default value) to 60 seconds. Thereby the Sleep processes would
not stay open but instead get shut down by the system after 60 seconds -
this took some load away from the system (I thought).

- Now, with the timeout values set to only 10 seconds and the
max_connections to 100 I still have a unusable system. mySQL keeps
consuming more and more CPU and has plenty of processes (both UNIX and
within mySQL) open. The websites that access mySQL through PHP will only
load after 10 seconds, 30 seconds or sometimes never - depending on the
load. 

Would it be possible that a single PHP website that executes plenty of
queries can produce so much load to mySQL?

"mysqladmin status" shows: Uptime: 1685  Threads: 8  Questions: 27156 
Slow queries: 672  Opens: 10787  Flush tables: 1  Open tables: 65 
Queries per second avg: 16.116

All PHP (PHP 4.1.2 on Apache 1.3.26) is encoded by zend, so I cannot
really say what the code is like. However, I have a logfile that shows
all queries to mySQL. 

Does this sound like a flaw in the programming layout to you? Or rather
a configuration error somewhere? 

Any hints are greatly appreciated!

Thanks,
Markus

---------------------------------------------------------------------
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