You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
You are viewing the article in preview mode. It is not live at the moment.
We are announcing the retirement of the Helpdesk Pilot on-premise Helpdesk. Support and update would be discontinued as of June 30, 2019. Existing customers can migrate to our cloud edition - HappyFox.com.
Home > How Tos > Helpdesk Pilot Tuning Apache
Helpdesk Pilot Tuning Apache
print icon
Notes

The below configuration options are meant for Apache 2.4.7 using mpm worker module
  • Check apache version: apachectl -v
  • Check which mpm module is used - apachectl -M | grep mpm
  • Please take a snapshot of the vm and a backup of the config files that are to be modified before making any changes
  • Please restart the Helpdesk Pilot application after making the changes to the config files.

Config changes wrt mpm_worker

File - /etc/apache2/mods-enabled/mpm_worker.conf

Definitions

Startservers
  • The initial number of processes created when starting the application.
  • The default value is 3

ServerLimit
  • The maximum number of processes that can be spawned.
  • This value is calculated as 2 x no of cpu cores - 1. For example, for system with 4 cpu cores the value will be 2 x 4 - 1 = 7 (recommend to keep this slightly lower that the calculated value such as 6 in this case).

ThreadsPerChild
  • The initial number of threads that is spawned for each process.
  • The default value is 25.
  • Increasing this value improves concurrency of the application but has increased memory footprint.

ThreadLimit
  • The maximum number of threads that can be spawned for each process
  • The default limit is 64
  • Example: If ServerLimit is 2 and ThreadLimit is 4, then the system can, at the maximum, serve 8 requests concurrently.

MinSpareThreads
  • The minimum number of spare threads that can be spawned to handle sudden spike in requests.
  • Setting this to a very low value will result in requests getting queued (and rejected if the queue limit is reached).
  • The default value is 75

MaxSpareThreads
  • The maximum number of spare threads that can be spawned to handle sudden spike in requests.
  • This should be greater than or equal to the sum of MinSpareThreads and ThreadsPerChild.

MaxRequestWorkers
  • Maximum number of requests that can be processed simultaneously.
  • The value of this setting is set lower than the product of the values of ServerLimit x ThreadsPerChild.

MaxConnectionsPerChild
  • Limit on the number of connections that a process will handle during its life.
  • The default is 0 (unlimited)
  • Setting MaxConnectionsPerChild to a non-zero value limits the amount of memory that process can consume by (accidental) memory leakage.
  • The worker will restart after the number of requests is reached, thereby clearing the memory consumed.
  • It is recommended to set this as 1000 ( or 500 based on monitoring the memory usage of a process). In this case the worker will restart automatically after serving 1000 requests.

FCGI config

File: /etc/apache2/sites-enabled/instance-hdp.conf
Scope: virtualhost

Definitions

FcgidBusyScanInterval
  • the interval at which fcgid scans busy process to identify if hung processes needs to be killed or new processes should be spawned.
  • By default this runs every 120 seconds (2 mins). The default is sufficient.

FcgidBusyTimeout
  • This specifies how long the fcgid busyness scanner should wait to determine that the current process is busy and spawn a new process to handle incoming requests.
  • The default setting is 300 seconds (5 mins)
  • If this value is increased, it will result fcgid taking a long time to decide that the current process is busy and to spawn a new process. Hence it is recommended that this setting be kept at default.

FcgidIOTimeout
  • The maximum time limit an fcgi server can wait for a request to complete.
  • The default value is 300 seconds (5 mins)
  • It is recommended that this setting be kept at default since if this is kept high, then long running threads will not be terminated resulting in other requests getting queued.

Processes related settings
  • FcgidMaxProcesses: maximum number of fcgi processes. Default value is 1000
  • FcgidMaxProcessesPerClass: maximum number of fcgi sub processes for each process. Default value is 0 (unlimited)
  • FcgidMinProcessesPerClass: minimum number of fcgi sub processes for each process. Default value is 3
  • FcgidMaxRequestsPerProcess: maximum number of requests handled by each process. Default value is 0 (unlimited)
  • FcgidProcessLifeTime: the maximum time that an fcgi process can be alive. After this time is reached, the process is recycled. Default value is 3600 seconds (1 hour)
  • It is recommended that the default values be kept as it is.

Other miscellaneous changes if needed

Limiting memory per process for apache using ulimit

This will limit the virtual memory that an apache process can consume.
  • Open /etc/default/apache2
  • Add ulimit -v [memory in kb] at the bottom of the file. For example, ulimit -v 2097152 for limiting apache to only use 2 gb of ram.
Feedback
0 out of 3 found this helpful

scroll to top icon