You are here:Home»KB»Web Server»xampp»My Xampp Performance Notes
Saturday, 21 February 2015 19:54

My Xampp Performance Notes

Written by

Update (22-01-17) - The following settings work

The main cause for slow xampp on windows is the MySQL service and the slow access times slow the whole page loading process.

i used the MySQL ini file my-huge.ini and these settings from the drupal site both the PHP and innodb. Other settings might of been applied at testing but I dont think so.

INNODB SPECIFIC

innodb_buffer_pool_size = 384M
innodb_additional_mem_pool_size = 20M
innodb_log_file_size = 10M
innodb_log_buffer_size = 64M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 180


Primary Document

Preface

The document covers how to improve speed in Xampp as I have found it struggles to most basic tasks quickly.

Xampp is easily configurable and that is why I have persevered with it and created this document in which my research has been successful.

I will cover all of the tips and settings that I discovered along the way. Some are of use whilst others were and some definitely not.

There are 2 main areas where xampp can be slow.

  1. http daemon – rendering of the html
  2. MySQL Daemon – the actual retrieval of the data

General

When to diagnose xampp speed

  • firefox / ie cache dont let this fool you. there are also several types of FF cache
  • dont forget webserver cache ie htaccess
  • turn all caching off when diagnosing xampp speed

Research:

Localhost

Below are various lines that should be added or commented out in the hosts file to increase the speed a page loads. I have seen various combinations of these.

These localhost settings try them on there own to see if you get any improvements. Most likely on windows 7+ and the latest version of xampp you will see no difference but on old setups (which need updating) you might see some benefit.

127.0.0.1 127.0.0.1

  • Add to localhost
  • this one is probably bollocks because of an infinite loop or pointless lookup

127.0.0.1 locahost

  • comment out
  • if this is commented out, localhost will not be resolved
  • Win7 ultimate x64 this is commented out by default. Xampp MySQL resolution will not work without this statement (tested on v1.8.3.0)

::1

  • comment out
  • possible use to have some effect in vista where the IPV6 method was not implemented correctely, it certainly does stop the IPV6 lookup happening before the IPV4 so will save a little time there and any possible issues with IPV6 from xampp. Do not permanently change this unless you see a marked difference. In windows 7+ these issues are probably resolved and also in later version of xampp where the network stack is a lot better and compiled with newer more compatable binaries.
  • NB: If you comment out ::1 when you ping localhost locally you will receive a ping back from 127.0.0.1, if you do not comment it out you receive a ping back from ::1 (or whatever)

not massive improvements, if any

Research:

Network

Browser

  • network.dns.disableIPv6 (FireFox, IPV6 service)
    http://kb.mozillazine.org/Network.dns.disableIPv6
  • network.http.keep-alive - toggle it to false (default/integer/115) ? (FireFox)
  • Use browser with no addons
  • Accessing the website via the IP i.e. 127.0.0.01 can be quicker because there are no DNS lookups

PHP

  • Increase memory_limit from (i.e. 64mb to 256mb), read this
  • disable xebug - http://stackoverflow.com/questions/1891031/xampp-on-win7-too-slow
  • eAccelerator – this will speed things up but not the underlying system which is what I am addressing in this document.
    uncomment zend_extension = "C:\xampp\php\ext\php_eaccelerator_ts.dll" - http://stackoverflow.com/questions/1891031/xampp-on-win7-too-slow

    eAccelerator is a free open-source PHP accelerator & optimizer. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.

MySQL

  • innodb_flush_log_at_trx_commit = 2 (some say option 1 can be quicker) (already set to 1, does not seem to make that much difference)
  • realpath_cache_size = 24mb (small increase so far)
  • MyISLAM vs INNODB
  • MySQL to use MyISAM
  • MySQL caching (query cache)
  • MySQL settings
  • Innodb settings all described in “my-innodb-heavy-4G.ini”
  • Address individual settings + add links
  • innodb_buffer_pool_size ?
  • innodb_flush_log_at_trx_commit = 2 (definately quicker)

Example 1from here

The query side of things is not 100% needed because it will not effectively affect the base line speed.

#----------------------------------------------------
#          !!!! Query Cache Config !!!!
#----------------------------------------------------

query-cache-size = 524288000
query-cache-limit = 5242880
query-cache-type = 1

#----------------------------------------------------
#          !!!! InnoDB Buffer Config !!!!
#----------------------------------------------------

innodb-buffer-pool-size = 1000M
innodb-additional-mem-pool-size = 200M
innodb-log-files-in-group = 2
innodb-log-buffer-size = 10M
innodb-file-per-table = 1

