I recently escaped from Apple based computers to go back to normal laptops. I purchased a very powerful Lenovo ThinkPad W530. It is a war machine. I am so happy and satisfied with it that I will even keep Windows 8 Professional for a while. I will then switch back to my beloved GNU/Linux as well.
Meanwhile, I still have to accomplish many development task, some of which are classic web development (read: PHP, MySQL, and Apache).
Unfortunately, I encountered a widely reported issue. Apache PHP, MySQL are slow under Windows.. Terribly slow. Sometimes, even slower than deployed websites on the Internet. I had to wait from 3 to 10 seconds just to load a local WordPress website.
In this short post, I summarize all the proposed fixes and report which one really solved my problem.
The following are only a small part of the proposed fixes to solve WAMP slowness under Windows 7 and Windows 8:
- Exclude Apache, PHP, and MySQL from your Firewall checks.
- Add Apache, PHP, and MySQL executables, and the Website Folders as exceptions of your Antivirus.
- Make sure you are loading PHP as an Apache module rather than using CGI methods.
- Tune php.ini.
- Disable xdebug extension.
- Disable IPv6.
- Make sure that Apache only listen to IPv4 as well.
- Setup a proper hosts file: disable IPv6 localhost, enable the IPv4 localhost counterpart, and make sure to do the same for all your VirtualHosts, if any.
- Employ Voodoo-like tunnelling systems.
I did all of them without any reasonable improvement. Sure, they might all help after applying the only fix which worked for me.
Do you want to know what really fixed the issue for me? Promise you will not laugh.
I mostly worked on GNU/Linux in the last 10 years. Somehow, I employed OS X as well. Unfortunately, I am not a Windows power user. I don’t seriously use Windows since XP.
Today, I discovered that there is a serious difference between the “Balanced” and the “High Performance” power plans of Windows.
This difference is still strong when not using the battery (that is, power cable plugged). While GNU/Linux and OS X somehow unleash the beasts living in our laptops when the power cable is plugged, Windows on my Lenovo did not. It still was limiting CPU scaling capabilities and keeping it as much low as possible.
Either switching to “High Performance” power plan or customizing the “Balanced” plan settings solved the issue for me. In particular, I think that bringing the “Minimum Processor State” option from 5% to 80% does the trick. You can bring it to 100% if it doesn’t make your laptop lift-off.
Additionally, I (finally!) stopped complaining how Windows 8 was still slow when opening Google Chrome, IntelliJ Idea, or the File Explorer itself despite using a SSD drive. Comparing to GNU/Linux, the difference was huge. Now it is no more.
I feel a little dumb. However, we never stop learning and I am happy to share this experience.