Terish Das
Terish Das

Reputation: 301

WAMP is running very slow

I am using WAMP (localhost) on Windows 7.

When I am running my localhost it takes more than 1 minute to load the page. There are no queries or database connectivity. If it's just an HTML page, it also takes the same time, and if the Internet is connected it works normally. If Internet is connected it works perfectly. When the Internet is not available it takes more than 1 minutes to load a simple page.

How can I fix this?

Upvotes: 30

Views: 73804

Answers (22)

Booni
Booni

Reputation: 81

Instead of using the hostname “localhost”, use an IP address in your MySQL connection string.

Typically, your WAMP installation is found in C:\wamp. Edit this file with Notepad:

C:\wamp\www\wp-config.php

Replace

define("DB_HOST", "localhost");

with

define("DB_HOST", "127.0.0.1");

Restart the WAMP services.

You can check out more details on this website.

Upvotes: 8

betakilo
betakilo

Reputation: 91

I followed all these and the links with no joy. Gold for my Wamp v7.3.16-2 was setting bind-address=:: in MySQL's my.ini file. Response time went from minimum of 2 seconds to zero.

Thanks to http://regularcoder.com/tutorial/wamp-optimization-for-better-performance/#comment-30

Upvotes: 0

Hamed Azimi
Hamed Azimi

Reputation: 145

