This repository was archived by the owner on Mar 1, 2026. It is now read-only.
Commit c89512b
committed
Bug#34781248 pooled connection not used if io.threads larger than 1
When connection pooling is used and a connection to a destination is
picked from the pool, it is ignored if the connection is belongs to
another io-thread.
- By default, as many io-threads are starts as there are CPU-threads.
- Each new connection is assigned another io-thread (round-robin)
E.g. a 24 core machine, with 2-threads per core, leads to 48 io-threads.
If a server-connection is taken from the pool for the current
client-connection then it must match the right:
- destination AND
- io-thread
With 3 possible destinations and 48 io-threads, the connection pool
has to contain 3 * 48 connections to have a good chance that there is 1
matching connection for this client-connection.
The higher the io-thread count, the lower the cache-hit rate.
Change
------
- ignore the io-thread when taking connections from the pool
- move pooled-connections to the current client connection's io-thread
when taken from the pool.
Change-Id: I586e7b5b1904a3a0020d6c8784928d549a1675e41 parent ff6d2f7 commit c89512b
3 files changed
Lines changed: 29 additions & 9 deletions
File tree
- router/src
- connection_pool/include/mysqlrouter
- routing/src
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
130 | 149 | | |
131 | 150 | | |
132 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | 227 | | |
231 | 228 | | |
232 | 229 | | |
| |||
243 | 240 | | |
244 | 241 | | |
245 | 242 | | |
246 | | - | |
247 | 243 | | |
248 | 244 | | |
249 | 245 | | |
250 | 246 | | |
251 | 247 | | |
252 | 248 | | |
253 | 249 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
259 | 253 | | |
260 | 254 | | |
261 | 255 | | |
| |||
269 | 263 | | |
270 | 264 | | |
271 | 265 | | |
| 266 | + | |
272 | 267 | | |
273 | 268 | | |
274 | 269 | | |
275 | 270 | | |
276 | 271 | | |
277 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
278 | 276 | | |
279 | 277 | | |
280 | 278 | | |
| |||
0 commit comments