Eric David Blog

The 3 most-effective WAMP server optimizations

My experience has taught me that no optimization tactic will hold a candle to the effectiveness of these three tips.

1. RAM disks are your best friend. Your web root should be on a ram disk. Doing this requires a copy of the web root running on an ordinary hard drive and creating a batch file to automatically copy your data from the hard drive to the RAM drive upon bootup. Only put files that are recoverable in the RAM disk as this is the most volatile place for storage. Never put a database containing user-defined data or a directory of uploaded files on a RAM disk!

2. RAID everything! Your OS install and your server programs should reside on a hardware-based RAID-0 stripe of at least two hard drives. The performance impact of this is phenomenal! The downside to RAID-0 is a greater likelihood of drive failure, so only data that can be easily restored should reside here. As with the RAM disk, never put a database containing user-defined data or a directory of uploaded files on a RAID-0 drive as that data may be unrecoverable if lost.

Data that is unrecoverable if lost should be placed into a RAID-1 mirror or RAID-5 array. Yes, you need at least four hard drives and a RAID controller that has at least as many ports. Have no fear; economically speaking, with a RAID setup you actually come out ahead. What I have discovered is that once you speed up the file IO you gain back CPU cycles that appear to be wasted waiting on the drives. This means that an Intel Core 2 Duo CPU with 4 hard drives will give you far better server performance and reliability than a similarly priced system consisting of a Quad-Core-Extreme CPU running off of a single hard drive.

3. Disable all services and Term-Stay-Resident programs that are not required for Windows to operate. Both TSR programs and services operate constantly, thus leaching power that could otherwise benefit your server. Places to check for TSRs:

Control panel: administrative tools -> services
Start-menu: programs -> startup
C:\autoexec.bat
C:\config.sys
C:\windows\system.ini
C:\windows\win.ini
C:\windows\wininit.ini
Registry: HKCU\Software\Microsoft\Windows\CurrentVersion\Run
Registry: HKLM\Software\Microsoft\Windows\CurrentVersion\Run
Registry: HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
Registry: HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnceEx
Registry: HKLM\Software\Microsoft\Windows\
CurrentVersion\ShellServiceObjectDelayLoad
The Userinit string of registry key: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon

Also, if you have spyware or a virus then it is possible that the application installed itself into a Windows system file, in which case the offending program will always be running and sapping your CPU cycles without explicitly having a defined program startup.

I also find it helpful to disable all the Windows animations and use the classic theme that runs using the native window manager, but that primarily speeds up administration of the box, it has no noticeable impact on server performance.