LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Diagnose a slow Cent0S test server. (https://www.linuxquestions.org/questions/linux-server-73/diagnose-a-slow-cent0s-test-server-940871/)

drigby 04-20-2012 12:08 PM

Diagnose a slow Cent0S test server.
 
I'm running a CentOS 5.8 webserver in VirtualBox on my laptop.

It seems like it's getting slower as time goes on. loading a webpage takes 10-20 seconds.

My first thought was that my dual core laptop is to slow to run the webserver, the client browser, and all my other apps (typically: Windows Live Mail, Aptana, firefox, Virtualbox, Notepad++, Excel) at the same time. However, the apps on the host OS "usually" run fine. It's just the browser response that is slow (and just to the test server, other sites work fine).

I know that there are a lot of variables to juggle here, so I was wondering if someone could give me some advice as to how to diagnose my test server.

Thanks in advance!

P.S. The production server runs fine. I have tried closing everything on the host OS besides firefox and VirtualBox. No speed gained.

joker20 04-21-2012 05:20 AM

DNS issues maybe? do a 'dig' on a host and see what the response time is...

drigby 04-21-2012 11:43 AM

I the test servers ip address in my hosts file. So there shouldn't be DNS requests.

btmiller 04-21-2012 11:55 AM

First steps: check "top" and "free" on the VM to see if something is eating the CPU and memory. You might also try running vmstat and iostat to check if you're swapping or disk thrashing within the VM. If you are, the next step is to track down what's causing it.

Are the pages being loaded simple static HTML?

drigby 04-23-2012 08:57 AM

Quote:

Are the pages being loaded simple static HTML?
No the sites are all on the Drupal CMS.

drigby 04-23-2012 09:28 AM

Quote:

Originally Posted by btmiller (Post 4659309)
First steps: check "top" and "free" on the VM to see if something is eating the CPU and memory. You might also try running vmstat and iostat to check if you're swapping or disk thrashing within the VM. If you are, the next step is to track down what's causing it.

When I ran top the only things really using memory were the httpd processes. They were usually between 8% and 12% cpu and under 8% memory. but the cpu usage could briefly jump up as hi as 40% for one process. At one point while loading a page, and some ajax at the same time I had two processes running at almost 30% at the same time.

here is the output for "free", while loading a httpd request:
Code:

            total      used      free    shared    buffers    cached
Mem:        514884    508904      5980          0      1936      30656
-/+ buffers/cache:    476312      38572
Swap:      1048568    699928    348640

"vmstat" while serving httpd request:
Code:

procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b  swpd  free  buff  cache  si  so    bi    bo  in  cs us sy id wa st
 0  3 720364  5428  1864  27636  509  362  570  381 1037  121  3  7 63 27  0

Does this look like perhaps not enough memory being allocated to the virtual machine?


All times are GMT -5. The time now is 05:49 AM.