3
votes

When using XAMPP (1.7.5 Beta) under Windows 7 (Ultimate, version 6.1, build 7600), it takes several seconds before pages actually show up. During these seconds, the browser shows "Waiting for site.localhost.com..." and Apache (httpd.exe, version 2.2.17) has 99% CPU load.

I have already tried to speed things up in several ways:

  • Uncommented "Win32DisableAcceptEx" in xampp\apache\conf\extra\httpd-mpm.conf
  • Uncommented "EnableMMAP Off" and "EnableSendfile Off" in xampp\apache\conf\httpd.conf
  • Disabled all firewall and antivirus software (Windows Defender/Windows Firewall, Norton AntiVirus).
  • In the hosts file, commented out "::1 localhost" and uncommented "127.0.0.1 localhost".
  • Executed (via cmd): netsh; interface; portproxy; add v6tov4 listenport=80 connectport=80.
  • Even disabled IPv6 completely, by following these instructions.
  • The only place where "HostnameLookups" is set, is in xampp\apache\conf\httpd-default.conf, to: Off.
  • Tried PHP in CGI mode by commenting out (in httpd-xampp.conf): LoadFile "C:/xampp/php/php5ts.dll" and LoadModule php5_module modules/php5apache2_2.dll.

None of these possible solutions had any noticeable effect on the speed. Does Apache have difficulty trying to find the destination host ('gethostbyname')? What else could I try to speed things up?

2
I recommend you change your dev environment. Use VMWare Player and set your host folder as the VirtualHost directory using a shared mount... it will speed up your Magento development a lot.Darren
I'll look into this, thanks. I also changed the safe_mode in php.ini to off, which seems to speed up the back-end quite a bit.Norbert
Yeah I def recommend it. When I was trying to develop on a platform similar to XAMPP (WAMP) it was very slow, but porting it to a virtual environment will speed it up tremendously; you just need to know intermediate sys admin skills.Darren

2 Answers

2
votes

Read over Magento's Optimization White Paper, although it mentions enterprise the same methodologies will and should be applied. Magento is by no means simplistic and can be very resource intensive. Like some others mentioned I normally run within a Virtual Machine on a LAMP stack and have all my optimization's (both at server application levels and on a Magento level) preset on a base install of Magento. Running an Opcode cache like eAccelerator or APC can help improve load times. Keeping Magento's caching layers enabled can help as well but can cripple development if you forget its enabled during development, however there are lots of tools available that can clear this for you from a single command line or a tool like Alan Storms eCommerce Bug.


EDIT

Optimization Whitepaper link:

Also, with PHP7 now including OpCache, enabling it with default settings with date/time checks along with AOE_ClassPathCache can help disk I/O Performance.

If you are using an IDE with Class lookups, keeping a local copy of the code base you are working on can greatly speed up indexing in such IDEs like PHPStorm/NetBeans/etc. Atwix has a good article on Docker with Magento:

Some good tools for local Magento 1.x development:

0
votes

Use a connection profiler like Chrome's to see whether this is actually a lookup issue, or whether you are waiting for the site to return content. Since you tagged this question Magento, which is known for slowness before you optimize it, I'm guessing the latter.

Apache runs some very major sites on the internets, and they don't have several second delays, so the answer to your question about Apache is most likely no. Furthermore, DNS lookup happens between your browser and a DNS server, not the target host. Once the request is sent to the target host, you wait for a rendered response from it.

Take a look at the several questions about optimizing Magento sites on SO and you should get some ideas on how to speed your site up.