s51512 (tools.wikihistory) is the top CPU user of toolsdb:
root@labsdb1005[information_schema]> SELECT * FROM USER_STATISTICS ORDER BY cpu_time DESC LIMIT 1\G
*************************** 1. row ***************************
USER: s51512
TOTAL_CONNECTIONS: 2634803
CONCURRENT_CONNECTIONS: 0
CONNECTED_TIME: 70378868
BUSY_TIME: 27301657.775641054
CPU_TIME: 22565123.800680105
BYTES_RECEIVED: 9666784385
BYTES_SENT: 19169246173
BINLOG_BYTES_WRITTEN: 3235170216
ROWS_READ: 18429748528
ROWS_SENT: 33466060
ROWS_DELETED: 6515
ROWS_INSERTED: 10179413
ROWS_UPDATED: 8192371
SELECT_COMMANDS: 51657333
UPDATE_COMMANDS: 17789158
OTHER_COMMANDS: 2634765
COMMIT_TRANSACTIONS: 77495286
ROLLBACK_TRANSACTIONS: 4857285
DENIED_CONNECTIONS: 0
LOST_CONNECTIONS: 0
ACCESS_DENIED: 0
EMPTY_QUERIES: 19721750
1 row in set (0.00 sec)taking half of the total resources, in a database that serves hundreds to thousands of accounts:
root@labsdb1005[information_schema]> SELECT sum(cpu_time) FROM USER_STATISTICS; +-------------------+ | sum(cpu_time) | +-------------------+ | 40725292.63999812 | +-------------------+ 1 row in set (0.00 sec) root@labsdb1005[information_schema]>
This is specially important because as far as I can tell, there is 8 threads doing highly inneficient and easily optimazable queries (Using filesort on a lot of rows):
root@labsdb1005[(none)]> SHOW EXPLAIN FOR 63790240\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: dewiki_data
type: range
possible_keys: queue_sorting
key: queue_sorting
key_len: 9
ref: NULL
rows: 2451785
Extra: Using index condition; Using filesort
1 row in set, 1 warning (0.26 sec)Because of this, CPU is at 100% percent, leaving no resources for other users:
Please make the queries more efficient, reduce concurrency or ask for dedicated resources to avoid affecting other users. I ended up doing an analysis like this because a user complained of slowdown on toolsdb on IRC.
