admin管理员组

文章数量:1295316

Now my access to the WordPress post editing page is abnormally slow and I have to wait 30 seconds or more for it to finish loading each time.

Initially, I thought it was a problem with the network environment, but I tried to change to a different network to access it and still reproduce the problem.

So I troubleshot the server resource usage and found that the mysqld process puts the cpu at 100% high occupancy when accessing the post editing page.

Then I upgraded the server configuration, but the problem did not improve, so I ran SHOW FULL PROCESSLIST command to check and got the following result.

+-------+-------------+-----------+---------+---------+------+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+
| Id    | User        | Host      | db      | Command | Time | State                    | Info                                                                                                                                                                                                                                                                   | Progress |
+-------+-------------+-----------+---------+---------+------+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+
|     1 | system user |           | NULL    | Daemon  | NULL | InnoDB purge worker      | NULL                                                                                                                                                                                                                                                                   |    0.000 |
|     2 | system user |           | NULL    | Daemon  | NULL | InnoDB purge coordinator | NULL                                                                                                                                                                                                                                                                   |    0.000 |
|     3 | system user |           | NULL    | Daemon  | NULL | InnoDB purge worker      | NULL                                                                                                                                                                                                                                                                   |    0.000 |
|     4 | system user |           | NULL    | Daemon  | NULL | InnoDB purge worker      | NULL                                                                                                                                                                                                                                                                   |    0.000 |
|     5 | system user |           | NULL    | Daemon  | NULL | InnoDB shutdown handler  | NULL                                                                                                                                                                                                                                                                   |    0.000 |
| 22012 | root        | localhost | NULL    | Query   |    0 | Init                     | SHOW FULL PROCESSLIST                                                                                                                                                                                                                                                  |    0.000 |
| 20307 | root        | localhost | wpdb    | Query   |    2 | Creating sort index      | SELECT wp_users.ID,wp_users.user_login,wp_users.display_name FROM wp_users INNER JOIN wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id ) WHERE 1=1 AND ( ( wp_usermeta.meta_key = 'wp_user_level' AND wp_usermeta.meta_value != '0' ) ) ORDER BY display_name ASC    |    0.000 |
+-------+-------------+-----------+---------+---------+------+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+

This seems to indicate that the problem is because querying the user list takes a lot of time. My WordPress site does have a lot of registered users (50K+).

Is this a known issue with WordPress? How should I fix it?

Any help, thanks in advance!

本文标签: wp user queryHow to optimize the opening speed of admin panel