[MXS-3141] No persistent connections Created: 2020-08-28 Updated: 2021-04-19 Resolved: 2021-04-19 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | Core |
| Affects Version/s: | 2.5.2, 2.5.3, 2.5.5 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Alex | Assignee: | markus makela |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian 9, Debian 10 |
||
| Description |
|
I've enabled persistent connections but they are not used. I have more then 4000 connections in TIME_WAIT state per server Application connects via PHP 7.4 mysqli maxctrl show server:
|
| Comments |
| Comment by markus makela [ 2020-08-28 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Can you add the maxscale.cnf? Please make sure to remove passwords and IP addresses from the configuration before posting it. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alex [ 2020-08-28 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by markus makela [ 2020-08-31 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It's possible that all the connections in the pool are already in use and there are no connections left over. I think we can improve the statistics output of the servers to show how many connections have been taken from the connection pool. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alex [ 2020-08-31 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I've checked on the server side. Connections are not persist. Besides: persistpoolmax=500 "connections": 289 persistmaxpool is 500 connections and there are only 289 connections | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by markus makela [ 2020-09-01 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Ah yes, that is of course true. I apologize for missing that. Do you see this behavior with the latest 2.4 release as well? We're in the process of releasing MaxScale 2.5.3 and when it is released, we'd recommend testing with that as well to see if this is a side-effect of some other bug. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alex [ 2020-09-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sorry, We are not using 2.4. So cannot tell. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alex [ 2020-09-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Installed 2.5.3 - same problem | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by markus makela [ 2020-12-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
We added new statistics in MaxScale 2.5.4 that better track the persistent connection usage. Have you had the chance to upgrade to it yet and see what the statistics are? The statistics in question are max_pool_size, reused_connections and connection_pool_empty in the output of maxctrl show server. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alex [ 2020-12-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I've upgraded to 2.5.5. Will check and report | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alex [ 2020-12-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Statistics from two servers:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by markus makela [ 2020-12-14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Looks like the connection pool is working correctly: it's empty because it's being constantly used. It does seem a little suspicious that the pool never gets big enough to fill up completely. This might still be something we have to investigate as the number of times the pool has been empty is pretty high compared to the times it's not. One thing we could also track is the number of connections that were closed and not put into the pool. This could explain why the pool is not used if the connections are somehow ineligible from being pooled. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by markus makela [ 2021-03-10 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If you increase persistmaxtime, does the amount of connections stored in the pool increase? On average, how long are your client connections to MaxScale? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alex [ 2021-04-19 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Fixed in 2.5.10 together with "Packets out of order" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by markus makela [ 2021-04-19 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
OK, that's great to hear. I'll go ahead and close this issue then. We can just assume that the fix was related to |