Uploaded image for project: 'Percona Server'
  1. Percona Server
  2. PS-1193

LP #728082: USER_STATISTICS shows incorrect value for number of concurrent connections

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      **Reported in Launchpad by Swany last update 24-11-2016 09:01:09

      mysql> select * from USER_STATISTICS where user='cactiuser'\G

                                                          • 1. row ***************************
                                                            USER: cactiuser
                                                            TOTAL_CONNECTIONS: 1002
                                                            CONCURRENT_CONNECTIONS: 0
                                                            CONNECTED_TIME: 23918
                                                            BUSY_TIME: 41
                                                            CPU_TIME: 32
                                                            BYTES_RECEIVED: 1823054
                                                            BYTES_SENT: 933888
                                                            BINLOG_BYTES_WRITTEN: 0
                                                            ROWS_FETCHED: 698035
                                                            ROWS_UPDATED: 4422
                                                            TABLE_ROWS_READ: 19428245
                                                            SELECT_COMMANDS: 7832
                                                            UPDATE_COMMANDS: 2398
                                                            OTHER_COMMANDS: 4620
                                                            COMMIT_TRANSACTIONS: 9306
                                                            ROLLBACK_TRANSACTIONS: 0
                                                            DENIED_CONNECTIONS: 0
                                                            LOST_CONNECTIONS: 0
                                                            ACCESS_DENIED: 0
                                                            EMPTY_QUERIES: 2625
                                                            1 row in set (0.00 sec)

      Note that CONCURRENT_CONNECTIONS shows 0, but it should always be at least 1, and in this case it should be much higher:

      In the following snippet from SHOW PROCESSLIST you can see multiple concurrent connections by this user:

                                                          • 19. row ***************************
                                                            Id: 389
                                                            User: cactiuser
                                                            Host: localhost
                                                            db: cacti
                                                            Command: Sleep
                                                            Time: 710
                                                            State:
                                                            Info: NULL
                                                          • 20. row ***************************
                                                            Id: 390
                                                            User: cactiuser
                                                            Host: localhost
                                                            db: cacti
                                                            Command: Sleep
                                                            Time: 3937
                                                            State:
                                                            Info: NULL
                                                          • 21. row ***************************
                                                            Id: 391
                                                            User: cactiuser
                                                            Host: localhost
                                                            db: cacti
                                                            Command: Sleep
                                                            Time: 710
                                                            State:
                                                            Info: NULL
                                                            21 rows in set (0.00 sec)

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                lpjirasync lpjirasync (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: