O'Reilly logo

MariaDB Cookbook by Daniel Bartholomew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring threadpool

Pool-of-threads, or threadpool, is a MariaDB feature that improves performance by pooling active threads together instead of the old one thread per client connection method, which does not scale well for typical web-based workloads with many short-running queries.

How to do it...

  1. To enable threadpool on Linux, add the following line of code to our my.cnf file (or to an existing [mysqld] section) and then restart MariaDB:
    [mysqld]
    thread_handling = pool-of-threads
  2. To enable threadpool on Windows, we don't have to do anything as it is set by default and uses the native Windows thread pooling.
  3. To disable threadpool on Windows, add the following to our main my.ini file and then restart MariaDB:
    [mysqld]
    thread_handling = one-thread-per-connection ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required