Using thread_statistics does not clear state when a thread goes away
Bug #1580710 reported by
colin
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
New
|
Undecided
|
Unassigned |
Bug Description
When running Percona Server 5.6.28-76.1 with thread_statistics=1 and userstat=1, I notice that memory constantly increases with each new connection (from basic calculations, ~400 bytes per connection).
In our case, applications recycle connections every 10 minutes or after N number of usages. Over time this will result in a large number of connections being used.
IMO the hash table (global_
I reproduced this locally by continuously reconnecting a client and observed the RSS of mysqld.
tags: | added: userstat |
To post a comment you must log in.
There are use cases for historical data in THREAD_STATISTICS, i.e. not all the users would appreciate data for disconnected connections disappearing at the same moment. On the other hand, keeping everything results in unbounded memory growth and is not desirable neither as you found. We could introduce an option to keep 10000 or a different number of most recent entries, but I'm not sure the implementation is suitable for such limit at the moment.
Does regular FLUSH THREAD_STATISTICS work for you as a workaround?