blob: dbea63cf781a30ef59ecb8968f70c377d4335a60 [file] [log] [blame]
# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Set a define so we can conditionally exclude some lab apache settings
# in the main configuration.
Define MOBLAB_INSTANCE True
PassEnv CROS_CACHEDIR
# Protect moblab from securtiy scans as it crashes the device.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*(GoogleSecurityScanner).* [NC]
RewriteRule ^(.*)$ - [F,L]
</IfModule>
LoadModule wsgi_module modules/mod_wsgi.so
ServerName localhost
Listen 80
Include /usr/local/autotest/apache/apache-conf
PidFile /var/run/apache2.pid
# Setup wmatrix under a sub-directory of the web server
Include /whining/apache-conf
# Override default logging and limit the size of the logs
ErrorLog "|/usr/sbin/rotatelogs -n 2 /var/log/apache2/error_log 50M"
CustomLog "|/usr/sbin/rotatelogs -n 2 /var/log/apache2/access_log 50M" common
# Limit Apache's memory settings.
StartServers 1
MinSpareServers 1
MaxSpareServers 1
MaxRequestWorkers 6
# Note that restarting Apache's processes does not restart the WSGI Daemon
# processes, which is where memory is leaked from the application. Changing
# this value does not do much.
MaxRequestsPerChild 100
# Each request can leak about 60MB of space, which is 1.5% of a moblab's memory.
# If we want 90% maximum memory utilization, then we can only have
# 90 = 1.5 * processes * maximum_requests.
# Choosing processes = 6, maximum_requests = 10 arbitrarily.
WSGIDaemonProcess autotestapache processes=6 maximum-requests=10