From LifeType Wiki
This page is a list of items that can be tuned at different levels to make LifeType 1.1 perform better, even though most of the items here are common sense. This page is a constant work in progress so please feel free to contribute.
Contents |
[edit] LifeType
[edit] Template caching
- Make sure the template_cache_enabled is enabled.
- Make sure that template_http_cache is enabled.
[edit] PHP
Usage of a PHP accelerator is recommended. There are several sites running LifeType and eAccelerator and the results have been so far very good.
You might experience some crashes with the default configuration of eAccelerator, but the following settings are known to work:
eaccelerator.shm_size = "0" eaccelerator.cache_dir = "/tmp/eaccelerator" eaccelerator.enable = "1" eaccelerator.optimizer = "1" eaccelerator.debug = "0" eaccelerator.log_file = "/var/log/apache/eaccelerator_log" eaccelerator.name_space = "" eaccelerator.check_mtime = "1" eaccelerator.filter = "" eaccelerator.shm_max = "0" eaccelerator.shm_ttl = "0" eaccelerator.shm_prune_period = "0" eaccelerator.shm_only = "0" eaccelerator.compress = "1" eaccelerator.compress_level = "9" eaccelerator.keys = "shm_and_disk" eaccelerator.sessions = "shm_and_disk" eaccelerator.content = "shm_and_disk"
[edit] Apache
- Enable gzip compression to save bandwidth. An average page generated by summary.php can weight somewhere between 30kb and 50kb.
From http://www.onlamp.com/pub/a/onlamp/2004/02/05/lamp_tuning.html:
- KeepAlive should be set to 1 or 2.
- MaxRequestsPerChild should be set to 20. PHP leaks memory and it's not good to have Apache processes leaking memory around for too long, their memory should be freed and reclaimed.
From http://phplens.com/phpeverywhere/tuning-apache-php:
- AllowOverride should be set to "none", and all your .htaccess files should be rolled into the main httpd.conf.
[edit] Linux
- Make sure that your disk(s) are configured to their maximum speed with hdparm.
- Ext3 is quite slow when dealing with folders with thousands of small files. Lifetype's tmp/ folder tends to grow quite big with lots and lots of small files (compiled templates from blogs), so its speed should be optimized. ReiserFS performs a bit better with small files (LT's tmp/ folder could be mounted from another partition) or consider creating a cron script to reset the contents of the tmp/ folder every 6 or 12 hours to prevent it from growing too big. (question from jondaley - this sounds like a bad idea to me. It can't really be faster to regenerate the cache (write a new file and then read it again) than just to use the cache files that are already there, right??)
- There's also lots of documentation in the net about how to tune Linux for best performance when serving dynamic applications via PHP and Apache.
[edit] MySQL
[edit] Query cache
The query cache is disabled by default in MySQL and enabling it might help increase the performance of the database server.
There is more information about the query cache here:
http://dev.mysql.com/tech-resources/articles/mysql-query-cache.html
[edit] InnoDB tables
Some tables will benefit if they are converted to InnoDB instead of MyISAM. InnoDB provides row-level locking instead of table-locking which should improve performace in those tables that get a lot of INSERT and SELECT statements at the same time. The tradeoff is that InnoDB is slightly slower than MyISAM for SELECT operations.
[edit] Other
- Run ANALYZE TABLE on your tables every now and then.
[edit] Environment
[edit] Hosting
Get dedicated hosting if possible, with your own server(s), do not expect to create a big community with over 10000 members from a cheapo hosting solution. LifeType can get pretty resource intensive and your account will probably be cancelled.
Separated web server and database servers, load balancers, replicated MySQL instances are *not* out of the questions when considering the architecture of big sites!
[edit] Hardware
The most common layout for web applications consists of one database server and one web/application server, connected to each other via a high speed connection (1Gbps at least) If you can afford this configuration, do not hesitate.
