You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2014/11/25 15:39:33 UTC

[Bug 57259] New: mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

            Bug ID: 57259
           Summary: mod_proxy_ajp + apache 2.4 on windows not using TCP
                    connection pool
           Product: Apache httpd-2
           Version: 2.4.10
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_proxy_ajp
          Assignee: bugs@httpd.apache.org
          Reporter: slawomir.kluz@assaabloy.com

1. Extract httpd-2.4.10-win64-VC11.zip from apachelounge or apachehaus
2. Extract tomcat (ie. apache-tomcat-7.0.57-windows-x64.zip)
3. Configure httpd:
   - enable mod_proxy
   - enable mod_proxy_ajp
   - configure connection to tomcat:
     ProxyPass / ajp://127.0.0.1:8009/
     ProxyPassReverse / ajp://127.0.0.1:8009/ 
4. Start tomcat.
5. Start httpd.
6. Open http://localhost/ by browser.
7. Observe number of TCP connections using: netstat -an when refreshing the
page.

Each new connection from httpd to tomcat creates new TCP connection (ie.
127.0.0.1:56233->127.0.0.1:8009). All of them have TIME_WAIT status and are
destroyed by OS after 4 minutes (default value of TcpTimedWaitDelay on
windows). In extreme, number of TCP connection will exceed windows limit (by
default it's ~14K). I confirmed that by sending lots of request to apache one
by one.

I have check the same scenario using apache 2.2 on windows, and apache 2.4 on
linux. It works it different way. Httpd creates few
connections to tomcat and reuse them. They have ESTABLISHED status.

Occurs on Windows 7 64bit, Windows Server 2008 R2 64bit.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57259] mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
                 OS|                            |All

--- Comment #1 from Eric Covener <co...@gmail.com> ---
trace?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57259] mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

Mario <JB...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #7 from Mario <JB...@gmail.com> ---
Not adding a standard port or adding a not-standard port works.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57259] mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

--- Comment #5 from slaklu <sl...@assaabloy.com> ---
Do you need any additional information, or we can treat this problem as a bug?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57259] mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

--- Comment #9 from slaklu <sl...@assaabloy.com> ---
Workaround works also for me (without default port of with not-standard).

It will be hard to verify the patch for me, since this requires compiling
apache on windows. I'll ask apachelounge for support.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57259] mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

--- Comment #4 from slawomir.kluz@assaabloy.com ---
Created attachment 32228
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=32228&action=edit
httpd.conf

My problem came up with a more complicated configuration, but as you can see is
also present when using almost default one.

I have attached my httpd.conf to not have doubts.

For comparison, I used httpd-2.2.29-win64.zip from apachelounge. Same
configuration but no problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57259] mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ylavic.dev@gmail.com

--- Comment #6 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 32277
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=32277&action=edit
Don't add default port (of any known scheme) to the name of proxy workers

Since 8089 is default port for the AJP scheme, the canonicalization removes it
from the URL, but the proxy worker name (URL) still contains it.

Hence the failure to match the requested URL with the worker, and the use of
the default worker (reverse proxy).

Can you please try the attached patch?

A workaround would be to not specify the port 8009 in the ProxyPass
declaration:
  ProxyPass / ajp://127.0.0.1/
or
  ProxyPass / ajp://[::1]/

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57259] mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

Christophe JAILLET <ch...@wanadoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #11 from Christophe JAILLET <ch...@wanadoo.fr> ---
Backported in 2.4.x in r1650655

Will be part of 2.4.11

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57259] mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57259] mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---

--- Comment #8 from Yann Ylavic <yl...@gmail.com> ---
(In reply to Mario from comment #7)
> Not adding a standard port or adding a not-standard port works.

With (or without) the patch applied?

(please don't change the status if you are are not the OP, it might work for
you with the patch applied but nothing is commited in httpd yet).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57259] mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

--- Comment #3 from Eric Covener <co...@gmail.com> ---
It seems like your proxy is hitting the "default worker" which is not reusable.
It is kind of an internal concept to mod_proxy that bleeds out when you use
anything more than the most basic ProxyPass (e.g. rewriterule [P])

[Tue Nov 25 16:22:49.359276 2014] [proxy:trace2] [pid 3336:tid 504]
proxy_util.c(1937): [client ::1:51140] *: found reverse proxy worker for
ajp://127.0.0.1/

http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#workers

Are you sure the failing ones are mapped just by ProxyPass?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57259] mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|PatchAvailable              |FixedInTrunk

--- Comment #10 from Yann Ylavic <yl...@gmail.com> ---
Proposed for backport in r1644506.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57259] mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

--- Comment #2 from slawomir.kluz@assaabloy.com ---
Created attachment 32227
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=32227&action=edit
trace8 log

trace8 log file url attached.

The log contains:
- service startup
- opening http://localhost/ by browser (9 connections was created)
- pause
- page refresh (F5), (9 new connections created)
- shutdown

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57259] mod_proxy_ajp + apache 2.4 on windows not using TCP connection pool

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57259

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org