Quick news

Speeding up Drupal on Vista with Wampserver

The problem : Drupal awfully slow on Vista 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.

The solution

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 :-)

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.

More detail

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.

So will this work with XP?

Thanks for the above. The speed of my local wamp server for Drupal 6.x is depressing. Wonder if this sort of trick can be done for Windows xp?

Not applicable to XP

The XP hosts file does not contain any IPv6 information by default, so that tip cannot really apply.

Thanks!!!I changed"::1

Thanks!!!

I changed
"::1             localhost"
to
"#::1             localhost"

in C:\Windows\System32\drivers\etc\hosts

and it worked like a charm for me in Vista!!!

hello,there is no line ::1

hello,

there is no line ::1 localhost on my host file. furthermore, even if I start notepad with the admin rights, I still can't save the files.

Could you help me, please?

Regards,
Xavier

Is it really Vista ?

I'm afraid I don't have a clue: unless you (or some other person or software) tampered with your OS install, that line should be there. Also, starting an editor with admin rights (which doesn't just mean start it from an admin account) should allow you to save the hosts file (not host, is it a typo ?) back.

Maybe you have some so-called "security" software installed, which prevents you from administering your system ?