Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WP Admin extremely slow

Tags:

wordpress

The WP back end of a site I'm working on (It's a multisite) takes about 25 seconds to load.

Everything was working fine until yesterday and the front end still works perfectly well. All other sites on the same server run just as well, so it MUST be a WP back end issue.

I don't remember exactly what change it was that made it so slow. I remember updating WP recently (to version 3.4.2), adding some plugins on one of the sites and changing the max upload file size.

I tried to disable all the plugins, changing the themes back to default, changing the max file size back, and adding define('WP_MEMORY_LIMIT', '1024M'); (and other values) to WP-config but none of it helped.

Also tried to 'Update network', but I got an error - couldn't connect to host.

Any ideas?

like image 838
Mariano Grandioso Avatar asked Dec 05 '22 14:12

Mariano Grandioso


1 Answers

I got in touch with our network admin and we resolved the issue.

I will copy his answer here. Hope it helps someone.

Does Wordpress use 'self-referential URLs' ? What I mean by this is... is wordpress trying to access it's own templates/css using fully qualified domain names in the URL (e.g. http://example.co.uk/someurl )

Because we use Network Address Translation (NAT) on our firewalls to hide the real IP address of the server, it has the side effect that if the server tries to access it's own URLs, it will try to send the traffic to the external interface on our firewall, which is where the DNS resolves to.

The fix for this is very simple - we just add the site url into the /etc/hosts file so that the server knows to use it's own IP address instead of the address on the firewall.

So he added our address to the hosts file and now it works perfectly. Awesome.

like image 81
Mariano Grandioso Avatar answered Dec 28 '22 10:12

Mariano Grandioso