- PeterMoulding.com
- Author
- Trainer
- Speaker
- Business Coach
- How to write a How To book
- PHP Courses
- Speaking
- Web Architect
- Australia
- Books
- Authors
- Akkana Peck
- Alex Berenson
- Andrew Nugent
- Ben Sanders
- Brock Clarke
- Chris Simms
- David Mercer
- Dianna Mullet
- Don Winslow
- Dori Smith
- Harlan Coben
- Jack McDevitt
- James Wines
- Jerry Yudelson
- John Grisham
- Kevin Mullet
- L. E. Modesitt Jr.
- Laurell K. Hamilton
- Marshall Karp
- Martina Cole
- Michael Marshall Smith
- Michel Roux Jr
- Nadia Sawalha
- Philip Pullman
- Raymond Khoury
- Richard North Patterson
- Robert Masello
- Sally Roth
- Sarah Langan
- Stella Rimington
- Stephen Booth
- Stephen King
- Stephen Leather
- T.C. Boyle
- Tom Negrino
- Tony Hillerman
- Urban Waite
- Val McDermid
- Valerio Massimo Manfredi
- Beginning GIMP
- Beginning Visual C++
- Culturalism
- Fiction
- A Drink Before The War
- A Talent for War
- Bag of Bones
- Blood and Ice
- Burn
- Dark Lady
- Dead Line
- Eclipse
- Empress of Eternity
- Exley
- Flipping Out
- Just One Look
- Nightfall
- Pet Sematary
- Savage Moon
- Skinwalkers
- Starvation Lake
- The Fallen
- The Gardens of the Dead
- The Jump
- The Last Templar
- The Mermaids Singing
- The Midnight Mayor
- The Secret Soldier
- The Summons
- The Terror of Living
- The Testament
- The Tower
- Under the Dome
- Virus
- AJAX and PHP
- Aging with Grace
- Food books
- Green Architecture
- Life Is So Good
- SQL: The Complete Reference
- The Backyard Bird Lover's Ultimate How-to Guide
- The Garden Gurus
- Authors
- Sustainability
- -18 hours left to decide the future of Australia
- Campbells vegetable stock or Massel vegetable stock?
- Carbon Sequestration
- Carbon tax for Australia is a fraud
- Copenhagen will fail
- Cost of living in Australia
- Dick Smith jumps on the population bandwagon
- Dry Run: Preventing the Next Urban Water Crisis
- Energy Saving Lights
- Garlic
- How many people can live in Australia?
- Its obsolete, throw it out!
- Julia Gillard offers 9.9 billion dollars bribe to Rob Oakeshott
- Laundry detergent
- Petrol or Diesel?
- Reflective foil batts kill
- RoHS
- Sea level to rise 3mm due to climate change
- Solar power
- Spring again in Sydney
- Sustainable fuels
- The CRUD Tax is back
- The people who make building regulations do not own houses
- Water efficiency
- Which insulation is safer, foil or wool?
- Will Australia reduce greenhouse gas emissions?
- Technology
- Android or Blackberry or iPhone or a flip phone?
- Apple versus Google 2011
- Cameras
- Cars
- Colour
- Burgundy
- Colour Blindness
- Colour Names
- Dulux colours
- Pantone colours
- Safe Colours
- Seculine ProDisk Mini colour balance card
- What Causes Colour Blindness?
- Hardware
- Batteries for the Digital Age
- Cables
- Cases
- Computer reliability
- Computrace
- Disks
- Astone ISO Gear 481E
- Best SSD for your notebook computer
- Disk block size
- Hitachi disk HDS722020ALA330
- LaCie USB 2.0 250 GB mobile hard drive design by F.A. Porsche
- SMART disk
- Samsung 2 TB HD204UI quiet low power disk for mass storage
- Seagate and Samsung merge disk business
- Select the right disk for your RAID array
- USB disk speed
- Western Digital WD20EARX 2 GB SATA 3 disk
- How long should computer hardware last?
- Keyboards
- Mainframe
- Memory cards
- Monitors
- Netbooks, notebooks, tablets, and xPads
- Network Attached Storage
- OLED Displays
- PC's are a thing of the past
- Printers
- Quiet
- Samsung Galaxy S
- Speed
- Television
- Tools
- USB
- Worst computer movies
- Xserve is dead. What next?
- Your backup will not work
- Z68 motherboards
- iPad or Acer Aspire One?
- IQ
- LG Intello Washing Machine
- Lack of a challenge
- Networks
- 802.11n wireless networking
- D-Link DIR-655 wireless router
- D-Link DWA-160 Xtreme N dual band USB adapter
- D-Link DWA-556 Xtreme N PCI Express desktop adapter
- MIMO
- NBN spends another $12 billion of our tax money on nothing
- National Broadband Network
- Netgear wireless modem router DGND3300 with 300 Mbps 802.11n
- Refrigerator kills wireless broadband
- Small Wireless Network
- TP-LINK TL-SG10005D 5 port gigabit switch
- TP-Link TL-WR1043N wireless N gigabit router
- Telstra Pre-paid Mobile Wi-Fi
- Where are the router plus proxy server combinations?
- Open Source documentation
- Software
- 7-zip
- Accounting
- Asterisk
- Audacity
- Backup software
- Bloat only in Windows
- CAD
- CDex
- Disk imaging software for copying and backup
- Exact Audio Copy
- Filezilla
- Firefox
- Java
- LibreOffice or OpenOffice?
- Linux
- 1 in 5 servers will ship with Linux
- Android phones outsell iPhone
- Another Move to Linux
- CentOS 5.5 installation on SSD and RAID 5
- Debian
- Debian 5.0.5 AMD64 installation
- Debian 5.06 installation
- Fedora
- Fedora or Ubuntu?
- Gnome or KDE?
- K9copy
- Linux 2.6.38
- Linux Gnome login settings lost
- Linux Mint
- Linux RAID, a rant
- Linux Speed
- Linux Time
- Linux reliability as demonstrated by Ubuntu 10.10
- Linux reliability as demonstrated by Ubuntu 11.4
- Linux still a struggle in 2011
- Linux workstation disk RAID 1
- Linux, NT, Windows, and SETI
- Linux, three years of progress
- London Stock Exchange switches to Linux
- Mandrake Linux 9.2
- The partition is misaligned by 48128 bytes - warning from Linux RAID
- Ubuntu
- How to fix the scroll bars in Ubuntu 11.4 Gnome
- Kubuntu 10.10 alternate installation on desktop with RAID 1
- POWbuntu
- Ubuntu 10.10 after 6 months use
- Ubuntu 10.10 alternate installation
- Ubuntu 10.10 desktop RAID 1
- Ubuntu 10.10 desktop RAID 5
- Ubuntu 10.10 desktop install on a netbook
- Ubuntu 10.10 desktop installation
- Ubuntu 10.10 netbook install on a netbook
- Ubuntu 10.10 server AMD64
- Ubuntu 10.10 upgrade to version 11.4 beta 2
- Ubuntu 10.4
- Ubuntu 11.10
- Ubuntu 11.10 first upgrade
- Ubuntu 11.4 after one month use
- Ubuntu 12.04 beta1 desktop amd64
- Ubuntu One
- Ubuntu by Microsoft?
- Ubuntu desktop upgrade 10.4 to 10.10 failed because I did not check the media
- Ubuntu strikes again
- Upgrade Ubuntu to Linux Mint 12 LDXE for extra speed
- Yes, use Linux but not that distribution!
- Nero
- OpenOffice
- OpenOffice is now Apache Office
- Project management
- Scribus
- Software for Windows and Linux
- Text editors
- Time
- Todo applications
- Tomboy notes
- Top text editors
- Version control
- VideoLAN VLC media player
- Visio
- Webmin
- Webmin installation on CentOS for Web development
- Webmin installation on Ubuntu
- What is the most popular open source software today?
- Windows
- Another Windows person goes Linux
- BAD_POOL_CALLER
- Cygwin
- Microsoft Malicious Software Removal Tool cannot find a common virus
- One of the developers of Windows XP is criminally insane
- There are unused icons on your desktop
- W32time
- Which Windows version?
- Windows 7 Home Premium
- Windows XP Stop 0x0000007B during installation
- Windows XP is a disaster
- Windows processes
- XML
- Zip, bzip, gzip, or 7zip?
- configFree
- Technology Succession Planning
- VoIP
- Web Sites
- Drupal
- Do Drupal themes have to use the GPL?
- Drupal 7
- A better search facility for Drupal
- Drupal - performance or flexibility
- Drupal 7 Fields are hard to fix
- Drupal 7 new features
- Drupal 7 ships on January 5
- Drupal 7.14
- Drupal 7.4 hits PeterMoulding.com
- Drupal function sequence
- The evolution of a module
- Undefined index: headers in DefaultMailSystem->mail() (line 54 of /modules/system/system.mail.inc).
- Undefined index: to in DefaultMailSystem->mail() (line 83 of /modules/system/system.mail.inc).
- implode(): Invalid arguments passed in DefaultMailSystem->format() (line 23 of /modules/system/system.mail.inc).
- Drupal 8
- Drupal Code Load Cut
- Drupal How To
- Drupal Modules
- Backup and Migrate
- Browscap
- CKEditor with Drupal WYSIWYG
- Captcha
- Cel
- Colorbox
- Content Construction Kit
- Content type
- Devel module for Drupal
- Drupal Rules as an automation language
- Drupal Spam add-on module
- Form alter to node
- IMCE
- IMCE Wysiwyg bridge
- ImageAPI
- Jdog
- Lightbox2
- Module variable
- Node Gallery Access
- Node_Gallery
- Path
- Path redirect
- Pathauto
- Pet
- Search
- Service links
- Session Variable
- Statistics
- Taxonomy
- Token
- Token ex
- Transliteration
- Trigger
- Watch
- Other modules
- Drupal Training
- Drupal access controls need a major rewrite
- Drupal coding tricks
- Drupal performance
- Drupal themes for the future
- Drupal.org colours
- Import existing data into Drupal
- Multiple Web sites made easy using Drupal multisite and the right start
- drupal_lookup_path()
- Adobe PDF
- Apache
- Apache Mahout
- Audi.com
- Bleet
- CSS Strikes Again
- CSS or xCSS
- Can you believe Facebook or email?
- Content Management Systems
- Databases
- Facebook scam
- Font
- Fonts
- HTML
- Install Apache, MySQL, and PHP 5 in Ubuntu 11.4 using the Ubuntu Software Centre
- Language Codes
- Marketing
- Memcache
- Nginx
- Open source development hits another roadblock
- Oscars
- PHP
- SPDY
- Search software
- Techoni.com.au
- Theme themes
- Things to hate on Web sites
- U.S. Patent No. 6,985,875
- Virtual Private Server
- Visible Improvement
- Web 4.0
- Web browser usage
- Web browsers
- Web site development
- Bluefish
- Crying over spilt code
- Eclipse and PHP
- Getting a Git client, a story of ancient technology and pain
- HTTrack
- MVC
- Netbeans
- PHP or ..., CakePHP/Symfony/ZF versus ...
- Programming
- Superfish
- Web browser emulators for testing your Web site
- Web development frameworks
- Web site books
- Web site development on your own computer
- Webmin or phpMyAdmin or cPanel for creating databases?
- aiki framework
- jQuery
- Views development - Learn Fields first
- Views development - Learn Actions and Rules
- jQuery .each()
- jQuery .has()
- jQuery .is()
- jQuery and Firefox Firebug
- jQuery children
- jQuery for people not using Drupal - Installation and getting started
- jQuery hover
- jQuery hover de-duplication example
- jQuery or CSS?
- jQuery performance
- jQuery tests
- Web site hosting
- Westpac Web site still broken after two years and ten months
- Wordpress wins another CMS survey
- Drupal
10 ways to improve your Web server for better Drupal performance
Submitted by Peter on Mon, 2010-12-06 13:24
10 improvements and 10 time wasters. Will take some time to transfer my notes from testing logs.
10 improvements
1. Switch from shared hosting to a VPS
There is almost nothing you can do to improve performance on shared Web site hosting because there is very little you can control and any change you make for your site can be buried in the workload created by other sites.
A VPS gives you more control because you have your own mini server within a virtual server. You can make most of the changes mentioned on this page when you upgrade to a VPS. Some changes might be easier when you expand to a dedicated server.
Most VPS installations start with a Linux installation then the Virtual Server software runs under Linux and your VPS runs under the VM software. You get whatever Linux is used for the server. The hosting company should update their Linux with the latest security patches and those updates should flow through to your Linux. Everything else should be under your control.
The commercial WHM/cPanel and the open source Webmin/Usermin/Virtualmin families are the two main choices for software to manage a VPS. You can make many changes within the administration pages provided by those families of software.
2. Switch on APC
A PHP opcode cache is the best way to speed up PHP. See PHP performance. You can easily switch one on using cPanel and equivalents. Your Web hosting supplier should offer to switch it on if they installed PHP. Some bare metal hosting does not have PHP or anything installed and your first step is to install Webmin then Apache/MySQL/PHP then switch on the right options for PHP, including an opcode cache.
3. Choose the right hosting provider
Some Web hosting providers overload their servers to squeeze out some extra profit. Some do not help you with configuration or finding bottlenecks. The difference between a good service provider and a bad one can be as little as $10 per month. The good service might handle twice as many users before you have to upgrade to a larger account, saving you more than you spend on the better service.
4. Switch on Apache compression
Drupal can compress Web pages if Apache, or your choice of Web server, does not compress pages. Drupal cannot compress things outside the pages delivered by Drupal. your Web server can compress everything that will benefit from compression. Switch on compression in your Web server and switch off page compression in Drupal.
5. Tune your database
Databases have an optimise function. It is usually run once when you first create a database but never again. Run optimise after you load in a lot of data. You might start with one optimise per week then move to once per month.
The next step is to look through common database accesses and make sure those accesses use suitable indexes. I can do this by hand based on extensive experience. There are tools to help you and they vary by database. The free open source databases usually have cryptic reports you can run by hand then the commercial analysis tools simply run the free reports and reformat the reports for readability.
There are programs to perform more extensive and complex investigations but they typically look at stuff you only need to change when you have giant databases spread over many servers. Your Web site hosting company will help you with the basics and they will stop you docing anything radical that might damage performance, reliability, or security for their other customers.
6. Transfer the contents of .htaccess files to the Apache .conf file
Apache has several configuration files linked together. The main one is httpd.conf and that includes Web site configurations from httpd-vhosts.conf. httpd-vhosts.conf is read once when Apache starts up. .htaccess files are read for every page request. You save file reads by removing the .htaccess files.
Some Drupal modules install special .htaccess files in some directories and you have to do something to remove those modules or modify those modules to not use .htaccess files. You can also set up special directory level definitions in httpd.conf.
Ignore those silly Web pages that talk about hybrid schemes where you move some settings out of some .htaccess files but not the whole file. The authors clearly have never worked on Apache. do not know the power of the httpd.conf file, and have never measured the impact of altering .htaccess files.
9. Use a local hosting service
Use a hosting service with a data centre local to your customers. They will get better response times for page accesses. Analyse the geographic locations of your customers or users. Try for the best response for the most users during the peak workload.
10. Content Delivery Network
A CDN, Content Delivery Network, is expensive and is one way to offload delivery of videos, if you have a lot of videos on your Web site. When you have to deliver large files, you set up a server in each of your major use areas. Think of a Web site with a big following in Germany, California, and Tasmania. You set up one server in Berlin, one in Los Angeles, and one in Hobart. You replicate the large files to all three servers. Easy. Now think of the same site serving 80 countries. Passing the video to an external service could be easier than setting up you own servers and might be cheaper than hiring someone to manage the capacity of each server.
The last time I looked at a CDN for a major project, the main CDNs were mainly USA based and charged a lot of money to deliver content from USA, a place where servers were, at the time, relatively cheap. None of the CDNs matched the usage pattern required for that project. Some of the CDNs are now in more countries. Check carefully exactly which countries they service from local servers and the response time in those countries where you need good service.
If you do not get the right match, the CDNs create almost as many problems as they solve. Usage reporting can be a problem. Watch out for sudden cost overruns. They may not charge the same rate in every country and your service may not cover the cost in some countries.
If your site is popular, photographs and other small files are often cached in all the reverse proxy servers around the world. Videos and Linux distribution CD images are too big to be cached. Linux distribution CDs are already replicated to mirror servers all around the world. That leaves videos as the big market and training videos, with a reasonable fee attached, are profitable enough to pay for the use of a CDN.
10 this should already be done items
1. Serve through a Reverse Proxy server
Reverse proxy servers are everywhere on the Web. They service static pages from a local cache in memory or on disk. Your Web browser contains something similar and stores a local copy of each Web page, CSS file, image, and Javascript file to save the overhead of rereading the data across the Internet. Little records, called HTTP headers, tell the cache to save the page for a minute or a day. The whole process is repeated throughout the Web.
Your ISP uses a giant cache to reduce expensive downloads from the Web. When you access a Web site, you often see a local copy of content unless the Web site uses incorrect HTTP header settings. If you set the right HTTP headers in Drupal, your Web pages, CSS files, Images, and other downloads should be cached for most anonymous users.
Pressflow, Mercury, Pantheon and other magic performance packages
often achieve much of their effect purely by changing the default settings for HTTP headers.
2. Use Memcache
When you access a Web page, the contents might be cached in your Web browser. If not, they might be cached in your ISP's reverse proxy server. If not, Drupal might cache the content. Whatever Drupal decides to do, if the page makes a database request, the request will be cached in the database. Why would you want to add another cache?
If you use a Web hosting service where you cannot control every detail and you pay a lot of money for the service, you could end up with more memory than you use. Some of that memory can be used to cache parts of your Web site in place of things you cannot control.
If your Web hosting service provider does not offer a reverse proxy server, you can use memcache to provide a similar service. That is the main readon I put Memcache after the proxy service option. investigate proxy servers first.
Memcache can cache other things including things that could be cached by the operating system, the Web server, and the database if they had enough memory. Tune their settings first to make maximum use of those features. You can control those other items on dedicated servers and many Virtual Private Servers but not shared hosting. Memcache does not work on shared hosting, almost nothing works on shared hosting, so switch from shared hosting to a VPS.
3. Tune your Web server
A good Web hosting supplier will recommend Web server software and tune the software. Some of the lesser hosting companies throw all sorts of hosting workloads on one server in the hope that they will balance out. The better ones place similar size accounts on the same server and occasionally move sites around to balance out workloads from different time zones. They set Apache, or their recommended Web server software, to the right settings for an account.
Some articles tell you to tune Apache yourself. The say things like a simple calculation
then hit you with (total memory - OS memory - MySQL memory) / size of an Apache process. Yeah easy to read but where do you get the information. Your hosting account provides the total memory. Your Web hosting provider can find the others. When you ask them to point you to the other figures, tell them what you are interested in achieving and ask them for a recommendation. A good Web hosting provider will have the main Apache settings preset to close to the right values for the type of account you purchased.
4. Switch from MySQL to InnoDB
Hard to place this here or in time wasters. InnoDB is an alternative to MySQL, performs a little bit faster some of the time and slower other times, with MySQL being the best performer in most cases. Pressflow is a version of Drupal with a lot of database requests changed to make better use of InnotDB, making InnoDB the slightly better performer for Pressflow. Drupal 7 uses InnoDB and the Pressflow style improvements, making InnoDB one of those things that should be done for you by the conversion to Drupal 7.
If your Web site software does not specify a specific database, your Web site hosting supplier might provide one preconfigured. Let them do it for you and use whatever they provide. They can then put in all the work to tune the database.
I prefer PostgreSQL to InnoDB and Drupal 7 will support PostgreSQL. PostgreSQL also supports great features for really big databases. During the life of Drupal 7, I will switch some of my biggest sites to PostgreSQL. I will look for a Web hosting service with experience in providing PostgreSQL and use whatever tuning settings they recommend.
If you switch databases without experience or support, the results will be the same or worse. With drupal 7 so close, go with the flow, leave your database alone and use whatever the Drupal 7 conversion produces.
10 might be useful for really big sites
1. Apache Solr
Apache Solr is a replacement for the Drupal search facility. Solr runs as a separate service hopefully on a separate server because it uses Java and does not fit in with a Web server tuned for Drupal. If you use a VPS, you could use a different VPS for Solr.
There is nothing in Solr that could not be added to Drupal or any other content management system. The first part of the speed improvement from Solr is the simple act of splitting part of your Web workload off to another server. You could achieve the same improvement for your existing Web site by using a faster server or more memory or moving the database to another server or by moving the search database tables to a database on another server.
The second part of the speed improvement is the big investment in developing Solr, far more than was invested into the search facility for Drupal.
You then get a bit of an improvement from something with the fancy title of faceted search
. All it means is you can search the results of a search instead of searching the whole database. Sub searches create as many problems as they solve because many people do not understand what is happening. You need a really good user interface to keep people informed of what is happening.
A good subsearch goes something like this. I want a taxi. I search for taxi. Bloat search says their are 70 million results and you have to think some more about your search. A good search would understand the use of taxies and would ask if you would like a taxi in your city. You are now searching just one city. The search can get really tricky when you have several options set to limit the search but cannot see why there are so many results missing. In the taxi example, a selection of Sydney as the city might produce the whole of Sydney or just the central business district.
There are sites where you can add extra selection criteria but you cannot step back one level, instead you have to restart the whole search. There are a few other problems with subsearch user interfaces. When I first tried to use Solr based searches, the user interfaces made the searches difficult.
Solr makes some searches faster because you are allocating extra hardware resources and money that might be better spent in other areas. The best feature of Solr depends on a really good user interface with means you need to invest time and research into making the best use of Solr to give your users a real benefit.
10 time wasters
These are thinks recommended by a lot of people but you rarely see them recommended from personal experience, it is almost always just something they read somewhere then put in a Web page do they could publish a 10 things list.
1. SSD
SSD is Solid State Disk. The best SSDs are faster than conventional magnetic disks. See Best SSD for your notebook computer. The average SSD is slower than using magnetic disks in a RAID 5 array. Dollar for dollar, SSDs are small compared to magnetic disks and may be too small for your Web site.
Your Web site hosting supplier will suggest a range of storage options including faster disks and RAID. They might offer SSD as a very expensive option and in most cases, the RAID option is the best option. Many SSDs advertise a fast peak performance for specific types of read operations and hide their slow performance at everything else including terrible write speeds. RAID does not suffer that performance difference. You have to spend really big dollars to get fast write performance from SSD for a Web server and those big dollars produce far more speed when spent on extra memory, RAID, and other options.
If you build your own Web servers and you have your servers already at maximum memory and your boss says you cannot buy another server but you can spend money on disks, look at some of the better SSDs for use with selected files. In a server starved of memory, you might put page files on SSD. In a server with a highly optimised database and still of limited performance, you might put the database indexes on an SSD or the whole database on SSD. Use two SSDs in a RAID 1 configuration or three SSDs in RAID 5. Pay the extra money for SSDs with good write performance.








