WAMP is Running Very Slow

How to make your WAMP run lightning fast again.

These steps to speed up your Apache, PHP, and MySQL web-server platform on Windows will work for any WAMP, including WAMP Server and XAMPP. But some of the directory and file paths used here are specific to WampDeveloper Pro (just substitute in the paths of your environment).


Windows Hosts file

Edit the Windows Hosts file and remove the localhost to IPv6 loopback (::1) resolve/mapping.

Edit file –

Comment out the line by adding a ‘#’ in front:
# ::1 localhost

If “localhost” gets resolved to IP address “::1″, the request (when not able to find an IPv6 listening socket) will get routed back to IP address (via timeout, fall-back, or some other mechanism), causing unnecessary delays for connections (e.g., typically anywhere from 1 second to 30 seconds).

Make sure that “localhost” is correctly mapped to the IPv4 loopback address “” (…that this line is not commented out): localhost

* The Windows Hosts file is usually set read-only, and requires Administrative permissions to edit. Some applications (SpyBot, ZoneAlarm, etc) can maintain an edit lock on this file, and Microsoft Defender (or Security Essentials) sometimes detects changes to this file that it thinks are malicious, and changes this file back to its original state. See how to unlock the Windows Hosts file.


Either unbind IPv6 from your network adapter (NIC card), or completely disable IPv6 on your system.

Problems with Windows and IPv6 have been known to add an additional half a second on the initial load-time of each request.


* Since IPv6 can be important to Windows, if this change does not resolve any issues (i.e., does not help to speed up WAMP), you should undo it.

Firewall and Anti-Virus software

Some Firewall and Anti-Virus software are known to significantly slow down Apache and MySQL, such as McAfee, Bit Defender, Avast, Norton, NOD32, Zone Alarm.

Try disabling those applications to see if it makes a difference (including the native Windows Firewall, Windows Defender, and Security Essentials).

If it does, open their settings, and add the httpd.exe and mysqld.exe paths to the list of excluded programs that should not be interfered with.


You might also want to exclude the PHP CLI and CGI binaries, and PHP’s DLL files…


* You’ll need to do this for each version of Apache and MySQL that you use.

Then exclude all the write-to paths (database files, log files, temp files, etc) used by Apache, MySQL, PHP, and any other tools and applications (including PHP scripts and frameworks such as CodeIgnitor)…

Exclude the MySQL Database directory from any checks.


Exclude WAMP’s Logs directory from any checks.


Exclude WAMP’s Temporary directory from any checks.


Power Plan

Change Windows Power Plan (also called Power Options, in Control Panel) from the default of “Balanced” (or “Power Saver”) to “High Performance”. “Balanced” restricts CPU Scaling. This can increase performance 50%.

Local Issues


Reset Winsock and TCP/IP back to their original state. Then reboot.

netsh winsock reset
netsh int ip reset C:\resetlog.txt

* Run from an admin level command-line; right-click cmd.exe, select ‘Run as admin’.

Other software can attach filters to Winsock, and change the TCP/IP parameters, which causes Apache to stop responding to requests (with the problem manifesting as a slow page load, half page load, etc).


Make sure your system is not using old, invalid, non-working, and slow DNS Servers.
ipconfig /all

Wireless LAN adapter Wireless Network Connection:
   DHCP Server . . . . . . . . . . . :
   DNS Servers . . . . . . . . . . . :

The above should list the DNS Servers assigned to you by your ISP (via DHCP), or display a list of public DNS Servers that are set via your Router or OS settings.

Flush Windows DNS Cache:
ipconfig /flushdns

Your Browser

Slow response times for Chrome, Firefox, and IE can be indicative of –

A. Bad Proxy settings that are timing out:

Bypass proxy server for local addresses by creating Exceptions for your domain-names, and IP address

B. Different plugins, and also phishing and malware protection settings:

Check your Browser’s active plugins, try disabling them. Check protection settings, exclude your domain-names.

C. Stale cache results:

Clear your Browser’s Cache. Also run Windows Disk Cleanup.

Clear Your WAMP Log Files

Apache maintains website access and error logs that can grow in size very quickly. PHP also has similar logs (if enabled via configuration).


