Hi ,

My name is mohan I work on smtp pop3 and Imap server
protocols .The entire system is written in such a way
I can be directly ported on any OS . It is a pure java
code . I too written a web mail client which runs on
tomcat . I had some issues running tomcat 3.2.1 on
Linux . 

Problem faced:

When I invoke a servlet through tomcat it generates
response before it could finish transmitting the
response to the http client .I invoke another servlet
what happens is Tomcat throws an exception connection
closed by pear thats right but it doesn't accepts any
more connection . 

What I did to solve the issue is 

under package org.apache.tomcat.service

File by name SimpleTcpEndPoint.java

had a Boolean variable by name "running" 
when Exception raised this variable was made to false
if it is false it does not accept any more connection
so I took out the part from the exception block . Now
it is working fine.

Question is :

Will it give nay problem by doing this work .Please
let me know weather I'm write or not .
One more NOTE is I never got this problem in windows
..

Please help me out in this area 

thanking you
mohan.
--- "Douglas E. Hornig" <[EMAIL PROTECTED]> wrote:
> For those of you who remember my question from
> several weeks ago regarding a response time delay
> between tomcat running standalone on Solaris and a
> Windows client.  I modified my own tomcat 3.2.2 as
> Gal suggested and the delay is gone.
> 
> I'll leave this to the pros to decide how to
> incorporate this into tomcat properly.
> 
> Thanks to everyone who helped me out with this
> problem (especially Gal!)
> 
> Doug
> 
> 
> --- Forwarded message from Gal Shalif - Sun Israel -
> Software Engineer ---
> 
> >From: Gal Shalif - Sun Israel - Software Engineer
> <[EMAIL PROTECTED]>
> >Date: Sun, 10 Jun 2001 14:47:44 +0300 (IDT)
> >To: "Douglas E. Hornig" <[EMAIL PROTECTED]>
> >Subject: Re: Solaris Performance Problem
> 
> Hello,
> 
> It should be fixed with a call to
> Socket.setTcpNoDelay() on the Tomcat
> server socket.
> A C program that I wrote had the same problem as the
> Tomcat server.
> and the problem was fixed with the setting of the
> TCP NODELAY
> transmission.
> 
> Anybody there who volunteer to add this option to
> the Tomcat Java
> server code?
> 
> My analysis of the problem is attached at the end of
> this mail.
> 
> > >From: [EMAIL PROTECTED] (Douglas E. Hornig)
> > Subject: Solaris Performance Problem
> > To: [EMAIL PROTECTED]
> > 
> > I have run into a strance performance problem with
> Tomcat that I am at a loss to figure out.  In a
> nutshell, when I run Tomcat (version 3.2.1,
> standalone) on a Solaris Sparc server and hit it
> with a Windows client, the minimum response time is
> is abount 0.2 seconds.  This is for a simple servlet
> that just returns some static data.  That may not
> sound like a lot of time but if a client makes
> several requests to the server it can add up fast. 
> If I run the server on a Linux PC that number is
> about 0.01 seconds or less.  I also get good
> performce if I use a Linux client and hit the
> Solaris server.
> > 
> > I have tried using different PC clients (different
> PCs, one running NT 4 and one with Windows 2000),
> different test programs (one in Java and one in
> Visual Basic) and it makes no difference.
> > 
> > I have tried using different Solaris servers, a
> 420R and an Ultra 5, neither with any kind of load. 
> I have tried different JDKs (1.2.2 and 1.3.0).  No
> difference.
> > 
> > I wrote a quickie standalone Java server for the
> Sparcs and their response time was very fast (< 0.01
> secs).  The server reads a request, sends a reply,
> and closes the socket much like a web server would.
> > 
> > So the problem combination seems to be Solaris
> server with Tomcat and a PC client.  I know this
> sounds nuts but it's  totally repeatable and a very
> serious problem.  Does anyone have an idea what I
> can do to get to the bottom of this?
> > 
> > Thanks a lot.
> > 
> > Douglas Hornig
> > Dartmouth-Hitchcock Medical Center
> > Lebanon, NH
> 
> 
> ----------------------------------------------------
> slow response time with Solaris 8 server and 
> Windows 2000 TCP client as tested with Tomcat and IE
> ----------------------------------------------------
> 
> Problem description:
> --------------------
>   Tomcat Hello World examples
> (/examples/servlet/HelloWorldExample) 
>   divide the response into two parts:
> 
>     HTTP protocol header
>     HTML data
>   
>   At the Solaris TCP level, the second part of the
> response will not be send
>   till the Windows client acknowledge (ACK) the
> first part.
>   The result: a delay of ~170ms (dependent on
> client/server configuration)
>   
>   The configuration in problem:
>   -----------------------------
>     Solaris 8 running Tomcat 3.2.1 server
>     Windows 2000 client machine running a web client
> 
>   And the raw data:
>   -----------------
>     The output was gathered with:
>       truss -fdDla -o /tmp/tmp.dat -p 5732
>     On a Solaris machine:
>         SunOS node2mde 5.8 Generic_108528-05 sun4u
> sparc SUNW,Ultra-60
>         root nexus = Sun Enterprise 220R (2 X
> UltraSPARC-II 450MHz)
> 
>     Tomcat server (on the Solaris 8) send two sends
> within a few milliseconds:
> 
>       time stamp    duration    system-call and its
> arguments
>        (seconds)    (seconds)
> 
>       100759.3625    0.0009     send(14, "HTTP/1.0
> 200"  ...., 179, 0)  = 179
>       100759.3629    0.0004     send(14,
> "<html>\n<head" ...., 400, 0)  = 400
> 
>     The Windows 2000 client receive the second part
> about 170ms after the first
>     The delay the transfer of the second "send" till
> it receive an acknowledge
>     for the first.
> 
>     
>   
> Analyze:
> --------
>   This is a generic Solaris server Windows client
> TCP problem that
>   is not specific to Tomcat. The originate of the
> problem is probably
>   an obscure Windows TCP implementation, however,
> the Solaris TCP 
>   implementation should be able to recognize a
> Windows client on its LAN
>   and to modify its TCP parameters accordingly to
> improve performance.
> 
>   The Solaris OS try to optimize the transfer of
> data to its client by
>   combining a few sends/write of small amount of
> data each into one
>   data transfer. If the client machine is slow to
> acknowledge the first
>   transfer (i.e. Windows client), then the
> inevitable consequence 
>   is a "delay transfer": non of the small bits of
> data
>   will be transferred to the client till the Solaris
> gather enough
>   small bits for one big transfer or till the client
> acknowledge the
>   first transfer.
>   This optimization is good for connections with
> high latency (Internet, 
>   WAN) that has a big overhead per one transfer but
> is very bad for LAN 
>   where the latency is small and the overhead of one
> transfer is small
>   and the client machine is slow to acknowledge the
> first transfer.
> 
>   The bottom line is:
>     When the latency is small (LAN) and the client 
>     machine run windows (NT, Win2000) then the
> "delay transfer" 
>     optimization introduce delays and the TCP
> default should be set
>     to "no delay".
> 
> Fix:
> ----
>   For C/C++ programs, the server socket option
> should be set
>   to TCP_NODELAY.
>   Example:
>     int just_say_no = 1;
>     setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (void
> *)&just_say_no, sizeof(int));
>   For Java programs (i.e. Tomcat) , a similar
> attribute should be used.
>   For more information see: Socket.setTcpNoDelay()
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to