Here is a list of changes I made to make WAMP faster in my Windows 10 Pro 64 bit:

  1. Edited hosts file and added: 127.0.0.1 localhost
  2. Edited hosts file and added: 127.0.0.1 myVhosts (note: I added all other entries in the same line as the first one. I don't create multiple lines to point 127.0.0.1 to different places. So I only have one 127.0.0.1 and then next to it, any vhosts or anything else that I want to point to it)
  3. Edited my.ini and added: bind-address="127.0.0.1" (below [wampmysqld64])
  4. Disabled cgi_module from Apache** → Apache Modulescgi_module (uncheck it)
  5. Disabled XDEBUG Extension from php.ini
  6. As I have Anti-Virus and Firewall, added httpd.exe and mysqld.exe files (as well as PHP CLI and CGI binaries, and PHP’s DLL files) to the exceptions.
  7. Turned on EnableMMAP and EnableSendfile in httpd.conf
  8. Set realpath_cache_size to 4096k in php.ini
  9. In the end, edited the configuration file of projects and replaced the localhost with 127.0.0.1 as well.

I also recommend checking this article: WAMP is Running Very Slow. They covered a lot of changes that may help you as well.

Upvotes: 3

Nav
Nav

Reputation: 9

I tried everything, and nothing worked. Then I found out by removing all session references WAMP was 20 times faster. As the sessions were being locked, so when the same application requested multiple pages it was super slow.

Upvotes: 0

AlphaCactus
AlphaCactus

Reputation: 418

Adding to tvanc's answer, also disable the Xdebug profiler in php.ini with xdebug.profiler_enable=Off or xdebug.profiler_enable=0.

You might also increase the PHP memory limit. Search for memory_limit in php.ini.

There are also some useful tips at WAMP is Running Very Slow which are too numerous to list here.

Upvotes: 2

vivek
vivek

Reputation: 1

Run WAMP only. Quit other applications which use the Internet.

Upvotes: -1

Wenjin Chua
Wenjin Chua

Reputation: 1

Add 127.0.0.1 as your DNS in Use the following DNS server addressesPreferred DNS server

Upvotes: -2

Christiane Peschen
Christiane Peschen

Reputation: 61

I ran into the same problem and changed all the options mentioned.

After that, I saw that a Drupal database with extreme weight was causing the problem. Clearing the watchdog table and cache solved the problem.

Upvotes: 0

Nate R.
Nate R.

Reputation: 11

Turning off the cgi_module also worked for me with WAMP + WordPress. I wanted to share that you can also do this with the WYSIWYG in WampServer 2.5.

  • Click on the WAMP Quick Launch Icon in the Taskbar.
  • Hover over ApacheApache Modules
  • Click to remove the check mark from cgi_module

WAMP should restart itself, and you should see the speed pick up.

Upvotes: 1

inky
inky

Reputation: 1462

In my case the slowness was because I was on a corporate VPN and also had a proxy URL set in Chrome. Off the VPN everything loaded fast.

To get things to work on the VPN, I removed the proxy setting from Chrome. Things mostly worked then, but a search for WordPress plugins or themes from the dashboard still failed.

I added the following to wp-config.php and then search worked too:

 /** proxy settings */
 define('WP_PROXY_HOST', 'proxy.url.com');
 define('WP_PROXY_PORT', '1234');
 define('WP_PROXY_USERNAME', '');
 define('WP_PROXY_PASSWORD', '');
 define('WP_PROXY_BYPASS_HOSTS', 'localhost');

Upvotes: 0

Nicolas Janel
Nicolas Janel

Reputation: 3075

Accessing my local content on 127.0.0.1 instead of localhost worked for me (so probably a DNS resolve issue is hidden somewhere):

  • http://127.0.0.1/mysite is fast

  • http://localhost/mysite is slow

Upvotes: 3

tvanc
tvanc

Reputation: 4324

I tried a lot of the answers on here without much success. It was PHP itself where the bottleneck was occurring. I disabled Xdebug and my page-load time went from ~1200 ms to ~275 ms. That was where the biggest single gain occurred, by far.

Upvotes: 18

Alan Johnston
Alan Johnston

Reputation: 304

I ran into this issue specifically in Chrome. Emptying the browser cache completely solved it.

Upvotes: 0

Daven
Daven

Reputation: 21

I'm running Windows 8, and WAMP was very slow. I did all suggested before. With a difference; WAMP had httpd.conf by default:

AcceptFilter http none
AcceptFilter https none

So I did the contrary thinking: Maybe this is not needed any more. It seems to work fine:

 #AcceptFilter http none
 #AcceptFilter https none

Maybe is not a problem in all Windows versions. In httpd you read:

# AcceptFilter: On Windows, none uses accept() rather than AcceptEx() and
# will not recycle sockets between connections. This is useful for network
# adapters with broken driver support, as well as some virtual network
# providers such as vpn drivers, or spam, virus or spyware filters.
#AcceptFilter http none
#AcceptFilter https none

Upvotes: 2

user49778
user49778

Reputation: 1

This may sound really simple, but if you are using Notepad++'s menu RunLaunch in <browser> option (e.g. Launch in Firefox), it loads as file:///C:/wamp/www/dynamic/index.php instead of localhost/dynamic/index.php.

If this is the case then try going to localhost/dynamic/index.php in the URL bar on your own, and it will load much faster.

Upvotes: 0

Ricky Sharma
Ricky Sharma

Reputation: 1919

Uncommenting this line in the hosts file worked for me:

# 'localhost' name resolution is handled within DNS itself.
    127.0.0.1       localhost
#   ::1             localhost

Uncommenting 127.0.01 localhost. And after that it's super fast.

Upvotes: 2

Jonathan Lahijani
Jonathan Lahijani

Reputation: 11

This issue was plaguing me after I upgraded WAMP Server from 2.2 to 2.4.

I eventually found the solution, as detailed in this blog post: Apache server 2.4.6 hangs after serving requests from Internet Explorer 10/11

Add the following to Apache's configuration file (httpd.conf):

AcceptFilter http none
AcceptFilter https none

Upvotes: 0

Fluffy
Fluffy

Reputation: 145

Changing the PHP SMTP server in file php.ini from localhost to 127.0.0.1, on line 1084 in my vanilla copy, did the trick.

Upvotes: 3

Daniel Holst
Daniel Holst

Reputation: 139

I've found that it somehow helps a lot not to reload the page, but rather go to another page, and click the link (if it it exists) to the previous page

I do this, since I have a menu bar, so I just click another link, and then back.

Upvotes: -1

SystemicPlural
SystemicPlural

Reputation: 5789

My problem was of a smaller scale. An empty PHP page went from almost instant rendering to about 1 second.

It turned out that my Xdebug settings were causing the problem. I had xdebug.remote_enable=on set in the php.ini file, and this was causing the delay. Before I was starting, the debug session was using an idekey, so I only got the delay when starting a debug session. Commenting the line out solved the problem.

Upvotes: 1

noname
noname

Reputation: 1318

The solution that worked for me was to disable the cgi_module. Use one of these methods:

(Method 1) Left click on WAMP > Apache > Apache Modules > uncheck "cgi_module"

(Method 2) Edit httpd.conf and disable the loading of the CGI module by commenting this line:

LoadModule cgi_module modules/mod_cgi.so

Commenting would be just adding a # in front, like this:

#LoadModule cgi_module modules/mod_cgi.so

Restart the Apache service and you should be good to go.

Upvotes: 53

Marko Aleksić
Marko Aleksić

Reputation: 1591

Set mysql_connect('127.0.0.1'... instead of mysql_connect('localhost'....

WAMP/XAMPP is responding very slow over localhost

Upvotes: 32

Related Questions