> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/product-development/server-development/quality/benchmarks-and-long-running-tests/benchmark-results/threadpool-benchmarks.md).

# Threadpool Benchmarks

Here are some benchmarks of some development threadpool code (the [5.5 threadpool](/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/thread-pool/thread-pool-in-mariadb.md)).

The benchmarks were run on three machines:

* facebook-maria1 (Linux, 16 cores)
* pitbull (Linux, 24 cores)
* windows (Windows, 8 cores)

Sysbench 0.4 was used to run some "unit" OLTP tests (point-select and update-nokey), as well as the "classic" OLTP-readonly and OLTP-readwrite. All tests were run with the number of concurrent clients ranging from 16 to 4096, with warm cache, with the sysbench table having 1M records.

The results are quite different on all of the machines tested (the machines are very different, in terms of cores, IO etc), yet threadpool has a positive effect on all 3 machines, and the positive effect seems to grow with the number of cores.

Some notes on how the benchmarks were run:

1. The benchmark client and server used different CPUs - ('taskset' (Linux), or 'start /affinity' (Windows) were used to run the benchmark client on `#CPUs/4`, the rest of CPUs were used by the server). On the Linux boxes, `--thread_pool_size=<N>` (where N is number of cores dedicated to the server) was used.
2. `innodb_flush_log_at_trx_commit=0` and `innodb_flush_method=ALL_O_DIRECT` was used to avoid extensive fsyncing, which is ok for the purposes of the testing for this.
3. Every "write" benchmark (`oltp_rw` and `update_nokey`) started with a new server (i.e. kill mysqld, remove innodb files, and restart mysqld for each test). Every "read" benchmark, on the other hand, reused the same running server instance. Starting afresh with a new server on write benchmarks is done mainly to eliminate the effects of the purge lag.
4. The results are in queries-per-second (QPS).

## OLTP\_RO

### OLTP\_RO facebook-maria1

| concurrent clients    | 16   | 32   | 64   | 128  | 256  | 512  | 1024 | 2048 | 4096 |
| --------------------- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| thread per connection | 3944 | 4725 | 4878 | 4863 | 4732 | 4554 | 4345 | 4103 | 1670 |
| threadpool            | 3822 | 4955 | 4991 | 5017 | 4908 | 4716 | 4610 | 4307 | 2962 |

![oltp-ro-facebook-maria1](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-a585bf0cfb526798c9a6e3dcce8ce5097a4d33d7%2Foltp-ro-facebook-maria1.png?alt=media)

### OLTP\_RO pitbull

| concurrent clients    | 16   | 32   | 64   | 128  | 256  | 512  | 1024 | 2048 | 4096 |
| --------------------- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| thread per connection | 6754 | 7905 | 8152 | 7948 | 7924 | 7587 | 5313 | 3827 | 208  |
| threadpool            | 6566 | 7725 | 8108 | 8079 | 7976 | 7793 | 7429 | 6523 | 4456 |

![oltp\_ro-pitbull](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-6d88d64371485b1339e29f1e9e6ad891aa30bdfe%2Foltp_ro-pitbull.png?alt=media)

### OLTP\_RO Windows

| concurrent clients    | 16   | 32   | 64   | 128  | 256  | 512  | 1024 | 2048 | 4096 |
| --------------------- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| thread per connection | 1822 | 1831 | 1825 | 1829 | 1816 | 1879 | 1866 | 1783 | 987  |
| threadpool            | 2019 | 2049 | 2024 | 1992 | 1924 | 1897 | 1855 | 1825 | 1403 |

![oltp\_ro-windows](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-c7a05910c147871b65a4c77f7a6ba35cec3e79ba%2Foltp_ro-windows.png?alt=media)

## OLTP\_RW

### OLTP\_RW facebook-maria1

| concurrent clients    | 16   | 32   | 64   | 128  | 256  | 512  | 1024 | 2048 | 4096 |
| --------------------- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| thread per connection | 2833 | 3510 | 3545 | 3420 | 3259 | 2818 | 1788 | 820  | 113  |
| threadpool            | 3163 | 3590 | 3498 | 3459 | 3354 | 3117 | 2190 | 1064 | 506  |

![oltp\_rw-facebook-maria1](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-b2659992b5f867b80b28d40863166ea4e3a72eab%2Foltp_rw-facebook-maria1.png?alt=media)

### OLTP\_RW pitbull

| concurrent clients    | 16   | 32   | 64   | 128  | 256  | 512  | 1024 | 2048 | 4096 |
| --------------------- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| thread per connection | 4561 | 5316 | 5332 | 3512 | 2874 | 2476 | 1380 | 265  | 53   |
| threadpool            | 4504 | 5382 | 5694 | 5567 | 5302 | 4514 | 2548 | 1186 | 484  |

