httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Woodworth <>
Subject RE: [users@httpd] httpd 2.4.2 not closing backend connection after proxypass ttl expires
Date Fri, 01 Jun 2012 14:12:17 GMT
Sorry that is a typo in the conf file I inherited.  It was removed during my testing.

From: Igor Cicimov []
Sent: Friday, June 01, 2012 1:40 AM
Subject: Re: [users@httpd] httpd 2.4.2 not closing backend connection after proxypass ttl

Why double ProxyPass?

ProxyPass / ttl=60

ProxyPass /

ProxyPassReverse /
On Jun 1, 2012 3:48 AM, "David Woodworth" <<>>

I am running Apache 2.4.2 as a reverse proxy server.  The backend IIS http server has a timeout
of 120 seconds for the backend connection.  I occasionally see 502 errors because the backend
connection is closed by the IIS server and Apache still tries to use it.  So I have added
"smax=0 ttl=60" to my ProxyPass directive, but apache continues to use this connection after
60 secs of idle time.

I test with making 10 consecutive calls that return good.  Apache re-uses the same connection
as I would expect.  I wait 90 seconds and attempt another connection.  It still re-uses the
same back-end connection that I would have expected to have timed-out by then.  Has anyone
else seen this behavior or know of a solution?  Any suggestions appreciated.

Configured with:              configure  --with-mpm=prefork

Conf file: (ip and urls modified to hide)

ServerTokens OS
ServerRoot "/usr/local/apache"
PidFile run/
Timeout 120
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15

<IfModule prefork.c>
StartServers       1
MinSpareServers    1
MaxSpareServers    1
ServerLimit      2048
MaxClients       2048
MaxRequestsPerChild  4000

<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0

Listen nn.nn.nn.nn:8087

LoadModule authn_file_module modules/
LoadModule authn_core_module modules/
LoadModule authz_host_module modules/
LoadModule authz_groupfile_module modules/
LoadModule authz_user_module modules/
LoadModule authz_core_module modules/
LoadModule access_compat_module modules/
LoadModule auth_basic_module modules/
LoadModule reqtimeout_module modules/
LoadModule filter_module modules/
LoadModule mime_module modules/
LoadModule log_config_module modules/
LoadModule env_module modules/
LoadModule headers_module modules/
LoadModule setenvif_module modules/
LoadModule version_module modules/
LoadModule proxy_module modules/
LoadModule proxy_connect_module modules/
LoadModule proxy_ftp_module modules/
LoadModule proxy_http_module modules/
LoadModule proxy_ajp_module modules/
LoadModule proxy_balancer_module modules/
LoadModule slotmem_shm_module modules/
LoadModule unixd_module modules/
LoadModule status_module modules/
LoadModule autoindex_module modules/
LoadModule dir_module modules/
LoadModule alias_module modules/
LoadModule rewrite_module modules/

<IfModule unixd_module>
User apache
Group apache

ServerAdmin root@localhost

UseCanonicalName Off
DocumentRoot "/var/www/html"

<Directory />
    Options FollowSymLinks
    Require all denied

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted

<IfModule mod_userdir.c>
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    UserDir disable

    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disable" line above, and uncomment
    # the following line instead:
    #UserDir public_html


DirectoryIndex index.html index.html.var

AccessFileName .htaccess

<Files ~ "^\.ht">
    Require all denied

TypesConfig /etc/mime.types

<IfModule mod_mime_magic.c>
    MIMEMagicFile conf/magic

HostnameLookups Off

LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log combined
ErrorLog logs/error_log

ServerSignature On

Alias /icons/ "/usr/local/apache/icons/"

<Directory "/usr/local/apache/icons">
    Options Indexes MultiViews
    AllowOverride None
    Require all granted

<IfModule mod_dav_fs.c>
    # Location of the WebDAV lock database.
    DAVLockDB /var/lib/dav/lockdb

ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

<Directory "/usr/local/apache/cgi-bin">
    AllowOverride None
    Options None
    Require all granted

IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable

ReadmeName README.html
HeaderName HEADER.html

IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

AddDefaultCharset UTF-8
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddHandler type-map var
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

Alias /error/ "/var/www/error/"

<IfModule mod_negotiation.c>
<IfModule mod_include.c>
    <Directory "/var/www/error">
        AllowOverride None
        Options IncludesNoExec
        AddOutputFilter Includes html
        AddHandler type-map var
        Require all granted
        LanguagePriority en es de fr
        ForceLanguagePriority Prefer Fallback

BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully

<VirtualHost *:8087>
    DocumentRoot /var/www/html/<>
    ErrorLog logs/
    CustomLog logs/ common
    ProxyPass /keepalive.htm !
    ProxyPass / smax=0 ttl=60
    ProxyPass /
    ProxyPassReverse /
    ProxyPreserveHost on
    RewriteEngine on
    RewriteRule ^/api/(.*)$1 [P,NC]

David Woodworth
Mitchell International
Office:  858-368-7547<tel:858-368-7547>

View raw message