2

I'm on a test VM based on VMWare with MariaDB + nginx installed; when looking with htop this is the situation:

htop output

So we have 26 threads under the main process.

I know that inactive threads doesn't impact so much in memory / performaces, but for my "know how", is there a way (parameters?) to reduce the number of child threads under MariaDB / MySQL?

Googling around I've found something related to max_connections and thread_concurrency parameters that I've set both to 5 but once restarted nothing changed.

Thank you very much for your answers!

2
  • 2
    An active server will have dozens, hundreds, or even thousands of threads. I would suggest that you're looking at an entirely uninteresting and very small number, with only 26. May 21, 2019 at 1:52
  • 1
    There is a low overhead for threads which is why they are used. Its not worth spending too much effort reducing them unless you have a specific problem traced back to threads.
    – danblack
    May 21, 2019 at 4:42

2 Answers 2

1

Once you have had some activity, I think the number of threads varies between

(misc) + thread_cache_size
(misc) + max_connections

thread_concurrency was specific to Solaris 8, and has been removed from newer versions of MySQL/MariaDB.

Where (misc) is 1 for the main process plus replication slave threads plus innodb read/write/purge threads. (Thanks danblack)

1
  • 1
    + replication slave threads + innodb read/write/purge threads.
    – danblack
    May 21, 2019 at 4:41
0

Per current Maria DB reference manual,

From MariaDB 10.2.0, the default is automatically set to the smaller of either 256, or the max_connections size.

Consider leaving it out of your my.cnf or my.ini for auto sizing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.