Troubleshooting Wordpress high pageload times / memory timeouts

Follow

In some cases, wordpress plugins may see an issue, which causes it to loop over and over, and cause a memory issue to load on the website regardless of the assigned php memory_limit.

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 92 bytes) in /home/username/public_html/wp-includes/class-wp-hook.php on line 298

using ps as the user, you can see the php application increasing it's RAM usage, and running in the background (this will only work in a suphp/lsapi environment).

#ps auxwwf
username  280337 98.0  5.6 1239224 914400 ?      RN  10:54  1:16  |  \_ /usr/bin/php /home/username/public_html/wp-admin/index.php

In order to trace the usage on this process, you can then go ahead and use the "strace" application to see what is doing it. In the example below, one wordpress plugin can be seen looping over and over, for 10-20 seconds, on the same lines, making it obvious which plugin is causing the high pageload time.

lstat("/home/username/public_html/wp-content", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/username/public_html/wp-content/plugins/plugin-name/admin/core/um-admin-filters-fields.php", {st_mode=S_IFREG|0644, st_size=5139, ...}) = 0
lstat("/home/username/public_html/wp-content/plugins/plugin-name/admin/core", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/username/public_html/wp-content/plugins/plugin-name/admin", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/username/public_html/wp-content/plugins/plugin-name", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/username/public_html/wp-content/plugins", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/username/public_html/wp-content", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/username/public_html/wp-content/plugins/plugin-name/admin/core/um-admin-columns.php", {st_mode=S_IFREG|0644, st_size=3218, ...}) = 0
lstat("/home/username/public_html/wp-content/plugins/plugin-name/admin/core", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/username/public_html/wp-content/plugins/plugin-name/admin", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

In the above example, you can then either decide to disable the broken plugin, or you can troubleshoot it further using the available wordpress debugging.

Have more questions? Submit a request

Comments

Powered by Zendesk