From f1fc55736be7fe2901fbddf4d6916809a137ba95 Mon Sep 17 00:00:00 2001 From: Silke Meyer Date: Sat, 18 Apr 2015 18:39:16 +0200 Subject: [PATCH] Reformatting and minor changes to content --- doc/Improve-Performance.md | 80 +++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 45 deletions(-) diff --git a/doc/Improve-Performance.md b/doc/Improve-Performance.md index d4c94d2d11..ced5901228 100644 --- a/doc/Improve-Performance.md +++ b/doc/Improve-Performance.md @@ -1,13 +1,9 @@ -How to: improve performance +How to improve the performance of a Friendica site ============== * [Home](help) -A little guide to increase the performance of a Friendica site - -**At first** - -Feel free to ask at Friendica support at https://helpers.pyxis.uberspace.de/profile/helpers if you need some clarification about the following instructions or if you need help in any other way. +Feel free to ask in the [Friendica support forum](https://helpers.pyxis.uberspace.de/profile/helpers) if you need some clarification about the following instructions or if you need help in any other way. System configuration -------- @@ -26,9 +22,11 @@ If you have many OStatus contacts then completing of conversations can be very t Lock files help avoid the possibility of several background processes running at the same time. -For example: It can happen that the poller.php takes longer than expected. When there is no lock file, it is possible for several instances of poller.php to run at the same time - which would slow down the system and affect the maximum numbers of processes and database connections. +For example: It can happen that the poller.php takes longer than expected. +When there is no lock file, it is possible for several instances of poller.php to run at the same time - which would slow down the system and affect the maximum numbers of processes and database connections. -Please define a full file path that is writeable by the web server process. If your site is located at "/var/www/sitename/htdocs/" you could maybe create a folder "/var/www/sitename/temp/". +Please define a full file path that is writeable by the web server process. +If your site is located at "/var/www/sitename/htdocs/" you could maybe create a folder "/var/www/sitename/temp/". Enable "Use MySQL full text engine" @@ -36,20 +34,17 @@ When using MyISAM (default) this speeds up search. Set "Path to item cache" to an empty value outside your web root. -Parsed BBCode and some external images will be put there. Parsing BBCode is a time wasting process that also makes heave use of the CPU. - +Parsed BBCode and some external images will be put there. +Parsing BBCode is a time wasting process that also makes heave use of the CPU. You can use the same folder you used for the lock file. **Warning!** -The folder for item cache is cleaned up regularly. Every file that exceeds the cache duration is deleted. **If you accidentally point the cache path to your web root then you will delete your web root!** - +The folder for item cache is cleaned up regularly. +Every file that exceeds the cache duration is deleted. **If you accidentally point the cache path to your web root then you will delete your web root!** So double check that the folder only contains temporary content that can be deleted at any time. - You have been warned. -P.S. It happened to me :) - Plugins -------- @@ -61,20 +56,18 @@ Active the following plugins: ###Alternate Pagination - -**Description** - -This plugin reduces the database load massively. Downside: You can't see the total number of pages available at each module, and have this replaced with "older" and "newer" links. - -**Administration** +This plugin reduces the database load massively. +Downside: You can't see the total number of pages available at each module, and have this replaced with "older" and "newer" links. Go to the admin settings of "altpager" and set it to "global". ###rendertime -This plugin doesn't speed up your system. It helps analyzing your bottlenecks. +This plugin doesn't speed up your system. +It helps to analyze your bottlenecks. -When enabled you see some values like the following at the bottom of every page: +When enabled you see some values at the bottom of every page. +They show your performance problems. Performance: Database: 0.244, Network: 0.002, Rendering: 0.044, Parser: 0.001, I/O: 0.021, Other: 0.237, Total: 0.548 @@ -86,50 +79,47 @@ When enabled you see some values like the following at the bottom of every page: Others: Everything else :) Total: The sum of all above values -These values show your performance problems. - -Webserver +Apache Webserver -------- -If you are using Apache please enable the following modules. +The following Apache modules are recommended: -**Cache-Control** +###Cache-Control This module tells the client to cache the content of static files so that they aren't fetched with every request. - Enable the module "mod_expires" by typing in "a2enmod expires" as root. - Please add the following lines to your site configuration in the "directory" context. -ExpiresActive on ExpiresDefault "access plus 1 week" + ExpiresActive on ExpiresDefault "access plus 1 week" -See also: http://httpd.apache.org/docs/2.2/mod/mod_expires.html +Also see the Apache [2.2](http://httpd.apache.org/docs/2.2/mod/mod_expires.html) / [2.4](https://httpd.apache.org/docs/2.4/mod/mod_expires.html) documentation. -**Compress content** +###Compress content This module compresses the traffic between the web server and the client. - Enable the module "mod_deflate" by typing in "a2enmod deflate" as root. -See also: http://httpd.apache.org/docs/2.2/mod/mod_deflate.html +Also see the Apache [2.2](http://httpd.apache.org/docs/2.2/mod/mod_deflate.html) / [2.4](https://httpd.apache.org/docs/2.4/mod/mod_deflate.html) documentation. PHP -------- -**FCGI** - -When using apache think about using FCGI. When using a Debian based distribution you will need the packages named "php5-cgi" and "libapache2-mod-fcgid". +###FCGI -Please refer to external documentations for a more detailed explanation how to set up a system based upon FCGI. +When using Apache think about using FCGI. +In a Debian-based distribution you will need to install the packages named "php5-cgi" and "libapache2-mod-fcgid". -**APC** +Please refer to external documentation for a more detailed explanation how to set up a system based upon FCGI. -APC is an opcode cache. It speeds up the processing of PHP code. +###APC -When APC is enabled, Friendica uses it to store configuration data between different requests. This helps speeding up the page creation time. +APC is an opcode cache. +It speeds up the processing of PHP code. +When APC is enabled, Friendica uses it to store configuration data between different requests. +This helps speeding up the page creation time. -**Database** +###Database -There are scripts like [tuning-primer.sh](http://www.day32.com/MySQL/) and [mysqltuner.pl](http://mysqltuner.pl) that analyzes your database server and give hints on values that could be changed. +There are scripts like [tuning-primer.sh](http://www.day32.com/MySQL/) and [mysqltuner.pl](http://mysqltuner.pl) that analyze your database server and give hints on values that could be changed. -Please enable the slow query log. This helps being aware of performance problems. +Please enable the slow query log. This helps to find performance problems. -- 2.39.5