WAMP on Windows 10 - Localhost vs 127.0.0.1

Hi all,

For anyone who finds that Xibo is running slowly on Windows in a WAMP environment, check that Xibo settings use ‘127.0.0.1’ as the database host address, rather than using ‘localhost’.
This can be configured / changed in your ‘settings.php’ file.

For whatever reason in Windows 10 (and possibly previous versions), it causes delays trying to resolve localhost to 127.0.0.1 (each action in Xibo would take 3-4 seconds to process).

By using 127.0.0.1 as the database host, my install is now lightning fast - how it should have been from the start.

Hope this helps someone else.

Justin

1 Like

WOW! Much better on Server 2012 as well and not running WAMP, with Xibo 1.7.8.

I am thinking now that localhost should never be used.

localhost should work fine, but I think if you have IPv6 enabled on your system, localhost defaults to the IPv6 version of the IP address first, and then if it fails to connect, will then resolve to 127.0.0.1. You should be able to disable IPv6 if you’re not using it and then localhost will work as expected, or run MySQL on IPv6 as well so it connects first time.

Either way, coding to 127.0.0.1 should be fine in the database settings if that works for you, but may well not work at all on Linux (depending on how MySQL is configured).

1 Like

Absolutly agree with justinh.

Had the same problem with slow fast-cgi PHP execution on IIS 7.0 windows server 2008 r2. It took 2 second to switch from one tab to another in XIBO cms.

Some people say IPV6 sometimes is the reason for slowing execution. But in my case I had IPV6 disabled.

Finally I found the reason: localhost resolvation to 127.0.0.1 took too much time.

There are few solutions:
1)change HOSTS file in C:\Windows\System32\drivers\etc (for x64 windows) - uncomment 127.0.0.1 localhost
2)change localhost to 127.0.0.1 in settings.php in web folder of xibo.

now xibo cms runs very fast.
(Also realpath_cache_size=1M in PHP.ini makes CMS work even faster)

Alex, I think you should add this to IIS (WAMP,…) Windows installation chapter of XIBO manual.

Windows used to have that value set in hosts.

They removed it because Microsoft are now handling it in the DNS resolver directly.

I don’t think we can advise people to wholesale make that change if they’re not having an issue - and in our preferred deployment method (Docker), it isn’t an issue.

It’s well documented here now so if people are having slow page load times, it should be easy for them to make that modification if they require it.