ESX 5.1: Apache is slow after P2V

Hi All,

I virtualised one of our Windows 2003 server last week and the OS and applications are really sluggish. e.g the start button isnt instant, there a fraction of a second delay.

This would normally be ok, however it's running Apache Tomcat.  The first apache.exe respons really quickly, but the second is really slow (2 seconds) at least double if not tripple it was before the P2V

Any suggestions on what I can check?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

Andrew Hancock (VMware vExpert / EE MVE^2)Connect With a Mentor VMware and Virtualization ConsultantCommented:
if you follow my EE Article, and look at the Articles Linked...

but roughly this...

1. installing VMware Tools (reboot).
2. adding VMXNET3 interface
3. remove E1000 interface.
4. Adding IP Information, DNS, WINs, etc
5. Remove all Hidden Drivers and Devices - Device Management
6. Remove all physical related software if not already done
7. Reboot
8. Set Services to checks before go live...and reboot VM
9. Finally your Done.
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Have you completed ALL post P2V checks, e.g. remove physical server software, removed all device drivers and software which is hidden?

how many vCPUs are now assigned to this VM, 2 or 4?

What is the memory?

see my EE Article

HOW TO:  P2V, V2V for FREE - VMware vCenter Converter Standalone 5.5

Check Task Manager, is CPU at 100%, any rouge processes e.g. WMI?
detox1978Author Commented:
>> Have you completed ALL post P2V checks, e.g. remove physical server software, removed all device drivers and software which is hidden?

I think so, but will double check

>> how many vCPUs are now assigned to this VM, 2 or 4?

>>What is the memory?
4GB, with the PAE boot.ini switch
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

detox1978Author Commented:
I reduced the CPU count to 2, but that's not helped.

It looks like parent Apache.exe is running ok, but the sub apatch.exe is really slow (3 seconds), once it responds the page loads really fast.

Any ideas?
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
what are the overall CPU resources running like?
detox1978Author Commented:
It was running at 33% with 4 CPU's so I reduced it to 2 CPU's
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Any processes running high?
detox1978Author Commented:
CPU load hasnt been too bad

Last 24 Hours
Last 7 days
detox1978Author Commented:
I dont know too much about Apache.exe, but there's two of them.  It looks like the first redirects to the second.  Thge first loads instantly, however the second seem to hang for 3 seconds, then loads instantly.

The website that's running on Apache connects to MySQL (also on the same VM.

The VM is running on local disk and read/write speeds seem ok.
detox1978Author Commented:
I found this post on another forum

After much research, I may have found the solution. If I'm correct, it was an apache config problem. Specifically, the "ThreadsPerChild" directive. See...

Because Apache for Windows is multithreaded, it does not use a separate process for each request, as Apache can on Unix. Instead there are usually only two Apache processes running: a parent process, and a child which handles the requests. Within the child process each request is handled by a separate thread.

ThreadsPerChild: This directive is new. It tells the server how many threads it should use. This is the maximum number of connections the server can handle at once, so be sure to set this number high enough for your site if you get a lot of hits. The recommended default is ThreadsPerChild 150, but this must be adjusted to reflect the greatest anticipated number of simultaneous connections to accept.

Turns out, this directive was not set at all in my config and thus defaulted to 64. I confirmed this by viewing the number of threads for the second httpd.exe process in task manager. When the server was hitting more than 64 connections, the excess requests were simply having to wait for a thread to open up. I added ThreadsPerChild 150 in my httpd.conf.

Additionally, I enabled the apache status module

...which, among other things, allows one[b] to see the total number of active request[/b] on the server at any given moment. Right away, I could see spikes of up to 80 active request. Time will tell, but I'm confident that this will resolve my issue. So far, 30 hours without a hiccup.

Open in new window

The ThreadsPerChild was set to 250, so i've reduced it to 150.

I dont know how to  see the total number of active request.  I uncommented the status module and restarted the server.

Any ideas?
detox1978Author Commented:
I've managed to get the server status page working.

I might be reading this wrong, but the status page suggests the web server is responding in half a second.

Current Time: Thursday, 28-Nov-2013 03:18:13 GMT Standard Time
Restart Time: Thursday, 28-Nov-2013 03:15:36 GMT Standard Time
Parent Server Generation: 0
Server uptime: 2 minutes 37 seconds
Total accesses: 70 - Total Traffic: 76 kB
.446 requests/sec - 495 B/second - 1111 B/request
4 requests currently being processed, 146 idle workers

Open in new window

Have I read this correct?

If so, what could be causing the delay?
detox1978Author Commented:
Is there a list of all the post P2V tasks I need to complete?

This server is around 7 years old, so there's a good chance it's good chance it's full of legacy drivers etc...
All Courses

From novice to tech pro — start learning today.