Category:Database Category:Tips
Note - this article discusses working with a dedicated Unix or Linux server, although many of the tips will also work with shared services and Windows.
Make certain you read the article: Optimize EE
Content Management Systems such as EE put substantially more load on a server than static HTML pages. This is due mostly to the heavy use of the MySql (database) and PHP page parsing. The actual server load will usually show up as two processes - that of Apache web serving software (httpd) and that of MySql (mysqld). The idea of server tuning is to give these two processes as much memory and CPU cycles as possible.
Note: Enclosed screen shot shows a typical load with numerous httpd requests and one very long mysql process.
Before tuning these two pieces of software, you can try to offload other large server processes which are not needed. In many cases, this will including logging - for instance, if you use Google Analytics there is no need to also use internal Apache logging. Mail (smtp) service can also be offloaded, as the amount of Spam on the internet tend to clog up servers with mail relays. Your ISP will often agree to host your POP email on one of their more secure servers.
Also, ALWAYS install the max. RAM that you can in your server. RAM is inexpensive and having plenty of memory allows for your server to operate much quicker than if it swaps to disk - which is what it does when RAM is short.
Tuning Apache and PHP
There are a number of articles throughout the web on tuning these applications to work together. The basics are this:
1. Use the latest stable release or a release which is known to be fast - your ISP or admin should know more.
2. Give PHP and Apache plenty of room to move - Apache has config settings which allow you to specify the number of “children” which the application can spawn. Each of these children handle on httpd request. Depending on your RAM, a server could easily allow the stock settings on the Maxclients and other relevant configs to be increased.
3. Use a PHP enhancer such as eAccelerator, APC, xCache or Turck MMCache, or a memory caching system such as memcached.
Tuning MySql
1. Make certain you are using a relatively up-to-date version of the MySql application. Many speed improvements have been made.
2. RAM, once again, if very important. However MySQL may not use your RAM to its’ fullest extent unless you properly set the parameters in the MySql config file. There are a couple utilites available which will look at your db use and suggest the proper settings:
http://www.day32.com/MySQL/
http://blog.mysqltuner.com/
3. Optimize the tables in MySql occasionally, using the EE Utilities control panel
Note that the writers of the EE software continually improve the efficiency of the application and the db calls, so much optimizing is attained in this fashion.
What type of traffic can a single server handle with EE?
This is probably an open question since very few installations seem to have hit the ceiling yet. My experience (2008) with a Linux dedicated box (dual-core 3.0 Intel) shows that EE easily handles 100,000 plus pages per day with little or no hesitation. In my case, this equates to about 18,000 visitors in a 24 hour period, and 10+ Gigabytes of data being sent from the server. My guess is that, given some basic tune-ups, the server can handle about 50% more load without the resulting lack of responsiveness becoming frustrating to the average user. Faster processors or more cores may help, but disk access and other I/O can tend to bogg down a single server no matter what the horsepower.
Web publishers anticipating larger loads than 25-30K visitors per day should probably design systems which use 2 or more servers, and dedicate one to the MySql application. It should be noted that only a few thousand non-adult web sites in the entire world see this type of regular traffic, so this would be a very rare case.
Screen shot of typical processes below
