Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WebService call response taking long time very first time

 
Srinivas Kasani
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have webservices developed using apache cxf 2.0. What we noticed is, after the server startup, the first call response is taking long time to comeback. On the client end, it is timing out. From second request, everything runs real quick in milliseconds. Is there in anyway, we can improve performance on the first webservice request.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First you have to find out what is taking so long, right?

So scatter some logging statements around possible bottlenecks such as creation of a database connection or use one of the many profiling tools.

For example, JAMon.

Bill
 
Srinivas Kasani
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have logging statements. What I noticed is, very first log statement in the service method is taking 10+ seconds. So, I'm looking for ideas more towards deployment fine tuning in weblogic or something else which could bring down the initial time.
Database connection is not a issue as I notice no extra time whether it is first time or subsequent calls.
 
Anurag Verma
Ranch Hand
Posts: 167
Hibernate Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know the exact solution, but about the reason, it's like Apache CXF prepares the skeleton on first request to it. What I used to do is whenever new deployment is done, hit any of the service with no parameter. If someone can suggest a solution, i would be more than happy.
 
Srinivas Kasani
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there an option, like at time of deployment CXF can build all the skeletons.
 
Anurag Verma
Ranch Hand
Posts: 167
Hibernate Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just try out having load-on-startup=1 in your web.xml for the CXF Servlet if it works.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic