Re: nio connector configuration

2009-02-27 Thread otismo

Thanks for the response, Filip.  Hopefully this is more helpful...

I put a war at http://www.nomad.org/test.war containing my web app, the
source, and my jmeter test plan.

My question: why are comet timeouts getting generated substantially behind
the timeout setting?

Is it because I have incorrectly configured tomcat?  Is there something
wrong with my test?  Can anyone else confirm this behavior?

It seems as though the normal (non-comet) http requests are taking priority
over the comet requests.

The test is very simple.  One set of threads sends non-comet http requests
every 10 seconds.  Another set of threads sends comet requests with a single
byte in the body.  The comet servlet sets a comet timeout of 10 seconds,
reads the request body, and then closes the connection on receiving the
comet timeout event.  On close of the connection, the comet test threads
then send another comet request.

I have JMeter set to start 100 threads for the http thread group and 100
threads for the comet thread group, ramping up at 1 thread per second.  

A fifteen minute test shows:
http requests: 9750 samples
http response time: avg 109ms, min 66ms, max 3699ms
http errors: 0%
http throughput: 9.5 requests/second
comet requests: 1942 samples
comet response time: avg 50149ms, min 10353ms, max 120876ms (tcp timeout is
set to 12)
comet errors: 0%
comet throughput: 1.9 requests/second
cpu use is minimal (1-4%)

There are no errors in the catalina log.

I also added timing code to the test servlet to confirm that JMeter's
measurements are accurate and found they are.  After confirming the
measurements, I removed the timing code.

I noticed on even short tests the http requests predominate, even though
there should be roughly the same # of http requests as comet requests (1
request/10 seconds/thread and there are 100 threads for each thread group,
http and comet).

My NIO configuration is:
Connector port=80
protocol=org.apache.coyote.http11.Http11NioProtocol
maxThreads=1000
acceptorThreadCount=2
acceptorThreadPriority=10
pollerThreadCount=2
pollerThreadPriority=10
redirectPort=8443
enableLookups=false /

os: ubuntu 8.10 (although also observed same behavior on Windows XP SP 3)
tomcat 6.0.18

(Note: the following are also in the war bundle referenced at top)
The client TCP request looks like this (without the s):

POST /test/cometTest HTTP/1.1
Host: 173.45.237.215
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2)
Gecko/20081201 Firefox/3.1b2
Connection: keep-alive
Content-Type: text/plain
Content-Length: 1

5


The http test servlet's doGet method looks like this:
protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws IOException {
response.getWriter().println(response);
}

The comet test servlet's event method looks like this:
public void event(CometEvent event) throws IOException, ServletException
{
HttpServletRequest request = event.getHttpServletRequest();
if (event.getEventType() == CometEvent.EventType.BEGIN) {
event.setTimeout(1);
} else if (event.getEventType() == CometEvent.EventType.ERROR) {
event.close();
} else if (event.getEventType() == CometEvent.EventType.END) {
event.close();
} else if (event.getEventType() == CometEvent.EventType.READ) {
InputStream is = request.getInputStream();
byte[] buf = new byte[512];
do {
is.read(buf);
} while (is.available()  0);
}
}

Thanks for any help,
Peter
-- 
View this message in context: 
http://www.nabble.com/nio-connector-configuration-tp21969270p22252460.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: enableLookups=true, getRemoteHost returns ip

2009-01-29 Thread otismo

Thanks, Konstantin, for the thorough response!

I was failing to grasp that the forward lookup portion of the method was
failing because there was no forward dns mapping.  I thought it was failing
locally inside the java code, not in the dns system.  

To confirm the lack of a dns mapping, I used host ip address and
received a host name.  Then I tried host host name and got a host not
found message.

Since it's not critical that I prevent spoofing in my app, I'm using a
variation of the jndi dns code you pointed out in
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4670102.

Thanks again,
Peter
-- 
View this message in context: 
http://www.nabble.com/enableLookups%3Dtrue%2C-getRemoteHost-returns-ip-tp21696774p21731881.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



enableLookups=true, getRemoteHost returns ip

2009-01-27 Thread otismo

I'm struggling to get enableLookups to work on a new Ubuntu 8.10 tomcat
6.0.18 install.  Calls to httpServletRequest.getHostName() always return the
IP, instead of the host name.  I set the access log to resolve hosts and it
also shows the ip.  

Tomcat 6.0.18 and the same webapp perform the reverse lookups fine on a
WindowsXP machine.  It doesn't appear to be a permissions problem, as I've
temporarily granted AllPermission to my webapp.  I've traced it down to
java.net.InetAddress.getAddressFromNameService(String host, InetAddress
reqAddr) and the subsequent call to
sun.net.spi.nameservice.NameService.lookupAllHostAddr(host), which returns
null. 

Inside getAddressFromNameService, the host is the valid host that I wish
would be returned.  Since the lookupAllHostAddr(host) call fails,
getAddressFromNameService then throws an UnknownHostException.

I also tried setting -Dsun.net.spi.nameservice.provider.1=dns,sun but that
didn't make a difference.

Could it be a dns config issue on my ubuntu box (hosted by slicehost)? 
Using the host command and an IP in question returns the host name that I
want to get back from httpServletRequest.getRemoteHost().  Any tips for me? 
I'm a linux noob.

Thanks,
Peter
-- 
View this message in context: 
http://www.nabble.com/enableLookups%3Dtrue%2C-getRemoteHost-returns-ip-tp21696774p21696774.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org