Tune apache for etherpad lite.

* modules/etherpad_lite/manifests/apache.pp: Install apache etherpad
lite connection tuning config file.

* modules/etherpad_lite/files/apache-connection-tuning: Configure the
Apache MPM Worker module to run up to 64 processes with 32 threads each
for a grand total of 2048 client connections maximum. This should be
relatively safe as etherpad connections are not very heavy. Most
connections come from users that lurk, they don't provide any input
that creates writes to the database. For example at a design summit we
may have 8 design room seach with an etherpad open, in each room there
may be 20 people connected to the etherpad but only 2-4 writing to it.

Change-Id: I3f406af1204b993d2b083180f17cafcf4f62f5bc
This commit is contained in:
Clark Boylan 2013-10-09 10:58:32 -07:00
parent 88bb5cd21c
commit a2a3d04b32
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,29 @@
# worker MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
# graceful restart. ThreadLimit can only be changed by stopping
# and starting Apache.
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
#
# Etherpad Lite clients create a lot of connections. To be able to support
# Several hundred concurrent users we need to make sure that we allow a few
# thousand concurrent connections. This should be ok as typical etherpad use
# involves a couple writers then a bunch of lurkers. The cost of lurkers
# is basically the TCP connection as they don't create DB writes and so on.
# In addition to allowing for connection growth, keep a healthy number of
# spare threads around to better handle thundering herds of users (eg at the
# start of summit sessions).
<IfModule mpm_worker_module>
ServerLimit 64
StartServers 3
MinSpareThreads 96
MaxSpareThreads 192
ThreadLimit 64
ThreadsPerChild 32
MaxClients 2048
MaxRequestsPerChild 0
</IfModule>

View File

@ -14,6 +14,7 @@ class etherpad_lite::apache (
ensure => present,
}
include apache
apache::vhost { $vhost_name:
port => 443,
docroot => 'MEANINGLESS ARGUMENT',
@ -30,6 +31,14 @@ class etherpad_lite::apache (
a2mod { 'proxy_http':
ensure => present,
}
file { '/etc/apache2/conf.d/connection-tuning':
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/etherpad_lite/apache-connection-tuning',
notify => Service['httpd'],
}
file { '/etc/ssl/certs':
ensure => directory,