Mysql / WordPress killing my server with 80k users
I have recently installed wordpress in a production server with 80K fields in wp_users registered, 175K fields in wp_post table and 350K fields in wp_postmeta. Problem is that mysql database is consuming all CPU and getting server too slow. I disabled all plugings and renamed those plugins folders and problem persists.
top - 20:26:55 up 6 days, 16:01, 1 user, load average: 4.42, 4.47, 4.54
Tasks: 192 total, 2 running, 190 sleeping, 0 stopped, 0 zombie
%Cpu(s): 55.2 us, 3.4 sy, 0.0 ni, 40.7 id, 0.6 wa, 0.0 hi, 0.2 si, 0.0 st
KiB Mem : 32639948 total, 239032 free, 8069912 used, 24331004 buff/cache
KiB Swap: 8388604 total, 8375548 free, 13056 used. 23506600 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3957 mysql 20 0 1629756 232200 9344 S 384.1 0.7 106:23.68 mysqld
I have monitored mysql with mysql -u admin -p -e SHOW full PROCESSLIST; and gets repeated many times this same query:
| 13489 | mydbnumber1| localhost | mydbnumber1 | Query | 0 | Copying to tmp table | SELECT wp_users.user_login FROM wp_users INNER JOIN wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id ) WHERE 1=1 AND (
(
( wp_usermeta.meta_key = 'wp_capabilities' AND wp_usermeta.meta_value LIKE '%\administrator\%' )
)
) ORDER BY user_login ASC | 0.000 |
I have looked for this killer code query into all files of wordpress instalation and only found match in the file named: \wp-admin\includes\deprecated.php line 523. So I decided to comment that pece of code and upload back file deprecated.php to server, but problem persists!
This is crazy now, I have been now 2 days investigating this and I can not find a solution.
Topic mysql server-load query Wordpress performance
Category Web