Print
카테고리: [ MariaDB ]
조회수: 10794

 

 

-1. Innodb_thread_concurrency 란?

MariaDB는 싱글 프로세스지만 CPU core 수를 최대한 활용하기 위해 멀티 쓰레드 방식으로 구성됩니다. 

DB 내 동시에 수행되는 쓰레드가 너무 많으면 context switching 이 다량 발생하면서 성능이 저하 되고,

반대로 동시에 수행되는 쓰레드가 너무 적으면 서버 성능을 다 사용하지 못하는 비효율이 발생하게 되는데 

이 동시 수행가능 쓰레드를 설정하는 파라미터가 innodb_thread_concurrency 입니다.

innodb_thread_concurrency의 default value는 0 으로 필요한 thread 만큼 동시에 수행하겠다는 의미이며 권고값은 cpu core * 2 입니다.

 

-2. innodb_thread_concurrency 테스트

* 제 테스트 환경은 1 Processor / 2 core 입니다.

dori:sysbench mac$ sysbench --mysql-host=11.111.111.111 --mysql-port=3310   --mysql-user=sysbench --mysql-password=test  --mysql-db=sysbench --threads=10 --table-size=5000000 --tables=10 /usr/local/share/sysbench/oltp_read_write.lua  run

=> 10개 테이블에 대해 10개의 쓰레드로 select / DML 쿼리 수행

 
mysql> set global innodb_thread_concurrency=4;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like 'innodb_thread_con%';
+---------------------------+-------+
| Variable_name             | Value |
+---------------------------+-------+
| innodb_thread_concurrency | 4     |
+---------------------------+-------+
1 row in set (0.01 sec)

=> innodb_thread_concurrency 는 dynamic / global 파라미터로 운영 중 변경 가능함

 

-3. TEST 결과

innodb_thread_concurreny TPS
0 100.25
1 57.16
2 81.68
4 90.75
8 100.13