Once Apache log files grow in size to above several 100 MB, performance issues can arise.

Also the Temp folder holds lots of session and temporary data files that don’t get properly cleaned up, which causes it’s own issues.

You can clear out the Log and Temp files like this –

Make sure Apache and MySQL are not running.

Open the command-line (run: cmd.exe).

Delete all the websites log files –
del /S C:\WampDeveloper\Logs\*log.txt

Delete all the temporary files –
del /S C:\WampDeveloper\Temp\*

Since this is a pure wildcard file-name delete (*), it will ask you if you want to delete all the files each time it finds a new sub-directory… As it prompts you, press the ‘y’ or ‘Y’ key, then press the ‘Enter’ key; or add in the /Q switch (del /S /Q …) to tell it not to prompt you at all.

The above will delete all the log files and all the temp files, within all the sub-directories. Make sure you do this carefully (that you are using the right paths)!

If you do this manually, make sure to never delete the directories and sub-directories, just the files in them.



Turn log buffering On. This will cause Apache to buffer logs for multiple requests instead of writing them out individually to the log file – and improve disk I/O on a heavily accessed web server.
BufferedLogs On

* This should only be performed on a server that is nearing it’s I/O disk resource limits, as it does not offer much of an improvement anywhere else, and can make real-time debugging difficult.


Set the maximum number of free memory that every Apache thread is allowed to hold without attempting to give it back to the OS. Setting this value to 2048 KB (2MB) might prevent the Apache process from growing too large, as this will typically restrict its process max size to threads * MaxMemFree.
MaxMemFree 2048


Decrease the default amount of Apache Worker threads that the Apache process creates on start-up to handle concurrent requests. Each Worker thread takes up system resources. The default number of 64-150 Worker threads under most WAMPs is too high.
ThreadsPerChild 48
ThreadLimit 48

EnableMMAP and EnableSendfile

Make sure EnableMMAP and EnableSendfile are not turned Off (they are On by default) as they use the OS’s abilities to speed up file access and delivery.
EnableMMAP On
EnableSendfile On


Make sure Win32DisableAcceptEx is not present in the configuration as it disables a faster way of accepting network connections on Windows (instead of AcceptEx() it uses accept()).

Under Apache 2.4, directive Win32DisableAcceptEx has been replaced with the following configuration using the AcceptFilter directive:
AcceptFilter http none
AcceptFilter https none

* A warning for when using WAMP Apache 2.4 and IE9+… For some reason IE9+ requests (IE9 was the lowest version tested, it could also be an issue with IE8) will break under Apache 2.4 (but not under Apache 2.2). In my case, the first request from IE will usually not start nor complete, though subsequent requests will (but only when performed within a 3 second window after the first request). The only solution to this is to use the above ‘AcceptFilter … none’ configuration. Setting ‘KeepAlive On/Off’ makes no difference. The Apache error log shows this line: (OS 64)The specified network name is no longer available. : AH00341: winnt_accept: Asynchronous AcceptEx failed.


HostnameLookups should always be Off, as otherwise every request’s IP address will need to get resolved to a host or domain-name.
HostnameLookups Off

MySQL over localhost

Always use IP address ‘’ instead of ‘localhost’, host-name, or a domain-name to make a connection to MySQL. Not doing so can cause delay issues due to Host file problems, improper DNS, routing between IPv4 and IPv6, domain resolves, and time-outs.

In 99.9% of all set ups, MySQL runs on the same system the PHP scripts are connecting from, and is bound to (listening-on)… All PHP scripts should be making the connection to MySQL directly via IP

Make sure your scripts’ (and webapps’) configuration files do so, and that the MySQL account they use has its Host: field set to so that connection is allowed.

Example Wordpess configuration –

/** MySQL hostname */
define('DB_HOST', '');

Example phpMyAdmin configuration –

/* Server parameters */
$cfg['Servers'][$i]['host'] = '';

If a PHP script attempted to connect to MySQL via a host-name or a domain-name, that request would need to get resolved via DNS to an IP address, and that IP address would need to get routed back to a listening socket on the local system.

Also, if MySQL (and phpMyAdmin) will never be accessed from outside, you can disable MySQL’s DNS resolves and Host cache…

