[MDEV-30470] High memory usage due to thread_cache_size option Created: 2023-01-25 Updated: 2023-01-25 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Memory |
| Affects Version/s: | 10.6.11 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Niels Hendriks | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | memory | ||
| Environment: |
Debian 11 |
||
| Description |
|
Hello, We have a bunch of servers where we notice a considerably higher amount of memory usage than expected. On a 32G instance this can be 5-8GB, on a 8GB server this can be 2GB of memory. Troubleshooting the cause of this, it seems to be related to the thread_cache_size option. The default value of this is 256, however we have changed this to 20 already. Over time, say 1-2 weeks, memory will slowly creep up and become much higher than we expect. In the documentation it states: Reading this, I would expect queries that require a bit of RAM to be cached for 5 minutes, and then be freed again. However, this appears not to be the case. The output of "Show processlist" does not show any lingering connections, and yet the memory keeps slowly increasing over a couple of days. Is there any way I can verify if the threads are being properly freed, and if not, why? Or anything else I can do to see "what" this memory is that is being held? Note we had this issue in other 10.6 releases as well but just didn't discover yet until now that the cause is the thread_cache_size option. |