WP-Admin Slow Loading pages on some servers. WordPress would usually take 2-15 seconds to load back end pages. I spend a lot of time troubleshooting this problem. Searching Google revealed little to no help, some solutions I found were:
- JetPack Causes Slow WordPress Admin pages
- Disable all plugins to find one that is causing the slow down.
Temporarily turning off JetPack did not solve the problem and I did not want to shut any vital WordPress plugins off.
TROUBLESHOOTING WP-ADMIN SLOW LOADING PAGES
To find this problem simply looking through the server logs revealed the problem. The most telling was ./var/log/messages. Errors in the logged look like this:
Jul 31 08:55:20 nsdomain named[26284]: error (network unreachable) resolving 'wordpress.org/DS/IN': 2001:500:48::1#53 Jul 31 08:55:20 nsdomain named[26284]: error (network unreachable) resolving 'wordpress.org/DS/IN': 2001:500:b::1#53 Jul 31 10:07:04 nsdomain named[26284]: error (network unreachable) resolving 'yoast.com.dbl.spamhaus.org/A/IN': 2610:80:4:7:21e:68ff:fe65:5098#53 Jul 31 10:04:40 nsdomain named[26284]: error (network unreachable) resolving 'graph.facebook.com/AAAA/IN': 2a03:2880:fffe:c:face:b00c:0:35#53 Jul 31 10:04:40 nsdomain named[26284]: error (network unreachable) resolving 'graph.facebook.com/A/IN': 2a03:2880:fffe:c:face:b00c:0:35#53 Jul 31 10:04:40 nsdomain named[26284]: error (network unreachable) resolving 'api.facebook.com/A/IN': 2a03:2880:ffff:c:face:b00c:0:35#53 Jul 31 10:04:40 nsdomain named[26284]: error (network unreachable) resolving 'api.facebook.com/AAAA/IN': 2a03:2880:ffff:c:face:b00c:0:35#53 Jul 31 10:04:41 nsdomain named[26284]: error (network unreachable) resolving 'widgets.pinterest.com/AAAA/IN': 2001:500:94:1::60#53 Jul 31 10:04:41 nsdomain named[26284]: error (network unreachable) resolving 'widgets.pinterest.com/A/IN': 2001:500:94:1::60#53 Jul 31 10:16:18 nsdomain named[26284]: error (network unreachable) resolving 'cdn.api.twitter.com.ovh.net/AAAA/IN': 2001:41d0:1:4a82::1#53 Jul 31 10:16:18 nsdomain named[26284]: error (network unreachable) resolving 'cdn.api.twitter.com.ovh.net/A/IN': 2001:41d0:1:4a82::1#53
The messages log was filled with these.
Using “Tail -f /var/log/messages” in the shell and loading any WP-Admin Slow WordPress back end page told me everything I needed to know. As soon as any wp-admin pages were loaded, the errors above would appear in the log.
SOLUTION
Enable IPV6 on the server so IPV6 DNS lookup could be executed server side. Or alternatively completely disable IPV6 and only use IPV4 (This is not a long term solution as IPV6 will be mandatory in the near future). If are loading your website is on shared hosting you will need to ask you host to do this for you, if they won’t, you may want to consider switching hosts.
CONCLUSION
The server could not perform IPV6 DNS look ups. Yet it still tried IPV6 first before it used the fallback IPV4 alternative DNS. This resulted in the the extra 2-15 second load times for logged in users. Until IPV6 is more widely used, IPV4 is the norm. Server setups are enabling IPV6 and sending traffic through it by default. One day IPV6 will be the norm and that will be fine, but until then we have to put up with 2 IP standards and the consequences of our ever evolving technology.
Lesson here: Watch your log files!
References:
https://wordpress.org/support/topic/jetpack-slows-down-my-wp-admin-very-very-strong/
https://wordpress.org/support/topic/extremely-slow-wp-admin/