Book Image

MariaDB Cookbook

By : Daniel Bartholomew
Book Image

MariaDB Cookbook

By: Daniel Bartholomew

Overview of this book

Table of Contents (20 chapters)
MariaDB Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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
    
  4. To disable threadpool on Linux, either change the thread_handling line to one-thread-per-connection, as on Windows, or remove the thread_handling line from our system's my.cnf file, and then restart MariaDB.

How it works...

When threadpool...