So I'm running a MariaDB 10 database on a single core server; not super powerful, but then my needs aren't huge either.
However, one thing I've noticed is that if I look in
htop I have around 28
mysql entries visible in the list, which I believe is one process plus 27 threads (since
htop lists threads like processes by default).
However, this seems like a lot, as my database is configured to use a thread pool with a limit of 8 threads, rather than the default one thread per connection, and it isn't even using all of these (it's currently on two), so what are the other 25 threads for? Is there a way that I can reduce this number?
I know it's not necessarily a problem, however I have been experiencing infrequent slow queries (>0.5s rather than the usual <1ms, as most of my queries are very simple) and it seems like having too many threads could be a potential culprit if too many are suddenly waking up at once.
Is this number of threads normal? Is there a way that I can further reduce it, or are these extra threads doing something important?
sudo grep thread /etc/mysql/my.cnf thread_stack = 256K thread_cache_size = 8 thread_handling = pool-of-threads thread_pool_max_threads = 8 thread_pool_stall_limit = 200