Edit my.ini, section [mysqld]:


*With this change, you’ll need to make sure all MySQL accounts are set to Host:

MyISAM over InnoDB

If your database access pattern is mostly read-only (less than 15% writes – typical for most webapps like WordPress), try using MyISAM tables. But if it’s write heavy, consider
using InnoDB tables.

Database Buffer Size

Edit my.ini:

Try updating the buffer sizes to 1/4 or 1/2 of your RAM –

For MyISAM tables (caches indexes only, not the data)
key_buffer_size = 256M

For InnoDB tables (caches both indexes and data)

innodb_buffer_pool_size = 512M
innodb_log_file_size = 128M

innodb_log_file_size should be 1/4 of the innodb_buffer_pool_size value.

Changing the value of innodb_log_file_size will either cause MySQL to fail to start, or for the InnoDB Engine to not load. You’ll need to delete (or move out just in case) file(s) C:\WampDeveloper\Database\ib_logfile0 and ib_logfile1 (if it exists). This is a bit unclean, but if everything was flushed and shut down properly, should not be problematic.

The other settings I would not mess with. They hardly ever give anything more than marginal returns, or none at all.

Even the above mentioned settings will have diminishing results with increased values on the average system.

You’re mostly looking to update the existing settings (and not introduce new ones) to set the buffer-sizes of InnoDB and MyISAM to hold all indexes and data in memory as a percentage of your available RAM, and the log sizes as a percentage of the buffer sizes, and leaving everything else alone. As other settings are marginal, introduce complexity, are way too specific (and override good default and autos), or are just not good for the health of the Database.


The only other MySQL setting that can produce good performance gains – changes the way the above buffer is written out to the above log file, and how the whole thing is flushed to disk.
innodb_flush_log_at_trx_commit = 2


The default value of 1 is required for full ACID compliance. With this value, the log buffer is written out to the log file at each transaction commit and the flush to disk operation is performed on the log file.

With a value of 0, any mysqld process crash can erase the last second of transactions. The log buffer is written out to the log file once per second and the flush to disk operation is performed on the log file, but nothing is done at a transaction commit.

With a value of 2, only an operating system crash or a power outage can erase the last second of transactions. The log buffer is written out to the file at each commit, but the flush to disk operation is not performed on it. However, the flushing on the log file takes place once per second also when the value is 2. Note that the once-per-second flushing is not 100% guaranteed to happen every second, due to process scheduling issues.



Make sure php.ini has date.timezone set to a value. Otherwise PHP will attempt to figure out which data-time zone to use on every call to a date related function.

Surprisingly, an unset date.timezone value has drastic performance implications.


Update php.ini’s realpath_cache_size to a much larger value from the default 16K.
realpath_cache_size = 1M

For this to work, open_basedir cannot be set, and safe_mode cannot be On. See – https://bugs.php.net/bug.php?id=52312


Updated the webapp’s MySQL user account (via /phpmyadmin) to change the “Host:” field from “localhost” to “”.

Then update the webapp’s config file to reflect the change.

For example, edit Magento’s configuration file –

Update line –


To –



Typical –
Reset the internal rewrite-rules in wp-options table by clearing the value via /phpmyadmin.

Ultimate –
Refresh the entire WordPress database by Exporting it into an XML file via the Import/Export plugin. Then re-install WordPress (delete the WP database and access the WP website), and re-import the XML file via that same plugin.


Clear (truncate) the session table and watchdog table via /phpmyadmin.

Clear the Cache under: Drupal > Configuration > Development > Performance.


If your application utilizes memcached, and memcached is not installed, this can cause a very large delay in the loading of the first request due to the initial connection timeout.

