[TYPO3-UG US] Load Balancing - Knowledge Base
Floyd Arguello
floyd at icommnetwork.com
Sat Dec 17 02:38:23 CET 2005
Just wanted some feedback on this item I wrote for the knowledge base...
I assumed that 'load balancing' applied to TYPO3 site optimization, so I
threw in some things I knew or found on the web.
--------------
Typically, Load Balancing distributes a common workload among multiple
machines, but the term is difficult to define more specifically in a Web
context. Load Balancing as it applies to your TYPO3 site basically means
optimizing your site/server to handle as many visitors as efficiently as
possible.
The quality of services that a web server provides to end users
typically depends on network-transfer speed and server-response time.
Network-transfer speed mainly depends on your Internet-link bandwidth,
while server-response time depends on your server resources: CPU speed,
RAM, and good I/O performance.
Your network-transfer speed is limited by the bandwidth provided by your
web host, not to mention the bandwidth provided to your users through
their ISP. However, there are things that you can do to optimize your
bandwidth; mainly, mod_gzip.
Your server-response time is limited by your server's resources:
CPU Speed: important for CGI programs
RAM: simply put, the more RAM you have, the more processes your server
can run.
I/O performance: Disk and network traffic
There are several things you can do to optimize your site:
Apache configuration: pay attention to KeepAlive, KeepAlive Timeout, and
MaxClients.
MySQL optimization: most MySQL optimization is done from the SQL side
and not the MySQL side, but there are things you can do to optimize the
MySQL server. A simple and effective technique is to enable your query
cache and set it to a proper size.
Server Applications: what other programs are running on your server? Is
your email server running on the same machine as your web server?
Optimize it. Are you using Sendmail and Procmail? Scrap Procmail and use
Sendmail as your Local Delivery Agent. Are you running Spamassassin and
ClamAV? Are your users POP'ing their accounts every 10 seconds? How many
processes does that one user generate every 10 seconds? The point is,
each additional server application utilizes resources, processes in
particular. The more available processes, the more visitors you can
handle. So it may pay off to analyze the programs running on your server
and either optimize them or find alternative solutions.
PHP Caching: There are several programs available to speed up PHP
generation: ZendOptimizer, PHP-Accelerator, and Turck MM Cache to name a
few.
Source Code Optimization: Your HTML code has to be generated by TYPO3
and rendered in a web browser, so it makes sense to use efficient and
clean code. For example, use CSS instead of font tags; and place your
CSS in an external stylesheet instead of defining it in your <Head>.
What if you've optimized your site and server, and are still running out
of resources and struggling against heavy traffic? Install more RAM, get
a faster CPU, better disks, etc. Or you can improve performance by
increasing the number of web servers.
More information about the TYPO3-UG-US
mailing list