ps axuw| grep mysql
indicates only MySQL process, but if I run htop I can see 10 rows each one of them with a separate PID. So I wonder if they are threads or processes that for some reason I cannot see using ps.
Would it make any sense to try to limit them to two on my development machine, where I don't need concurrent access of many clients.
BTW Running on Ubuntu 8.10
The maximum number of threads per group is 4096 (or 4095 on some systems where one thread is used internally). The thread pool separates connections and threads, so there is no fixed relationship between connections and the threads that execute statements received from those connections.
MySQL is fully multithreaded, and makes use of all CPUs made available to it. Not all CPUs may be available; modern operating systems should be able to utilize all underlying CPUs, but also make it possible to restrict a process to a specific CPU or sets of CPUs.
The 'SHOW processlist' command can be used to display the running thread related to only your MySQL account. We can see almost all running threads if we have process privileges. It shows which threads are running.
The MySQL Thread Pool is a MySQL server plugin that extends the default connection-handling capabilities of the MySQL server to limit the number of concurrently executing statements/queries and transactions to ensure that each has sufficient CPU and memory resources to fulfill its task.
You can set the max number of threads in your my.ini like this:
max_connections=2
However you might also want to set this:
thread_cache_size=1
The thread cache controls how many it keeps open even when nothing is happening.
MySQL does use threads, ps
can see them if you run ps -eLf
.
That said, I wouldn't worry about it - dormant threads use almost no resources whatsoever, and if you constrain the server too much it's bound to come back and bite you on the backside sometime later when you've forgotten that you did it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With