Tuning Apache-PHP-MySQL for speed [closed]

By | December 15, 2017
Questions:

I have leased VPS with 2GB mem.

Problem i have is that i have few joomla installations and server get in to very slow response if there is more than 30-50 users attached at same time.

Do you have any tips, books/tutorials/suggestions how to increase response time in this situation?

Pls. give me only very concrete and useful URLs, i would be very grateful.

In attachment i attached just part of htop view on that VPS

enter image description here

Answers:

The easiest and cheapest thing you can do is to install a bytecode cache, e.g. APC. Thus, php does not need to process every file again and again.

If you’re on Debian or Ubuntu this is as easy as apt-get install apc.

Questions:
Answers:

I’m going to guess that most of our issues will come from joomla – I’d start by looking through this list: https://stackoverflow.com/search?q=joomla+performance

Other than that, you might want to investigate a php accelerator: http://en.wikipedia.org/wiki/List_of_PHP_accelerators

If you have any custom sql, you might want to check your sql queries are making good use
of indexes

A quick look at your config suggests your using apache pre fork – you might want to try
using threaded worker mode, though always benchmark each config change you make (apache
comes with a benchmarking tool) to ensure any changes have a positive effect.

Some other links..

http://www.brandonturner.net/blog/2009/07/fastcgi_with_php_opcode_cache/

Though this is for wordpress, the principals should still apply.
http://blog.mydream.com.hk/howto/linux/performance-tuning-on-apache-php-mysql-wordpress

A couple of things to pay close attention to.

  1. You never want your server to run out of memory. Ensure any apache config limits the
    number of children to within your available memory.

  2. Doing SHOW PROCESSLIST on mysql and looking for long running queries can highlight some
    easy wins, as nothing kills performance like a slow sql query.

Leave a Reply

Your email address will not be published. Required fields are marked *