----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Shopping my patch around. I've posted to new-httpd and to jserv-dev.
This should be enough coverage.
This patch involves two projects, Apache
core and JServ. The Apache core changes are minor but necessary.
The differences are:
Apache Core
http://www.tribaliron.com/patch/http_main.c.diff.txt
http://www.tribaliron.com/patch/http_main.h.diff.txt
The changes here deal specifically with the insertion of a callback
function into the timeout handler. I may be mistaken, but it looked as
though there were no notification hooks for handling timeout conditions
in a module.
JServ Apache module
http://www.tribaliron.com/patch/jserv_ajpv12.c.diff.txt
The change here is to implement a core set of persistent sockets between
the apache module and the JServ virtual machine. My analysis had shown
the constant creation and destruction of sockets was a serious
throughput issue.
JServ Java
http://www.tribaliron.com/patch/JServConnection.java.diff.txt
The change here is the implement the Java parallel of persistent sockets
between the apache module and the JServ VM.
The differences are against Apache version 1.3.11 and against JServ
version 1.1. After making these changes, we observed almost a threefold
increase in throughput on my local NT machine. Here are the observed
results:
http://www.tribaliron.com/patch/before.txt
http://www.tribaliron.com/patch/after.txt
The test is two runs of SnoopServlet with 50 simulated clients. I
believe the throughput curve is much more level as a result of these
changes as well, so 100 simulated clients yield an even greater
throughput improvement.
So why am I posting to http-new in addition to jserv-dev? Because while
things work great on NT and its multi-threaded architecture, things are
not working so well on Unix (Solaris 2.6 in this case) and its
multi-process architecture. Observed behaviour is as follows:
1st client request succeeds
2nd client request fails
3rd cilent request succeeds
4th client request fails
5th client request succeeds
6th client request may succeed
...
eventually all client requests succeed.
The nature of the failure is interesting in that simple diagnostics show
the Java VM running JServ does indeed send the data back to the JServ
apache module. However, when the apache module calls
ap_scan_script_header_err_buff, when the get function is called, it
returns 0, which indicates no bytes in the buffer, and an error was
generated. According to the Java VM, there should be bytes, but
according to the Apache ap function, there are no bytes. And, of course,
there is no problem on NT.
I do not have enough experience on Unix platforms to quickly diagnose
this problem so I'm hoping the group can help.
As for the actual (working) persistent socket implementation, there are
two issues.
Issue 1: If Apache is running with a socket pool size greater than the
maximum pool size allowed by JServ, current JServ handling is such that
socket connection requests are accepted, but will not be allowed on the
process queue, and thus will eventually timeout. It doesn't cause an
error, per se, but it does capture a number of apache children and marks
them as busy. I wanted to run this by someone more familiar with JServ
as to the correct solution.
Issue 2: If apache is running, but the JServ VM is stopped and then
restarted, the socket pool scoreboard is not updated. As such, if a user
makes a request that routes to a 'persistent' socket, the request will
fail since the socket is no longer valid. The scoreboard is reset and
the next request for that socket will succeed, but, in a sense, a client
needs to request a resource twice. I don't think this is a huge issue,
but it could be handled more graceful.
Thanks in advance for any help anyone can render. I'm not sure if the
socket
issue above
is a thread vs process issue, or an NT socket implementation vs Unix
socket implementation issue. If you have any questions, please email me
at either:
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Thank you for your time,
John Milan
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]