Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Bad performance of HTTPServletResponse at Tomcat

Reply
Thread Tools

Bad performance of HTTPServletResponse at Tomcat

 
 
Sasha
Guest
Posts: n/a
 
      04-04-2005
Hi ,
I have a serious bad performance problem when under the load.
When I make a load test of 20 users, I see a bottleneck on the writing
of the response.
The lenght of the message up to 50K , but writting to outputstream
takes about 40 seconds.

Thanks in advance, Sasha

 
Reply With Quote
 
 
 
 
steepyirl
Guest
Posts: n/a
 
      04-04-2005
Can you be a little more specific? What does your servlet/jsp do?

 
Reply With Quote
 
 
 
 
navalverma@gmail.com
Guest
Posts: n/a
 
      04-04-2005
I am not sure of this, but may be increasing the size of the buffer
related to the output stream will help.

 
Reply With Quote
 
William Brogden
Guest
Posts: n/a
 
      04-04-2005
On 4 Apr 2005 06:39:12 -0700, Sasha <(E-Mail Removed)> wrote:

> Hi ,
> I have a serious bad performance problem when under the load.
> When I make a load test of 20 users, I see a bottleneck on the writing
> of the response.
> The lenght of the message up to 50K , but writting to outputstream
> takes about 40 seconds.
>
> Thanks in advance, Sasha
>


I would bet that the problem is not in writing the output stream.
Is it reading a database?
Have you tried giving Tomcat more memory?


--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
 
Reply With Quote
 
Sasha
Guest
Posts: n/a
 
      04-05-2005
Hi ,
Thanks a lot for your answers.
My servlet performs database queries and returns the answer to client.

I'm sure that it's not a DB problem since I see in the profiler that
execution time of DB queries doesn't change, and the time of writting
to OutputStream consistently grows.

In the beginning of the test with 1 user the division is 10/90 for DB
queries, and with 20 users it turns out to 80/20 to the writting to
OutputStream.

And as I said , it waits up to 40 seconds in the writting.
To my mind I need to tune Tomcat. It seems to me that the problem in
the account of descriptors that Tomcat can open , and the problem
occurs when it gets to the limit.

So if you know how to tune it , or you know the possible reason of the
problem please help me.

P.S. I would add a picture from the profiler that shows this problem,
but this forum doesn't allow to attache files.

Thanks in advance, Sasha

 
Reply With Quote
 
Andy Flowers
Guest
Posts: n/a
 
      04-05-2005
Sasha wrote:
> Hi ,
> Thanks a lot for your answers.
> My servlet performs database queries and returns the answer to client.
>
> I'm sure that it's not a DB problem since I see in the profiler that
> execution time of DB queries doesn't change, and the time of writting
> to OutputStream consistently grows.
>
> In the beginning of the test with 1 user the division is 10/90 for DB
> queries, and with 20 users it turns out to 80/20 to the writting to
> OutputStream.
>
> And as I said , it waits up to 40 seconds in the writting.
> To my mind I need to tune Tomcat. It seems to me that the problem in
> the account of descriptors that Tomcat can open , and the problem
> occurs when it gets to the limit.
>
> So if you know how to tune it , or you know the possible reason of the
> problem please help me.
>
> P.S. I would add a picture from the profiler that shows this problem,
> but this forum doesn't allow to attache files.
>
> Thanks in advance, Sasha


Can you post a small snippet of code which outlines your servlet logic.

Is the time to run the query including the time to loop over the resultset ?
This looping is where the time might be taken.


 
Reply With Quote
 
Sasha
Guest
Posts: n/a
 
      04-10-2005

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I am not sure of this, but may be increasing the size of the buffer
> related to the output stream will help.



Thanks a lot.
You are right - it improved the performance a little bit - now the CPU
stays on 40%, while before it was always on 100%.

I still have problems with the response time, and still sometimes this
operation takes too much time.


In addition I run the same test on WebLogic and the problem dissapeared
at all. So for sure it's a problem of Tomcat.

Do you have any additional ideas ?

 
Reply With Quote
 
Juha Laiho
Guest
Posts: n/a
 
      04-10-2005
"Sasha" <(E-Mail Removed)> said:
>I have a serious bad performance problem when under the load.
>When I make a load test of 20 users, I see a bottleneck on the writing
>of the response.
>The lenght of the message up to 50K , but writting to outputstream
>takes about 40 seconds.


No help for your problem, but could you disclose the version of Tomcat
you're using?
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
 
Reply With Quote
 
John C. Bollinger
Guest
Posts: n/a
 
      04-11-2005
Sasha wrote:

> In addition I run the same test on WebLogic and the problem dissapeared
> at all. So for sure it's a problem of Tomcat.


Perhaps. If your code is poor, and Weblogic doesn't happen to be
affected as badly as Tomcat is, then is it really Tomcat's fault? It
may indeed be that Tomcat has an issue here, but you have described the
situation so generically that there is no way any of us can give you
much in the way of meaningful help. As far as I know, Tomcat does not
have any known generic problems under load.

Notwithstanding the above, one general issue that you may run into when
making a program do more work is garbage collection. If your servlet
flagrantly produces loads of garbage and maintains large data structures
in memory then you may be seeing the effect of differing maximum heap
sizes in the underlying VM, or possibly a GC strategy in Weblogic's VM
that happens to significantly outperform the one in Tomcat's VM for your
particular scenario. That's a shot in the dark.

--
John Bollinger
(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
integer >= 1 == True and integer.0 == False is bad, bad, bad!!! rantingrick Python 44 07-13-2010 06:33 PM
Bad media, bad files or bad Nero? John Computer Information 23 01-08-2008 09:17 PM
ActiveX apologetic Larry Seltzer... "Sun paid for malicious ActiveX code, and Firefox is bad, bad bad baad. please use ActiveX, it's secure and nice!" (ok, the last part is irony on my part) fernando.cassia@gmail.com Java 0 04-16-2005 10:05 PM
24 Season 3 Bad Bad Bad (Spoiler) nospam@nospam.com DVD Video 12 02-23-2005 03:28 AM
24 Season 3 Bad Bad Bad (Spoiler) nospam@nospam.com DVD Video 0 02-19-2005 01:10 AM



Advertisments