I want to know is there anyway to get CPU usage per user in MySQL? for example I have 3 different users 'user1', 'user2' and 'user3'. I want to get the average/real time memory usage and CPU usage of these users.I googled a lot but I did not find any suitable tool. Maybe I can get these data from MySQL queries, but I don't know where are they stored.
1 Answer 1
Some resource limitations: https://dev.mysql.com/doc/refman/5.6/en/user-resources.html and https://mariadb.com/kb/en/library/grant/#resource-limit-options
Switch to MariaDB to get "user stats" (connections, bytes, rows, CPU, etc): https://mariadb.com/kb/en/library/information-schema-user_statistics-table/ and https://mariadb.com/kb/en/library/user-statistics/
-
its show CPU_TIME but i want to have CPU usage in Percentage or Frequency.behnam bahadori– behnam bahadori2019年05月13日 06:12:10 +00:00Commented May 13, 2019 at 6:12
-
@behnambahadori - Does it give enough raw data such that you can compute Percentage or Frequency?Rick James– Rick James2019年05月13日 18:01:31 +00:00Commented May 13, 2019 at 18:01
-
I want to know how can i use raw data to getting CPU usage in Precentage, now i don't have any idea for this issue...behnam bahadori– behnam bahadori2019年05月15日 05:17:07 +00:00Commented May 15, 2019 at 5:17
-
I know how I can get the CPU usage in time (top, ps, user_statistics,...). I want to know is there anyway to convert the %CPU time to cpu core? I run top for 5 seconds after 5 seconds I get 30% for %CPU from top which is 1.5 seconds. and mysql shows 60% within the 5 seconds which means 0.9 seconds is for mysql. Now how can I convert this value to cpu core? for example mysql used 1.2 cores during a 5 secind periodbehnam bahadori– behnam bahadori2019年05月15日 07:38:45 +00:00Commented May 15, 2019 at 7:38