Skip to content

Commit 7bc1d32

Browse files
authored
Merge pull request #115 from ruby/drop-hourly-apache-restart
Stop the hourly apache2 restart and raise MaxRequestWorkers
2 parents b7a2392 + 404ff25 commit 7bc1d32

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

recipes/apache2.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@
3333
to '../conf-available/cgit.conf'
3434
end
3535

36+
remote_file '/etc/apache2/conf-available/mpm-tuning.conf' do
37+
mode '644'
38+
owner 'root'
39+
notifies :restart, 'service[apache2]'
40+
end
41+
42+
link '/etc/apache2/conf-enabled/mpm-tuning.conf' do
43+
to '../conf-available/mpm-tuning.conf'
44+
notifies :restart, 'service[apache2]'
45+
end
46+
3647
%w[git svn].each do |subdomain|
3748
remote_file "/etc/apache2/sites-available/#{subdomain}.ruby-lang.org.conf" do
3849
mode '644'
@@ -76,3 +87,13 @@
7687
end
7788
end
7889
end
90+
91+
# root's crontab carried "20 * * * * systemctl restart apache2" from before
92+
# Anubis, outside this repository. It fixed nothing: children settle at 25 MB
93+
# and never leak. It caused harm instead. 57 of the 91 AH00484 (MaxRequestWorkers
94+
# exhausted) events in the last two weeks landed within eight minutes of it,
95+
# because the 63,000 requests an hour arriving at the front door all reconnect
96+
# at once against StartServers 2.
97+
file '/var/spool/cron/crontabs/root' do
98+
action :delete
99+
end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Overrides what mods-available/mpm_event.conf sets. That file is a dpkg
2+
# conffile, so it is left alone and this one wins by being included later.
3+
#
4+
# Browsing costs two workers rather than one: the front vhost proxies to Anubis
5+
# and Anubis proxies back into this same apache on port 3001. Debian's default
6+
# of 150 therefore caps concurrent browsing at 75, and AH00484 fires on bursts
7+
# even though steady state is 35 to 55 busy workers. 16 children of 25 threads
8+
# is the event MPM's own ServerLimit, and costs about 400 MB out of 7 GB.
9+
<IfModule mpm_event_module>
10+
ServerLimit 16
11+
MaxRequestWorkers 400
12+
</IfModule>

0 commit comments

Comments
 (0)