Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have just installed wordpress (last version) on /var/www/wordpress on a default ubuntu server 12.04 LAMP installation.

Every time I want to load something on this wordpress (even the login screen) the browser says "waiting for 127.0.0.1" or "waiting for localhost" for at least 10 seconds! (Then the page loads very fast)

I have been looking for an answer online for almost 3 hours, also tried to reinstall twice, eliminated IPV6 entries from hosts.conf, changed database host on wp-config.php from localhost to 127.0.0.1 and checked apache2 default configuration, enabling modrewrite and reviewing configuration files for default and default-ssl sites.

I'm about to give up... Why does it go so slow? I have also a drupal install on /var/www/drupal and it doesn't have this delay!

(Note the ubuntu install is in an Oracle Virtual Box with 1 core and 1GB of RAM assigned, and the delay is the same if I load the page from the host browser using the virtual interface ip)

[EDIT] After asigning 4 cores to the virtual machine instead of just one, the delay goes down to only 1 second. The CPU isn't busy at all during this time, though, which makes it even more mysterious...

share|improve this question
add comment

1 Answer

From experience I'd say there are several limiting factors in the described setup. For one, if you are using MySQL and Apache2, don't expect to get away with one GiB of RAM and no slowness. I'd strongly recommend you look into nginx or lighttpd as alternatives if your setup has such resource limits.

Further more you haven't told us anything about the setup such as IPv4 and IPv6 or possible firewall rules.

Last but not least on heavy web applications such as WordPress I would recommend to have some kind of cache (be it nginx or varnish) if you are looking for speed.

But honestly your setup sounds like it's trying one connection method, e.g. IPv4 and times out on that and then tries the other. My guess is that IPv6 is still enabled and you haven't configured it properly. In this case you may want to tell the kernel to turn it off or use one of the other methods outlined here.

Please post the output of the following commands (as superuser) if you expect a more detailed answer:

free -m
iptables-save
lsof -Pi|grep :80
share|improve this answer
    
Like I mention in the question's post, drupal has no problems on this machine using the very same http and sql servers, so I don't think this problem is related to a firewall or ipv6 setup, though I agree with you this setup has very low capacity and does not easily scale. Anyway, since the server is not been intensively used (yet), I've never reached more than 60% RAM load (Usually I'm at about 30%), and the CPU seems to be doing fine when it's just me connected (it doesn't peak more that 10-20 percent when requesting the main page, but surprisingly the delay was much reduced with 4 cores) –  elcodedocle Feb 14 '13 at 11:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.