Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I hope you can help me. I have a site that I'm moving to a new datacenter. The server is pretty much vanilla, no control panel, and also no optimizations. When I hit a page, the site takes an extremely long time to load, despite it being relatively light weight. I ran top to see what was happening, and the cpu jumps to 75%, and drops back down to about 20% while the rest of the page is loading.

Someone suggested that I ran lsof -p on the offending processes, but I'm not sure what I'm looking at. I ran through my httpd.conf file and commented out a bunch of loaded modules that didn't seem necessary, but that didn't help either. Anyone have any ideas?

Output of the lsof http://pastebin.com/mfa113f

share|improve this question
    
In my /etc/resolv.conf file there are two entries for nameservers, both of the addresses ping ok. –  Mike Nov 18 '09 at 22:11
    
Which process consumes the most CPU during a spike? Is that Apache or maybe MySQL? What is your memory use? (try running free -h) And what is the CPU? Even 20% CPU use looks like too much to me... –  chronos Dec 1 '09 at 17:37

2 Answers 2

For sure it is not a DNS issue. The CPU would be low and the time to load would by consistent with DNS timeout.

In MPOV I think it is a php related issue. The best place to start for performance is to do some profiling of the page with problem. If you are using a CMS, try to test a separate page that is not part of the CMS. Just create a php with:

<?php
phpinfo();
?>

and see how long it takes to load this page. Do you have a database service? Is it located on the same machine? For general performance profiling you can use:

dstat -ta -M topcpu,topio
share|improve this answer
    
+1 for the extremely handy dstat command, thanks! –  Alexander T Jul 23 '10 at 13:41

Do you have the apache log file storing Fully Qualified Domain Names, and if so does your /etc/resolv.conf work as expected?

If FQDN is the problem, turn them off within the config file, and you will find things move a lot faster.

share|improve this answer
    
Right now I don't have a domain name pointing to the server. I want to get everything working properly before I flip the DNS switch, so I'm hitting the IP directly. –  Mike Nov 18 '09 at 17:22
    
Mike, Stephen refers to Apache configuration variable, which - when set to true - will resolve client IPs to domain names, if any. However, by default this behavior is turned off. –  chronos Dec 1 '09 at 17:35

Your Answer

 
discard

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