Troubleshooting WordPress high pageload times / memory timeouts

Prev Next

In some cases, WordPress plugins may encounter an issue that causes them to loop repeatedly, leading to a memory problem 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

Notes:

The procedure requires SSH access to the user account, along with command-line experience. 


Using "ps" as the user, you can see the PHP application increasing its RAM usage and running in the background (this method 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


To trace the usage of 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 page load 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.

Please note!

Scripting or Website content related issues are out of Servers Australia’s support scope, so we can only provide very minimal assistance on these and recommend reaching out to a developer or the WordpPess theme/plugin creator.