Example 2from here

innodb_buffer_pool_size = 1G
innodb_flush_log_at_trx_commit = 2
innodb_thread_concurrency=8
transaction-isolation=READ-COMMITTED

Research:

people have said moving back to myislam over innodb make a massive difference.

here is why.

all the data from all the databases in xampp is stored in 1 files but has table referecnes for compatability only. so what this means if you have one nasty database it will slow them all down because you have to parse the whole database. by switching back to myislam they all have their own separate files and so will not affect each other.

This article includes discussion on the following from running slow on localhost

  • realpath_cache_size = 24mb
  • MySQL to use MyISAM
  • innodb_buffer_pool_size ?
  • innodb_flush_log_at_trx_commit = 2
  • innodb-file-per-table = 1   (this setting create 1 file per database instead of all in one)

This article includes discussion on the following from localhost (xampp) very slow on Vista for some reason

  • call the apache web server address not by hostname but ip address. On a local computer it is 127.0.0.1
  • the other solution is to disable TCP/IP v6 protocol of your network interface
    add v6tov4 listenport=80 connectport=80

General Links:

Conclusion

There might be specific issues on certain systems but the majority of the lag is with the MySQL engine, the database settings, especially since xampp is now using INNODB instead of the old MyISLAM.

Stay with INNODB as it has better data protection. It is best to tweak the settings to get the best out of INNODB rather than migrate to MyISLAM.

Current at (29-06-13) and (WIP)

innodb_buffer_pool_size = 1G  (has biggest effect)
innodb_additional_mem_pool_size = 200M
innodb_flush_log_at_trx_commit = 2
innodb_thread_concurrency = 8
transaction-isolation = READ-COMMITTED

these are commented out in hosts but probably make no difference on modern systems

#             127.0.0.1 127.0.0.1
#             ::1       localhost

NB:

  • A faster computer with more RAM and faster disk will always make xampp run quicker.
  • This was in some of my notes and might need changing,
    ## Set .._log_file_size to 25 % of buffer pool size
    innodb_log_file_size = 256M

Real Life Example - httpd performance and Conclusion

On A fresh Windows 7 Installation

  • i do not need to add '127.0.0.1 localhost' rule in hosts file. it works as is.
  • httpd.exe also works a lot quicker
  • httpd.exe still maxes out but for 1/10 of the time, therefore indocating something on the tcp/ip stack is interfereing
  • firefox and ie on the faulty system do not have smooth browsing experiences and can crash frequently
  • xampp should works without a modicifaction to the host file indicating an issue with the microsoft dns service
  • when zone alarm was installed the ping response form 127.0.0.1 would get slower and slower whereas a ping to ::1 would always be <1ms

Load times on the fresh copy windows 7, using a large website with xampp and on a 5400rpm drive:

Page		afterdispatch (no internet)	afterdispatch ( with internet)

home		546ms				210ms
portfolio	327ms				176ms

Causes of Slowness:

  • dodgy 3rd party program still installed that integrate/interfere witht the tcp/ip stack
  • dodgy registry entry
  • corrupt windows system files (not likely as sfc found no errors)
  • remanents of a program left installed that integrate/interfere witht the tcp/ip stack

Solution Options

  • find the offending software (not easy and have already tried)
  • fresh install of windows 7 (when installing new software monitor with a set benchmark, ie a slow website in xampp)

What Did I Do ?

I reformatted my pc in the end because there was something affecting the tcp/ip stack

How do i know it was the TCP/IP stack

  • xampp would not work unless i put in a host file entry localhost 127.0.0.1
  • when zone alarm was installed over time the ipv4 ping got slower whilst the ipv6 stayed the same
  • browsing could be jerky. on a fast internet connection it still did not seem as fast as other peoples
  • i ran a copy of large website on a fresh windows 7 install on a 5400rpm drive and a page after dispatch came in about 300ms where as my dodgy wiondows could be as long as 3000ms just for the dispatch
  • all my speed modifications never made that much difference to xampp performance (perhaps the innodb settings and php memory increase, ipv4 default showed promise but that might be because of the underlying tcp/ip stack issue i had)

Performance Notes (to be sorted)

