MikeB Posted November 18, 2014 Share Posted November 18, 2014 I have been seeing slower and slower response times on Processwire and Drupal sites on my local Xampp server for a while now. Just spent a couple of hours searching for some hints/fixes. Thought I would share this here as the answer I found that worked for me was reported on Wampp as well and using Joomla and Wordpress so seems to be across the board. I am running Windows 8.1 64bit. That seems to be where the issue stems, and has to do with a bug in that operating system with how they handle IPV6 first then fallback to IPV4. The way this manifests is frequent calls to the database being repeated, increasing server response times. So the fix is as follows. In phpMyAdmin\config.inc.php change $cfg['Servers'][$i]['host'] = 'localhost'; to $cfg['Servers'][$i]['host'] = '127.0.0.1'; This one I did not actually need as Xampp had that already, but according to the thread I found Mampp did need it. Next uncomment bind-address="127.0.0.1" in mysql\bin\my.ini And finally the real culprit, in Processwire site\config.php change the database configuration from $config->dbHost = 'localhost'; to $config->dbHost = '127.0.0.1'; This same applies for any CMS config file that connects to a MySQL database. (Maybe even any other database too as the issue is with OS) And hey, WOW!! my local dev sites are running way faster now. Hope all that is clear, and useful if anyone else is seeing slow response times locally. Just in case here is my current setup details. Windows Version: Windows 8 Enterprise 64-bitXAMPP Version: 1.8.3 Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 MySQL Community Server (GPL) 5.6.16 libmysql - mysqlnd 5.0.11-dev phpMyAdmin Version information: 4.1.6 4 Link to comment Share on other sites More sharing options...
horst Posted November 19, 2014 Share Posted November 19, 2014 (edited) Sorry, but just to clarify: And finally the real culprit is the person who has added it to the config when the installer has asked for informations how to access the DB. What I want to say is that there are more cases possible than only "localhost". (e.g. another hostname, an IP, different than 127.0.0.1, regardless if you run a mysql server on the same machine or another, etc). But it is really helpful to add information here that changing a named host, e.g. "localhost", to a IPv4, e.g. "127.0.0.1" can help speed up things on systems that are configured to use IPv6 at first. Many thanks, and sorry for kidding. Edited November 19, 2014 by horst Link to comment Share on other sites More sharing options...
MikeB Posted November 19, 2014 Author Share Posted November 19, 2014 No problem, and yes I agree with everything you say. The point of this "fix" was specifically for Windows 8/8.1 OS not anything else, where 'localhost' is legitimate and causes no issues. When I said culprit I meant the actual thing that fixes the issue. This is a bug in Windows 8/8.1 only as far as I have been able to find out. 2 Link to comment Share on other sites More sharing options...
maxd Posted December 21, 2015 Share Posted December 21, 2015 Thanks!!!, but where is site\config.php file? Link to comment Share on other sites More sharing options...
Mike Rockett Posted December 21, 2015 Share Posted December 21, 2015 Thanks!!!, but where is site\config.php file? I think you're a spammer. If you were using ProcessWire, you would know where the configuration file is... 1 1 Link to comment Share on other sites More sharing options...
maxd Posted December 21, 2015 Share Posted December 21, 2015 I think you're a spammer. If you were using ProcessWire, you would know where the configuration file is... Maybe... Or maybe I am from another country and I do not understand so well English. Besides he was talking about Drupal. Anyway thank you very much for your valuable comment. Link to comment Share on other sites More sharing options...
Mike Rockett Posted December 21, 2015 Share Posted December 21, 2015 Maybe... Or maybe I am from another country and I do not understand so well English. Besides he was talking about Drupal. Anyway thank you very much for your valuable comment. Apologies - I came to that conclusion because it is your first post. (Maybe introducing yourself in that post would have helped.) That aside, welcome to the forums. Link to comment Share on other sites More sharing options...
maxd Posted December 21, 2015 Share Posted December 21, 2015 Thank you for the warm welcome. Link to comment Share on other sites More sharing options...
alanala Posted April 18, 2016 Share Posted April 18, 2016 I do need to express my deepest sincere thanks for your post! It save me. Although i am not running processwire, I spent dayssss in solving my problem and finally read your post and my problem is solved. (you can imagine how desperated i am as i even have no idea of what processwire is) My config: XAMPP, windows10, mysql, drupal I tried numerous different settings (host file, various cache methods, ip4, turnoff firewall, etc), but it still takes more than 20secs for waiting server response. Finally, after i followed your suggestion of fixing by " uncomment bind-address="127.0.0.1" in mysql\bin\my.ini", now server response down to 1.4 second! Wish someone out there in the internet who encounters similar problem (slow drupal server response) can read this post. Thanks very much again. (P.S. i also have no idea where site\config.php and $config->dbHost are located in my system) Link to comment Share on other sites More sharing options...
LostKobrakai Posted April 18, 2016 Share Posted April 18, 2016 (P.S. i also have no idea where site\config.php and $config->dbHost are located in my system) Firstly welcome to the forums. These are processwire specific settings / files, so it's perfectly reasonable why you don't know them. Link to comment Share on other sites More sharing options...
alanala Posted April 18, 2016 Share Posted April 18, 2016 Keep following your concept, i just modified the database configuration at my below file drupal\htdocs\sites\default\settings.php at $database array, i changed 'host' => 'localhost' to 'host' => '127.0.0.1' the server response time further shorten to 200ms now!! Thanks very much again. PHP/5.6.12 Windows10 (64bit) XAMPP for Windows 5.6.12 Apache/2.4.16 (Win32) Drupal 7.43 Link to comment Share on other sites More sharing options...
DCS Posted September 19, 2017 Share Posted September 19, 2017 Noob question: which if any of these changes are something you would un-do when migrated to production server? Thx. Link to comment Share on other sites More sharing options...
abdus Posted September 19, 2017 Share Posted September 19, 2017 MySQL usually listens to loopback interface (127.0.0.1) and only responds to requests coming from the machine itself, like PHP or NodeJS etc (unless you're using a convoluted multi-server DB architecture and have configured PW to connect another machine on the network). So you dont have to change 127.0.0.1 to localhost. In fact leaving it that way will eliminate a (non-zero but very small) delay caused resolving host names to their IP addresses. 2 Link to comment Share on other sites More sharing options...
DCS Posted September 20, 2017 Share Posted September 20, 2017 OK. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now