![oltp\_rw-pitbull](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-dd44dc9c2dd5dabce6770cdee00d3927fb49af41%2Foltp_rw-pitbull.png?alt=media)

### OLTP\_RW Windows

| concurrent clients    | 16   | 32   | 64   | 128  | 256  | 512  | 1024 | 2048 | 4096 |
| --------------------- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| thread per connection | 1480 | 1498 | 1472 | 1477 | 1456 | 1371 | 731  | 328  | 82   |
| threadpool            | 1449 | 1523 | 1527 | 1492 | 1443 | 1409 | 1365 | 1240 | 862  |

![oltp\_rw-windows](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-ea6078a4c4661cd1e71cb2474ac5416cc934bdee%2Foltp_rw-windows.png?alt=media)

## POINT\_SELECT

### POINT\_SELECT facebook-maria1

| concurrent clients    | 16     | 32     | 64     | 128    | 256    | 512    | 1024   | 2048   | 4096   |
| --------------------- | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ |
| thread per connection | 91322  | 113116 | 115418 | 114484 | 111169 | 104612 | 26902  | 12843  | 5038   |
| threadpool            | 100359 | 115618 | 118115 | 120136 | 119165 | 113931 | 110787 | 109970 | 104985 |

![point\_select-facebook-maria1](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-f05beb3e63faec54b9e894f5fd53b3fb58dc4be4%2Fpoint_select-facebook-maria1.png?alt=media)

### POINT\_SELECT pitbull

| concurrent clients    | 16     | 32     | 64     | 128    | 256    | 512    | 1024   | 2048   | 4096   |
| --------------------- | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ |
| thread per connection | 148673 | 161547 | 169747 | 172083 | 69036  | 42041  | 21775  | 4368   | 282    |
| threadpool            | 143222 | 167069 | 167270 | 165977 | 164983 | 158410 | 148690 | 147107 | 143934 |

![point\_select-pitbull](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-ef0fe98252537f607f469bb58c0e6e4be60e3716%2Fpoint_select-pitbull.png?alt=media)

### POINT\_SELECT Windows

| concurrent clients    | 16    | 32    | 64    | 128   | 256   | 512   | 1024  | 2048  | 4096  |
| --------------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
| thread per connection | 39734 | 42885 | 44448 | 44478 | 41720 | 38196 | 36844 | 35404 | 23306 |
| threadpool            | 42143 | 45679 | 47066 | 47753 | 46720 | 44215 | 43677 | 43093 | 44364 |

![point\_select-windows](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-06514aa9e6708ae539bbba1c29ac64cd2786c85e%2Fpoint_select-windows.png?alt=media)

## UPDATE\_NOKEY

### UPDATE\_NOKEY facebook-maria1

| concurrent clients    | 16    | 32    | 64    | 128   | 256   | 512   | 1024  | 2048  | 4096  |
| --------------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
| thread per connection | 60165 | 65761 | 67727 | 57232 | 47612 | 26341 | 8981  | 3265  | 389   |
| threadpool            | 65092 | 68683 | 67053 | 64141 | 64815 | 63047 | 63346 | 63638 | 62843 |

![update\_nokey-facebook-maria1](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-bc45ac0c534b3314d7d5efa32604c20a211de296%2Fupdate_nokey-facebook-maria1.png?alt=media)

### UPDATE\_NOKEY pitbull

| concurrent clients    | 16    | 32    | 64    | 128   | 256   | 512   | 1024  | 2048  | 4096  |
| --------------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
| thread per connection | 65213 | 71680 | 19418 | 13008 | 11155 | 8742  | 5645  | 635   | 332   |
| threadpool            | 64902 | 70236 | 70037 | 68926 | 69930 | 69929 | 67099 | 62376 | 17766 |

![update\_nokey-pitbull](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-9f9248070f8b7838c0b679a0937d7d0171deb537%2Fupdate_nokey-pitbull.png?alt=media)

### UPDATE\_NOKEY Windows

| concurrent clients    | 16    | 32    | 64    | 128   | 256   | 512   | 1024  | 2048  | 4096  |
| --------------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
| thread per connection | 24790 | 25634 | 25639 | 25309 | 24754 | 19420 | 5249  | 2361  | 824   |
| threadpool            | 25251 | 25259 | 25406 | 25327 | 24850 | 23818 | 23137 | 23003 | 22047 |

![update\_nokey-windows](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-f60df8ff83fc3bb1747b5ac536abd88de45b5b3e%2Fupdate_nokey-windows.png?alt=media)

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
