
Apache2's default value for KeepAliveTimeout is 5 seconds, which is okay for general web-page serving use cases. However, sessions and connection pools created by keystoneauth1.session.Session can be terminated unnecessarily during multiple API calls in a session due to the short KeepAliveTimeout. Let's ease KeepAliveTimeout to 75 seconds, which is fairly standard for API services behind a reverse proxy since it's the default value of nginx. Closes-Bug: #1947010 Change-Id: Iff24f0f4b35fcc239abc14f37a76dcad8380d785
107 lines
3.4 KiB
Plaintext
107 lines
3.4 KiB
Plaintext
# Configuration file maintained by Juju. Local changes may be overwritten.
|
|
|
|
{% if port -%}
|
|
Listen {{ port }}
|
|
{% endif -%}
|
|
|
|
{% if admin_port -%}
|
|
Listen {{ admin_port }}
|
|
{% endif -%}
|
|
|
|
{% if public_port -%}
|
|
Listen {{ public_port }}
|
|
{% endif -%}
|
|
|
|
{% if port -%}
|
|
<VirtualHost *:{{ port }}>
|
|
WSGIDaemonProcess {{ service_name }} processes={{ processes }} threads={{ threads }} user={{ service_name }} group={{ service_name }} \
|
|
display-name=%{GROUP} lang=C.UTF-8 locale=C.UTF-8
|
|
WSGIProcessGroup {{ service_name }}
|
|
WSGIScriptAlias /krb {{ script }}
|
|
WSGIScriptAlias / {{ script }}
|
|
WSGIApplicationGroup %{GLOBAL}
|
|
WSGIPassAuthorization On
|
|
KeepAliveTimeout 75
|
|
MaxKeepAliveRequests 1000
|
|
<IfVersion >= 2.4>
|
|
ErrorLogFormat "%{cu}t %M"
|
|
</IfVersion>
|
|
ErrorLog /var/log/apache2/{{ service_name }}_error.log
|
|
CustomLog /var/log/apache2/{{ service_name }}_access.log combined
|
|
|
|
<Directory /usr/bin>
|
|
<IfVersion >= 2.4>
|
|
Require all granted
|
|
</IfVersion>
|
|
<IfVersion < 2.4>
|
|
Order allow,deny
|
|
Allow from all
|
|
</IfVersion>
|
|
</Directory>
|
|
IncludeOptional /etc/apache2/mellon*/sp-location*.conf
|
|
IncludeOptional /etc/apache2/kerberos*/apache-kerberos.conf
|
|
</VirtualHost>
|
|
{% endif -%}
|
|
|
|
{% if admin_port -%}
|
|
<VirtualHost *:{{ admin_port }}>
|
|
WSGIDaemonProcess {{ service_name }}-admin processes={{ admin_processes }} threads={{ threads }} user={{ service_name }} group={{ service_name }} \
|
|
display-name=%{GROUP} lang=C.UTF-8 locale=C.UTF-8
|
|
WSGIProcessGroup {{ service_name }}-admin
|
|
WSGIScriptAlias /krb {{ admin_script }}
|
|
WSGIScriptAlias / {{ admin_script }}
|
|
WSGIApplicationGroup %{GLOBAL}
|
|
WSGIPassAuthorization On
|
|
KeepAliveTimeout 75
|
|
MaxKeepAliveRequests 1000
|
|
<IfVersion >= 2.4>
|
|
ErrorLogFormat "%{cu}t %M"
|
|
</IfVersion>
|
|
ErrorLog /var/log/apache2/{{ service_name }}_error.log
|
|
CustomLog /var/log/apache2/{{ service_name }}_access.log combined
|
|
|
|
<Directory /usr/bin>
|
|
<IfVersion >= 2.4>
|
|
Require all granted
|
|
</IfVersion>
|
|
<IfVersion < 2.4>
|
|
Order allow,deny
|
|
Allow from all
|
|
</IfVersion>
|
|
</Directory>
|
|
IncludeOptional /etc/apache2/mellon*/sp-location*.conf
|
|
IncludeOptional /etc/apache2/kerberos*/apache-kerberos.conf
|
|
</VirtualHost>
|
|
{% endif -%}
|
|
|
|
{% if public_port -%}
|
|
<VirtualHost *:{{ public_port }}>
|
|
WSGIDaemonProcess {{ service_name }}-public processes={{ public_processes }} threads={{ threads }} user={{ service_name }} group={{ service_name }} \
|
|
display-name=%{GROUP} lang=C.UTF-8 locale=C.UTF-8
|
|
WSGIProcessGroup {{ service_name }}-public
|
|
WSGIScriptAlias /krb {{ public_script }}
|
|
WSGIScriptAlias / {{ public_script }}
|
|
WSGIApplicationGroup %{GLOBAL}
|
|
WSGIPassAuthorization On
|
|
KeepAliveTimeout 75
|
|
MaxKeepAliveRequests 1000
|
|
<IfVersion >= 2.4>
|
|
ErrorLogFormat "%{cu}t %M"
|
|
</IfVersion>
|
|
ErrorLog /var/log/apache2/{{ service_name }}_error.log
|
|
CustomLog /var/log/apache2/{{ service_name }}_access.log combined
|
|
|
|
<Directory /usr/bin>
|
|
<IfVersion >= 2.4>
|
|
Require all granted
|
|
</IfVersion>
|
|
<IfVersion < 2.4>
|
|
Order allow,deny
|
|
Allow from all
|
|
</IfVersion>
|
|
</Directory>
|
|
IncludeOptional /etc/apache2/mellon*/sp-location*.conf
|
|
IncludeOptional /etc/apache2/kerberos*/apache-kerberos.conf
|
|
</VirtualHost>
|
|
{% endif -%}
|