2010-05-05 16:25:07 +00:00
|
|
|
module Apache
|
2010-05-10 19:57:34 +00:00
|
|
|
# Options to adjust server performance beyond MPM settings
|
2010-05-05 16:25:07 +00:00
|
|
|
module Performance
|
2010-05-10 19:57:34 +00:00
|
|
|
# Activate KeepAlive, optionally tweaking max requests and timeout
|
|
|
|
#
|
|
|
|
# activate_keepalive :requests => 100, :timeout => 5 #=>
|
|
|
|
# KeepAlive on
|
|
|
|
# MaxKeepAliveRequests 100
|
|
|
|
# KeepAliveTimeout 5
|
2010-05-05 16:25:07 +00:00
|
|
|
def activate_keepalive(options)
|
|
|
|
self << "KeepAlive On"
|
|
|
|
options.each do |option, value|
|
|
|
|
case option
|
|
|
|
when :requests
|
|
|
|
self << "MaxKeepAliveRequests #{value}"
|
|
|
|
when :timeout
|
|
|
|
self << "KeepAliveTimeout #{value}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|