Hello,
I've heard many stories and seen many postings about slow Drupal response times on local (Windows) servers running WAMP or XAMPP, especially for administration pages. I've used both WAMP and XAMPP, and I've often encountered time out errors, white screens of death etc, all because Drupal was running very slowly from my local machine.
Disabling the updates module can make it run a little faster, but I've found a better solution and I wanted to share with everyone:
Don't use WAMP or XAMPP.
Use the Uniform Server instead:
http://www.uniformserver.com
I saw a user mention this toward the end of a very long thread on improving localhost response times. I feel it's important enough to get its own forum post.
Installing the Uniform Server is quick and easy- just unzip and run. The default settings allow for clean URLs.
Also, you can quickly change the mySQL password using Apanel (which is very helpful when setting up settings.php while installing drupal!)
All of your Drupal files then go into the \UniServer\udrive\www directory (Example: C:\UniServer\udrive\www\mysitename contains the folders misc, modules, themes, includes etc.)
The one other issue is how to make it so you can read from http://mysitename.localhost, instead of http://localhost/mysitename
(This avoids broken-link issues when you move your site from your local server to an online host server).
This has been mentioned before, but there's how to do it in the Uniform Server:
Assuming it's installed in C:\UniServer, go to the C:\UniServer\udrive\usr\local\apache2\conf directory and open up httpd.conf
Find this section:
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
NameVirtualHost *
<VirtualHost *>
ServerName localhost:80
DocumentRoot /www
</VirtualHost>
### Section 4: Secure section
I deleted the lines between # < /VirtualHost > and ### Section 4: Secure section and replaced it with:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "c:/uniserver/udrive/www"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/uniserver/udrive/www/mysitename1"
ServerName mysitename1.localhost
ServerAlias mysitename1
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/uniserver/udrive/www/mysitename2"
ServerName mysitename2.localhost
ServerAlias mysitename2
</VirtualHost>
DocumentRoot "c:/uniserver/udrive/www"
Finally, you have to edit your hosts file which is located in C:\WINDOWS\system32\drivers\etc
Under the line
127.0.0.1 localhost
Add in the lines:
::1 127.0.0.1
127.0.0.1 mysite1.localhost
127.0.0.1 mysite2.localhost
Note: I'm not sure if adding the line ::1 127.0.0.1 is necessary, but I've read it can solve possible IPv6 problems.
I hope that this will make life easier for people running Drupal off their local machines.
(I'm running Windows XP).
-Matt
Comments
=-=
I suggest this is recreated as a handbook page rather than a forum post.
_
Absolutely! This is very useful information... I remember having performance problems with XAMPP.
Pete. (now a smug linux user :-)
What problems are solved by Uniform Server?
My local Windows machines are faster for Drupal for everything except update checking. The update checking is dependent on the network connection, not the processor or operating system. How does Uniform Server solve a network access problem? Are there other problems solved?
The minimal online documentation for Uniform Server mentions the inclusion of eaccelerator. If the other packages do not include a PHP cache then this is a definite advantage of Uniform Server.
Comparing a server in a fast data centre to a local Windows machine on good broadband, the local machine is about the same at update checking and faster at everything else. I do not use Vista or any Windows firewall. The AMP components use the default downloads and installations, not a XAMPP package.
Comparing a similar setup with the Windows machine using Vista, the cure is to replace Vista with any other version of Windows.
The Windows firewall interferes with everything and causes timeouts. The cure is to turn off the Windows firewall and use the firewall in your router.
A ratty broadband service at one site caused problems until complaints to the ISP resulted in upgrades at their end. The update still cannot run at the same time as a large FTP load because there is not enough capacity in their cheap broadband.
The Drupal administration code does a silly update check outside of the status report and that can make the administration page look slow. Only one of my sites suffers because that site uses many modules and themes, all requiring an update check.
I have never seen a performance problem caused by Apache. MySQL can be configured to use too little memory or, rarely, too much but not using the default settings. PHP does not have any settings that cause performance problems. If XAMPP or other packages replace the default settings, they would have to use weird settings to cause problems. That leaves Vista, the Microsoft firewall, cheap/faulty broadband services, and use of a PHP cache, in that order, as the most likely causes of slow performance with Uniform Server fixing only that last one.
petermoulding.com/web_architect
_
Fair comment! The Windows firewall is creates more problems than it solves, especially these days when routers ship with a firewall anyway...
Pete.
Windows firewall interfere with local server too?
really ... even Apache being listed as exceptions program/services? how about others Virus software i.e karpersky?
I disable firewall while Drupaling
I've found that the uniform server is faster than WAMP or XAMPP on Windows XP. But I can make it faster still by turning off Windows Firewall completely when I'm Drupaling on my local computer.
Hello Matt G, Thank You for
Hello Matt G,
Thank You for your hint.
I have tried UniServer and it is surely very user-friendly, very good in performances etc.
Anyway in my case, Drupal admin pages (i.e. modules, update, status report) still run slowly as on any other WAMP package on my local XP.
I struggle with this slowdowns since when I started using Drupal on local for testing purposes. It is very frustrating.
I'm conscious that the majority of Drupal users don't experience any significant slowdowns testing Drupal locally. And for this reason, I almost sure that all relies on maybe the firewall (win firewall is disabled, it's zonealarm), or maybe my ISP, in my case.
Nonetheless still I couldn't say which direction I could take to investigate and solve this OLD trouble.
Thank You and I'm glad it worked for you! Bye
zoo
It might be Windows Firewall
zoo,
Windows Firewall might be causing the slowdown- most of the complaints I see online are from users of Windows XP.
If nothing else speeds up WAMP, Uniserver, XAMPP etc., as a last resort you can disable Windows Firewall when you are drupaling.
It's in Control Panel --> Settings --> Windows Firewall and set it to "Off"
But remember to turn it back on again when you are done coding for the day!
Hello Matt G, Thank You for
Hello Matt G,
Thank You for your answer.
Windows Firewall is/was already off, nonetheless I'm still experiencing the slowdowns...
Bye
zoo
same problem, tried everything but....
installing either ubuntu on my machine or installing the uniform server suggested on here.
I'm really stumped with this. I thought disabling the firewall was going to be my answer. Doing other non-related Drupal work works fine on my localhost, no speed problems. Just Drupal.
Are there any other tricks to use, i have tried different php.ini settings, turning off firewall, using chrome.. i feel i want to exhaust all options for WAMP before trying Ubuntu or uniform server. There must be a way to configure WAMP on XP surely?!
All i know is that i can't go on with slow speeds on my localhost. I just uploaded some work i have been doing over the weekend to my remote host server, modules page takes 5 seconds to load. On my locahost it take 45 seconds at least. It makes it very frustrating to do work, you're sat there waiting all the time....
Is there anything else i can do before i give up and use Ubuntu or uniform server?
thanks
Craig
White Screen
This has not worked for me very well.
I get white screen after trying to save from the Database configuration option in drupal install. I have a database installed and everything seems correct according to the install instructions...
http://wiki.uniformserver.com/index.php/Installing_Drupal_on_4.0-Mona#In...
copy and pasted then renamed settings file as well...
fixed
%^&((%*&%*
ok i am sorry for the foul innuendo but after 8 hours I finally got it. Uniserver is easy to set up but be sure to download version 5.2. Any later version uses PHP 5.3 which drupal does not support!!!!!!!!
EEEEEERRRRRRRRR
already have apache installed...
Hey guys,
I'm giving the uniform server a bash. I have installed piece of cake. But, i already have Apache installed. So uniform is sharing my localhost with my previously configured apache server.
If any of you guys have 'migrated' from WAMP to this, what did you do with your WAMP already installed?
I'm not sure what to do here...
cheers
Craig
Universal Server - Clean URLs not working though enabled
Excellent suggestion here on using this local server instead of WAMP -- very speedy in comparison. Thanks.
I am setting up a new local development server for one of my production websites. My only question is related to clean URLs. I confirmed that as you suggested Uniform Server does indeed have apache mod_rewrite enabled by default in the Apache settings. I also confirmed that my .htaccess file includes the "RewriteEngine on" setting.
Even though this is the case, when I try to access pages on my site, the clean URLs are not working. I am required to put the ?q= before each URL. Examples:
mysite.com/?q=admin/settings/clean-urls - this works
mysite.com/admin/settings/clean-urls - this does not work
Any other place where this might be controlled?
DG
Use the Drupal .htaccess
The rewrite from ?q= is performed by the RewriteCond and RewriteRule rules provided in the Drupal .htaccess.
petermoulding.com/web_architect
Thanks, but not luck yet
Thanks peterx for posting that. I have that exact code in my .htaccess file. Still, the URLs don't work. I've posted the entire file here so you can see what I'm working with.
Any thoughts?
DG
=-=
if the .htaccess file is correct, then you have to start looking at your environment. is mod_rewrite enabled in apache? are you even using apache?
Virus checkers
Currently the biggest killer on my dev box is a virus checker. It runs at top priority instead of in the background. Annoying. I installed the virus checker because a Firefox update turned on Java and suddenly my machine was flooded with viruses from advertising links despite my not clicking on any of the links. Bah! Java! I cast thee out!
And out goes AVG. I do not know if any of the alternatives can be set to run at a lower priority than the Web server because that is really an operating system thing.
I am not going to use a prepack AMP because they do not give enough controls over configuration and I cannot exactly match the configuration of the hosting servers. If I had the time, I would move all the sites to a Ubuntu/Webmin/Usermin/Apache/MySQL/PostgreSQL/PHP configuration and set up a local computer with exactly the same settings, down to the same MySQL configuration. Hopefully one day there will be a WUAMPPbuntu preconfigured for Web hosting.
I am about to switch my email to a separate computer without Java or a virus checker. A KVM switch lets me easily choose between the computers. I think I will set up one just with Ubuntu, Apache, MySQL, PHP, PHPMyAdmin, and Bluefish. Nothing else. SSDs for storage speed. 6 * 4 GB DIMMs. Smoking.
Ubuntu Studio uses a modified Linux for reduced lag, making some things milliseconds faster. Ubuntu 10.10 is significantly faster than Ubuntu 10.4 and Ubuntu Studio is faster again, probably removing the limitation of the speed of light.
I found a new range of mice and keyboards that reduce lag from 3 ms to 1 ms by using USB 2 chips instead of USB 1 chips. All that stuff used for gaming is now cheap enough to use when typing documentation.
By my calculations, based on the sales literature, the computer will update code 25 ms before I type.
petermoulding.com/web_architect
Still running slow....
Hey guys,
I have successfully installed The UniServer, and also run my Drupal site whilst turning off Windows Firewall, and i am still getting super slow performance.
Are there any other tweaks that i can make to my ini files, or the httpd.conf to increase performance? I'm going out of my mind here!
thanks
Craig
Which bits are slow and what are you running it on?
Hello Craig,
You say 45 seconds instead of 5 seconds. Is that occasionally or for every page? Do you use a desktop or a notebook?
Going from 5 to 10 is common when you use something oriented to desktop use instead of Web serving. 45 is a serious difference. Some old notebooks and some Dell desktops perform like that because of really cheap slow disks, slow memory, etc. My machine with the virus checker slows down like that when the virus checker is checking a big batch of email. Vista sometimes is like that. Everything else is difficult to identify without seeing your machine in action.
Internet Explorer will look for files locally then do nothing for a minute then wake up. Windows will do the same sometimes because the IE developers were allowed to infect Windows with the same code. Check your logs for missing files.
petermoulding.com/web_architect
mainly modules page...
Hey Peter,
Thank you for your reply! It isn't every page that takes 45 seconds, you guessed, the main culprit is the modules page. I concede that i have quite a few modules installed (including Ubercart), which means the module page takes 45 seconds to load. Most of the other admin pages take around 15 seconds to load. To give you more details on my system:
So is the main reason due to having a rubbish machine? What aspect of my setup would i need to improve to get Drupal running better on localhost? Sorry, i'm not too hot on Computer infastructure and stuff...
I have looked into installing Ubuntu on VirtualBox aswell, however, my processor doesn't have x86 capability. So would upgrading my processor help with the WAMP situation?
Your help would be greatly appreciated on this one! It would hugely satisfy me to be able to work on Drupal locally at a decent speed.
Thanks
Craig
File finding and network search in admin
When you visit the admin page for the first time, Drupal spends a lot of time checking the status of your modules. That slowdown depends on network connections, firewalls, virus checkers, etc.
You then select the module page and Drupal checks the module files, rebuilding the module registry. This part is disk based. You could have a fast processor but a slow disk and get awful performance. If you use the pro version of XP with NTFS, NTFS should read the directory information into memory and cache it. Your next visit to the module page should be faster. Drupal still has to interpret the .ini files and do other stuff.
If you visit the module page twice and the second one is just as slow, then it is probably hardware. Memory too small to cash files? The last time I looked at Drupal on XP, 10 Web sites with lots of modules used only 1.6 GB. Disk too slow? Most of my disks are replaced every year with the latest and the old ones are recycled out to backup. Your disk might be old and slow. Processor too slow? XP/Drupal runs fine on machines around 2 GHz. Chipset? Dell does not publish detailed specs.
The 620 must be 5 or 6 years old. Your disk will break soon. Upgrading individual components will be expensive and no single component, except possibly the disk, will give you a real speed improvement. The 620 sells online for less than $100. Downgrade it to a print server and get a new computer. If you want to spend some money on it, replace the disk with something like the quiet Samsung 1 TB 7200 rpm disk (AU$63).
The Drupal modules list looks at all the modules in the modules directory. If you are not using one, delete it.
petermoulding.com/web_architect
increase WAMP Performance
Intro:
Apache MPM winnt (mpm_winnt_module):
Apache MPM worker (mpm_worker_module):
So..!
Include conf/extra/httpd-mpm.conf789?
choose a practical number (in my server it set to 900)
refer to Apache MPM worker
*** :(( *** don't delete following lines, add above lines below the following: *** :)) ***
admin/build/modules/list/confirm and
admin/build/modules
Another
Another solution
http://drupal.org/node/348202#comment-3349704
PS For me, clearing the session table and watchdog fixed it for me. Also setting realpath_cache_size to 2M helped.
My Drupal sites:
FastXAMPP - is a tool for web developers working in Linux Ubuntu
Happy New Year!
I created a small utility for more convenient work with XAMPP for Linux.
I hope it will be useful to many.
More info: http://fastxampp.org/en/