Recommendations for Performance Tuning and Resource Planning for CRM Hosted on LAMP/WAMP

  • Updated

(Applies to Riva Cloud and Riva On-Premise.)

Performance is always a concern. Sugar is highly scalable. When planning for system resources, some key aspects must be taken into account.

Always follow the performance tuning recommendations for a Sugar server installation.


Adjust the maximum number of worker processes to match the amount of memory available on the server.

Use the following formula as a guide:

(Total Memory - Operating System Memory - MySQL memory) / Size Per Apache process == number of max worker processes

Example for a server with 2 GB of memory:

2,048 - (server used memory on fresh reboot) - (MySQL allocated memory) = available memory

Assuming that you are running Apache on Linux, you can use top to identify how much memory a single Apache worker process is taking while idle. This depends on the number of modules loaded.

If you do not use all the modules loaded by default, consider dropping unused modules to reduce the memory overhead for each process.

Based on the remaining available memory, limit the number of worker processes.

Example CRM environment


Because each Apache process uses about 20 MB, 25 max worker processes could use up to 500 MB, which means you would want to have at least 750 MB available for Apache.


Check the mysqld process: it could be at about 250 MB. Among other settings, it is affected by the Query Cache Size set for your query caching.

You can check the size by issuing this query:

SHOW VARIABLES LIKE "query_cache%"; 

Note: Also follow other mysql performance tuning instructions to ensure performant queries.

Operating system

Depending on the other processes running on the server like cups, samba, etc., you might need another 1 GB just for the operating system.

Running total

Based on the above considerations, we have identified that the server would need to have a minimum of 2 GB just to run at an average load.

Preventing I/O thrashing

In order to avoid excessive I/O thrashing (memory being paged / swap usage), ensure that the system never pages or swaps, so that 2.5 GB should be sufficient.

If you leave the number of Apache max worker processes unchecked, then when many active connections open, performance and response time will degrade.

Was this article helpful?




Article is closed for comments.