Bug #61204 Inacurate statistics on a server with 50% persistent connections
Submitted: 17 May 2011 15:24 Modified: 18 May 2011 9:35
Reporter: Julien Palard Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.0.51a OS:Linux (mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (x86_64))
Assigned to: CPU Architecture:Any
Tags: persistent connections, slow queries, statistics

[17 May 2011 15:24] Julien Palard
Description:
Hi,

Here we have a very wired bug with mysql 5.0.51a :

1) Initially our application used only non-persistent connections, statistics were correct (slow queries, query counter, etc)

2) We rewrote our application to use persistent connections but slowly, we had during a few months 50% of our connections persistent, 50% not. During this period, all stats went down by a factor of 2 or 3, I mean only 2/3 of slow queries were logged, queries counters (inserts / selects / qcache ..) where only ~1/2 of the reality, etc ...

3) Then we finally upgraded completly our application, running 100% with persistent connections, and the statistics came back normally (as before the transition period)

Others system counters (bandwidth, disk usage, cpu usage, load average, interrupts) didn't move a pixel, so that seems really the mysql counters having a problem here, not my architecture.

Initially I created a forum thread with some interesing details, like a counter decreasing (during the 'wired' period) : http://forums.mysql.com/read.php?20,408259,408259#msg-408259

How to repeat:
Didn't have the tools and time to try to reproduct it on a completly different environment, hoping that it's not hard to reproduce.
[17 May 2011 18:52] Shane Bester
do persistent connections are calling mysql_change_user, and bug #31222 could be to blame ?
[18 May 2011 9:35] Julien Palard
It seems the bug http://bugs.mysql.com/bug.php?id=31222 as Shane Bester said, we'll upgrade but it will be hard to try it ... I think this bug can be closed as i think that this bug is a duplicate of 31222