On Friday, November 7, 2003, at 01:21 PM, Hugh Beaumont wrote:
Hi List,
I've searched the archives and the web many times in the past for answers to the following
questions but never really got a complete understanding of what is going on. Hopefully someone on
the list will be able to take the time to set me straight.
I have a typical php + mysql + linux setup. Today I noticed a high load, and checked things out
with:
mysql% show processlist;
it showed 6 processes running:
[ I'll skip all the ascii output since it usually ends up garbled]
6 rows in set (0.00 sec)
however if I do:
ps axuw | grep "mysql" | wc -l
I get:
28
What is going on here?
Looks like your OS has threads in user space as processes rather than in kernel space.
Do I have 28 mysqld's waiting around for requests and just 6 actually processes running?
You have one mysqld with 28 threads waiting for requests, only 6 are actually processing requests.
Is there any way to regulate this - something similiar to apache's max_clients, min spare server,
max spare servers, etc?
I don't recall any way to limit the number of threads created, but there is a way to limit the number of threads that are handling delayed inserts - max_delayed_threads and thread_cache_size will tell mysql how many threads to keep around waiting for something to do. in your case, since the threads are in user space, they tend to be more expensive to create, so if your mysql server is busy, you may want to leave a bunch waiting around to process requests.
Be aware that the following variables are per-thread, and if they are set high, will consume a lot of RAM:
read_buffer (was record_buffer) record_rnd_buffer sort_buffer
We often have mysql just totally melt down a server - someone will run a bit query and then all
the others start to back-up. We then end up with a ton of queries trying run at once, the load
goes to 50 or even 100(!).
How many users & databases are there on this server? Is the server dedicated to just MySQL? What kinda hardware is it running on?
- Gabriel
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