Worked

  • disabled ZA antivirus and firewall - makes a big difference
  • I just changed the server name from localhost to 127.0.0.1 in database connection configuration and it worked light speed.
    (http://stackoverflow.com/questions/13248260/localhost-taking-too-long-what-to-do )
  • add xampp to AV/malware realtime scanner exclusions
  • disabling malware bytes definately makes a performance increase, you can hear the HDD access is a lot more vigourous.
  • malware bytes and comodo AV might not like each others realtime scanner running at the sametime
  • make sure any xammp log file is not more that a couple of megs big
  • comodo AV pipes up when you do a page refesh in a browser of an xammp server site (very heavy cpu usage)
  • with hips/firewall/av all disabled 'internet sercurity helper' (comodo) service still runs at high CPU. xammp a little quicker
  • increasing PHP Memory can improve performance (but this is an indirect affect because it makes PHP run better not xampp)
  • in a multicore processor, enabling the CPU to run as a single processor as xampp is not multicore aware

Didn’t Work

  • revert using 127.0.0.1 in joomla databse connection - makes no difference
  • re-enable ipv6 on my wifi card - (seems to make no difference)
  • xdebug - already disabled so no difference here.
  • zend_extension = "C:\xampp\php\ext\php_eaccelerator_ts.dll" - already disabled
  • changing port 8080 (prevents conflicts)
  • DefaultReceiveWindow = (10000 * 1024) / 8 = 1280000
    DefaultSendWindow = (10000 * 1024) / 8 = 1280000
    no real difference or worse (need removing)
  • run as administrator

Try

  • http://www.techunboxed.com/2012/08/how-to-disable-ipv6-in-windows-8.html  (also for windows 7)
  • dont foget to make sure FF is not hogging the memwory when testing
  • Disable ipv4 to IPv6 and disable ipV6 as unticking in network card does not do what is expected
  • bind mysql to 127.0.0.1 not localhost
  • running xampp as services
  • use the latest version
  • on laptop make sure computer is set to high performance
  • run xampp in safe mode

My Case where My Stack was faulty

  • if using the default hosts file for windows 7 x64, the mysql database might not connect. you must uncomment. The following line allows a IPv4 lookup with out going through the windows IPv6 to IPv4 converter.
     #       127.0.0.1       localhost

    Certain versions fo mysql binaries do not support IPv6 and how they lookup localhost can cause issues. if you uncomment the following line in the host file, this prevents mysql connection because it forces ‘localhost’ lookup on IPv6
     #       ::1             localhost
  • mysql 5 does not handle IPv6 - http://bobstrand.com/totm/2010/04/hey-dude-wheres-my-localhost/
  • I applied fixit that prefers IPv4 over IPv6, rebooted - definitely better, but i need to test longer

xampp mysql/mysql in general cannot handle ipv6

xampp mysql/mysql in general cannot handle ipv6. if it resolves localhost and gets ::1 , the mysql cannot resolve the address and thus does not work

solutions:

  • add to host file, localhost 127.0.0.1 (this on its own will fix the resolution but not the speed issue)
  • make ipv4 prefered protocol (this on its own will fix the resolution but maybe not the speed issue as overtime ipv4 ping to localhost etc.. gets longer. but at the beginning there is a definate speed improvement)
  • disable ipv6 completely (this on its own will fix the resolution and probably the speed issue permanently)

unchecked:

  • bind mysql to 127.0.0.1   (this on its own will fix the resolution but maybe not the speed issue)
  • it must be it does not like ::1 return instead of 127.0.0.1

Links

Useful

Ping Batch File

This batch file will allows you to ping the different types of network hosts. Run this and view all of the ping responses on the screen at the same time. I would then monitor them over time. I ran a test for 32 hours to make sure I could see any differences easily.

start ping localhost -t
start ping 127.0.0.1 -t
start ping 192.168.1.100 -t
start ping ::1 –t

IP Performance Notes

Microsoft IP Fixits

These are useful for helping with IPv4 and IPv6 issues

  • MicrosoftFixit50267 - restore default hosts file.msi
  • MicrosoftFixit50409 - disable IPv6.msi
  • MicrosoftFixit50410 - Prefer IPv4 over IPv6 .msi

Why is my CPU load for Apache almost 99%?

This just something that i have picked up but not checked.

There is one of two scenarios at play here. Either your CPU is maxing out, or you can browser connect to the server, but not see anything (the system is trying unsucessfully to load the page). In either case you can find the following message in the Apache log file:

Child: Encountered too many AcceptEx faults accepting client connections. winnt_mpm: falling back to 'AcceptFilter none'.

The MPM falls back to a safer implementation, but some client requests were not processed correctly. In order to avoid this error, use "AcceptFilter" with accept filter "none" in the "\xampp\apache\conf\extra\httpd-mpm.conf" file.

Read 10598 times Last modified on Sunday, 22 January 2017 16:59