🦸‍♂️
KT's DevOps Notes
  • Hello World
  • Misc
    • Ubuntu Setup
    • Mac Os Setup
  • Database
    • Redis
      • How To Migrate Redis Data to a DigitalOcean Managed Database
      • How To Connect to a Managed Redis Instance over TLS with Stunnel and redis-cli
    • MariaDB
      • How to Setup MariaDB Galera Cluster on Ubuntu 18.04 with HAProxy
      • How to change innodb_thread_concurrency Read/Wirte Concurrency in MySQL
      • How to change innodb_write_io_threads in MySQL
      • How to change innodb_read_io_threads in MySQL
  • OCI Foundations 2020 Associate Certification | 1Z0–1085–20 | Preparation…
  • Security
  • Ubuntu
    • Apache Server Configuration
      • Configuring Let’s Encrypt SSL Cert for Apache on Ubuntu 18.04
      • Installing Apache, MySQL, PHP (LAMP) Stack on Ubuntu 18.04
      • Installing Apache on Ubuntu 18.04 with Multiple Domains
    • Nginx Server Configuration
      • Robots.txt disallow all with nginx
      • Installing Nginx, MySQL, PHP (LEMP) Stack on Ubuntu 18.04
      • Installing Nginx on Ubuntu 18.04 with Multiple Domains
      • Configuring Let’s Encrypt SSL Cert for Nginx on Ubuntu 18.04
    • Creating Swap Space on Ubuntu 18.04
    • Dell Inspiron 7559 Ubuntu Linux Guide
    • How to configure Postfix to use Gmail SMTP on Ubuntu 18.04 & 16.04 | LeetDev
  • Setting up SSL Certificates for HAProxy with certbot
  • PHP
  • PHP / Apache: Set Max File Upload and Post Size | LeetDev
  • Upgrade centos7 openssh & openssl to the latest version
  • Downgrading to php7.3 on Amazon Linux 2
Powered by GitBook
On this page

Was this helpful?

  1. Database
  2. MariaDB

How to change innodb_thread_concurrency Read/Wirte Concurrency in MySQL

I will give an example of changing innodb_thread_concurrency in MySQL. Since InnoDB uses operating system threads to process user transactions, the innodb_thread_concurrency parameter allows you to limit them. By default in new MySQL versions the value is 0, which means that there is no limit on the number of simultaneously executed threads and this is correct for modern servers. If you want to limit, then when the limit is reached, the extra threads will wait a certain number of microseconds specified in the innodb_thread_sleep_delay parameter, and then try to get into the queue. Also in MySQL 5.6.3 and higher, the innodb_adaptive_max_sleep_delay parameter was added which allows you to specify the maximum number of microseconds for the innodb_thread_sleep_delay parameter and then InnoDB automatically adjusts innodb_thread_sleep_delay.

I will give an example of viewing the current value:

show variables like 'innodb_thread_concurrency';

If the value is not 0, then I recommend setting it:

set global innodb_thread_concurrency=0;

The changes will take effect without restarting the MySQL server. So that the changes are not discarded after restarting MySQL, we will also indicate them in the configuration file:

[mysqld]
innodb_thread_concurrency=0

Post navigation

PreviousHow to Setup MariaDB Galera Cluster on Ubuntu 18.04 with HAProxyNextHow to change innodb_write_io_threads in MySQL

Last updated 3 years ago

Was this helpful?