• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat only serves one page at the same time

 
Robert Jaeger
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I have configured succesfully a WinNT/Apache1.3/Tomcat4/MySQL/Cocoon architecture.
Well, there�s only one problem.
When I try to request a *.jsp from 2 browsers at the same time, Tomcat doesn�t return results (loads forever). I think that happens only during the first request, when Tomcat generates the servlets. However, I am not sure and worried about Tomcat�s performance.
Is this just a problem at the first request when I try to access the same jsp?
Is there a software that checks and reports server performance (e.g. by sending a lot of random requests)?
Maybe someone has an idea,
Robito.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you verify that it happens the first time the JSP is accessed. This si normal because that's the time when the servletis being generated. On subsequent requests it should not take longer, regardless of how many requests are coming in, unless you have synchronized some of your code, or implemented the "SingleThreadModel" interface.
 
Robert Jaeger
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it works fine after the first servlet-generation until the next jsp-changes then it�s ok for me.
I just wondered about the problems with the first request.
Thanks,
Robert.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18281
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depnding on the speed of your server, the first hit on a JSP can take an incredibly long time as it has to compile the JSP into a servlet (usually) and then compile the servlet into Java bytecodes, plus run the init code for the servlet.
For this reason a lot of people prefer to precompile their JSPs. The exact method for doing that depends on your appserver, so you'll have to RTFM. For testing purposes, I just live with the rotten performance, though, since a precompiled JSP is worthless once I've updated the page.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic