The problem : Drupal awfully slow on Vista (and Seven) with Wampserver
For some time now, I'd been severiously annoyed by the (utter lack of) performance of Drupal 6 and 7 on my home PC, which happens to be running Microsoft Vista: considering I was used to getting page times around 200ms on a fractional Celeron with Apache 2.2 on a Linux server hosted comparatively far across the net from that same machine, I felt the 5 to 15 seconds response time per page on this local machine with a quad core and 3 GB RAM were really making me lose my time.
After some time spend googling around, I stumbled upon an incredibly simple tip, which made the 5 to 15 seconds per page drop down to around 1 second when logged in, and well below 500 ms when not logged in. It's incredible what ONE single character in a plain text file gets you under Vista :-)
UPDATE 2010-01-23: David Hogg tells us (see below) that this works for Windows Seven too
So, without further ado, here is this little gem : add a sharp character ('
#') as the first character of the line containing:
::1 localhost in your
c:\Windows\System32\drivers\etc\hosts and save it. If your machine is anything like mine, your Drupal response times should all of a sudden be divided by a factor between 5 and 10.
What this smallish change does is remove IPv6 localhost resolution from the hosts file. It is likely to cause other problematic situations if you do any IPv6 work, of course, and then you'll probably want to dig deeper into your network and/or Apache config.
Can't write to the
hosts file ?
The mandatory access control feature of Windows Vista prevents normal programs from touching this file, even when you are logged in to an administrator account with all privileges. This means that your favorite text editor will load the file read-only and be unable to save your changes. To prevent this from happening, you must start the editor as Administrator. Unless you disabled it, the UAC window will ask you for confirmation, which you will have to give to your editor instance. After that, you will be able to edit the hosts file normally.