Article

  • 9 years

    3 years

    YetiShare / Core

    19029

Performance tuning your servers for YetiShare

Your server configuration can have a significant impact on the performance of YetiShare. Below are some of the server settings we'd recommend using. This page will be added to over time so it's not a definitive list. It assumes you have at least a VPS server with root access.

Apache

- Enable XSendFile to take load away from PHP - https://support.mfscripts.com/public/kb_view/1/

Nginx (recommended over Apache)

- Enable X-Accel-Redirect to take load away from PHP - https://support.mfscripts.com/public/kb_view/2/
- Additional advice on general Nginx performance tuning here: https://www.digitalocean.com/community/tutorials/h...
- Some Nginx security advice (note: not all tested): http://www.cyberciti.biz/tips/linux-unix-bsd-nginx...

- Amend /etc/nginx/nginx.conf
http { 
    #... 
    fastcgi_read_timeout 300;
    #... 
}
Restart Nginx after any changes.

PHP

- Amend the following values in your global php.ini file:

memory_limit = 512M
upload_max_filesize = 500M
post_max_size = 500M
max_execution_time = 180
max_input_time = 180
Restart your webserver to apply the changes.

PHP-FPM (if using Nginx)

- Amend /etc/php5/fpm/pool.d/www.conf

request_terminate_timeout = 300

pm = ondemand
pm.max_children = 75
pm.process_idle_timeout = 10s

 Source for max_children - http://myshell.co.uk/blog/2012/07/adjusting-child-processes-for-php-fpm-nginx/

PHP Fast CGI

- If you're using FastCGI with PHP/Apache ensure you allow for any timeouts on large downloads, by default they will close connections after 5 minutes so you may get partially completed downloads. In your Apache config file add the following:

<IfModule mod_fcgid.c>
FcgidBusyTimeout 43200
</IfModule>

If you're using WHM/cPanel you can add this to /usr/local/apache/conf/includes/post_virtualhost_global.conf

Save and restart Apache.

MySQL

1) Enable query cache.

Edit my.cnf file (sometimes in /etc/mysql/my.cnf)

nano /etc/my.cnf
Add or uncomment the following lines:

query_cache_size = 268435456
query_cache_type = 1
query_cache_limit = 1048576
2) Increase max connections in MySQL. In your my.cnf file, add or amend the following:

max_connections = 600

3) Increase timeouts in MySQL to allow longer for large uploads. In your my.cnf file, add or amend the following:

wait_timeout = 120
interactive_timeout = 120
Restart MySQL. (this command will be different depending on your OS)

service mysql restart
Save and restart MySQL. You may need to adjust this value depending on your traffic levels and server resources available.

CloudFlare

  • Use CloudFlare to reduce load, speed up website content to your users and protect against DOS attacks.
  • IMPORTANT - If using CloudFlare, ensure you have the following disabled (on the 'speed' tab), these are known to cause issues:
    • Rocketloader
    • Auto-minify Javascript

Useful Links