24 thoughts on “WAMP is Running Very Slow”

  1. Another option to try is to open the Windows Task Manager (press Ctrl+Shift+Esc), go into the Processes Tab, select each of the Apache Processes (there are two on Windows), and –

    Set Priority from “Normal” to “Above Normal” or possibly “High”.

    Just be careful with the “Realtime” level.

    You’ll need to do this on each Apache startup.

    You can do this from the command-line also; and put it into a Desktop .bat file that can be ran: http://support.microsoft.com/kb/191771

    You can also set CPU Affinity to bind the Apache and MySQL processes to specific CPU cores if you want to dedicate only some percentage of your CPU resources to them… To limit process/thread context switching between cores.

  2. If you’re using older PHP scripts, or scripts that generate (in logs) lots of the same warning/error messages, only log the first occurrance of the file + line message –

    ignore_repeated_errors = On

    Some older scripts can generate 10s and 100s of the same message per request, which if written to disk per line, would consume disk I/O resources.

  3. If your hosted files are limited in transfer speeds, check your Router’s Traffic Manager – QoS settings. If this feature is on, it often limits transfers to 512KB.

  4. 1. Having XDEBUG loaded in PHP can slow down Apache by 2x-3x. Comment out its loading in php.ini.

    2. Having many errors and warning generated, displayed, and/or logged by PHP can also slow down Apache by 2x-3x… Check the website’s PHP error log. If you can’t fix the errors/warnings, one workaround to this is to turn off error logging (log_errors=Off) / but this is a very bad idea.

    1. Thanks for the XDEBUG tip! I was trying out WP Beaver Builder Lite plugin for WordPress on localhost and was informed to add an entry about xdebug nesting level. The reason was because Beaver Builder gave an error when trying to add more than one column.

      Found my localhost server had slowed down heaps and by commenting back out the line that said #xdebug.max_nesting_level = 200 I was able to return to seconds not minutes of loading. Any idea on workarounds? I already removed beaver builder for now.

  5. Someone on another site reported that commenting out the loading of the CGI module in httpd.conf fixed his particular slow issue –
    #LoadModule cgi_module modules/mod_cgi.so

    I have no idea why that would work in that particular case, but if you try it, also make sure to comment out –
    Include C:/WampDeveloper/Config/Apache/extra/wampd-cgi.conf

    This will break the execution of perl scripts in \cgi-bin

  6. When not using IPv6, also make sure to re-bind Apache from listening on both IPv4 + IPv6 to just IPv4…


    Listen 80
    Listen 443
  7. If you are setting your own output buffering size in php.ini (directive output_buffering), or setting it in a VirutalHost or .htaccess file, or setting it in your script’s code, and are using either a very large buffer size (above the default 4K in php.ini), or a full buffer (i.e., all output is buffered until the script completes), this can prevent the website from loading for several seconds.

    With a default 4KB buffer, after 4KB of output is generated, Apache sends it to the visitor, and the page can begin to load at least partially.

  8. nice article. However I have error when I try to set host in magento local.xml to instead of localhost. I got error:

    a:4:{i:0;s:84:"SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Unknown host. ";i:1;s:2613:"#0 C:\wamp2\www\.......Zend\Db\Adapter\Pdo\Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()

    In etc/hosts I have localhost www.localhost.com

    and I use www.localhost.com in base url.

  9. Thank you so much guys my site is running smoothly. I didn’t follow all the steps but it works. thank so much :-)

  10. realpath_cache_size = 1M
    This one is really cool when using frameworks.. Speeded up pages up to 3-4x (200ms -> 50ms) on my win PC. Thx:)

  11. XAMPP was running slow, fixed this by following your instruction to ensure loopback was not commented out. thanks!!

    Edit file –

    Comment out the line by adding a ‘#’ in front:
    # ::1 localhost
    (…that this line is not commented out): localhost

  12. Thank you for your article! Really useful. Thanks to you, I’ve changed the “localhost” to “” and now the server is working as it should be working properly!

  13. I just wanted to say Thank you. Awesome Information here. I’m running a site that handles many DB queries and the changes that I have made has increased my speed by twice. One page handled over 2100 articles that would take around 20 seconds to load when checked, now under 9 seconds.

  14. Hi everyone, Where is the location to edit the Apache config? I am trying to find where I can change, BufferedLogs, MaxMemFree, ThreadsPerChild … but I cant find it, any help please :) Thanks in advanced

    1. To set (or override) WampDeveloper’s default configuration-directives values (that are spread out in many httpd-*.conf and many compartmentalized / modular wampd-*.conf files)… Do not modify the above mentioned configuration files, instead utilize this file –


      This file is intentionally loaded last by Apache (via configuration of httpd.conf), overriding previously defined/set configuration values, making it absolutely ideal to keep all your changes in one general place and file (that you can check when troubleshooting to recall all the changes made, or when you want to export config changes to another WampDeveloper instance).

      Note that Apache usually always uses the value set last / and almost never only the first instance. About 95% of directives (in various situations/cases) can be re-valued. Check Apache Docs for which directives cannot be overridden. Check /server-info to see what Apache is using for values from the last parsee of its configuration.


      Apache’s standard configuration files are all named “httpd-*.conf”.
      Directives: ThreadsPerChild, MaxMemFree
      File: \WampDeveloper\Config\Apache\extra\httpd-mpm.conf:

      All httpd-*.conf files are Apache’s files (some with default values and some modified slightly for various reasons).


      WampDeveloper’s provided configuration files are all named wampd-*.conf.
      Directive: BufferedLogs
      File: \WampDeveloper\Config\Apache\extra\wampd-default.conf

      This httpd-*.conf and wampd-*.conf differentiation creates separation-of-function between WampDeveloper and its Components, adds modularity (for WampDeveloper’s expanded functionality), improves on the base-configuration, and fixes various problems that ship with Apache.

      These wampd-*.conf files are designed to enable complex-to-do-things by simply uncommenting a single wampd-*.conf file(s) in httpd.conf. These extra files also contain some important information for you (everything you should be aware of): available options, limitations, workarounds and alternatives, resulting trade-offs, issues that could happen, feasibility for your use-case/business/enterprise, etc).

      WampDeveloper’s wampd-*.conf files

      For an example, try to get a non-WampDeveloper server using the CloudFlare network/proxy properly and securely…

      When I set up the initial solution with mod_cloudflare, it was all outdated info, the module seamed half-abandoned, odd reports of odd errors, could not handle certain use-cases, had severe limitation in other use-cases, and the various examples/configurations that might have looked good on first-sight (without the proper experience and domain knowledge) did not work, taking additional days of research/analysis/validation, more testing and fixing, repeat on any new discovery/issue appearing after the last one went away, and hoping no unknown edge-cases (at least serious enough to allow false validation and the proceeding data-breaching) will not be coming into and our of you network/enterprise and affecting agreements…

      For myself, at the end of this, mod_cloudflare was just flaky at best, producing a “no confidence” vote.

      But then the problem was immediately solved when I realized another module could be used…

      WampDeveloper’s “mod_cloudflare” configuration uses “mod_remoteip” under-the-hood, bypassing every point listed in my rant. And it does so in a very clever way:

      1. Using a native, and always-up-to-date, mod_cloudflare-like “general purpose” module (full replacement) – that is shipped with Apache (no 3rd party modules). Its not tied to any format nor provider. You can use it with CloudFlare network’s, or if you have the need and the resources – replace the connection IP ranges in the file to connect to one of CloudFlare competitor’s, or build your own self-run CloudFlare-like cloud-service/replacement.

      2. WampDeveloper’s configuration uses all valid/in-good-standing CloudFlare IPs – including the newer ones (both ipv4 and ipv6) – not just what was displayed on a possibly out-of-date webpage nor what was hard-coded into some module/binary release.

      On an off note, unless I’m getting this mixed up for/from something else, the year or 2 ago when I did the research and looked into mod_cloudflare module’s docs (or maybe source-code), it seemed to have some really strange non-CloudFlare addresses. But hold on. Let me make myself clear. I don’t want anyone to take my word for this – as likely this was at best my imagination and at worst a figment of my paranoia – CloudFlare is awesome (I have nothing against them). But if memory recalls, now that I’m actually writing about the history, I was very surprised that those IPs connected to locations that are known for government snooping, and there was also a mismatch between the hard-coded IP in the module’s source code and what was listed on their website. Maybe it was just the older no-longer-in-use IPs that where abandoned by CloudFlare, and by chance immediately assigned to’s CIA’s Langley, and someone forgotten to take those IPs out of the codebase (“forgot” cough cough).

      3. Includes very effective, non-complicated, security features – that make sure you really are talking to CloudFlare, and not someone pretending to be them.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>