aspose file tools*
The moose likes Web Services and the fly likes WebService call response taking long time very first time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "WebService call response taking long time very first time" Watch "WebService call response taking long time very first time" New topic
Author

WebService call response taking long time very first time

Srinivas Kasani
Greenhorn

Joined: Sep 26, 2008
Posts: 22
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

Joined: Mar 22, 2000
Posts: 12821
    
    5
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

Joined: Sep 26, 2008
Posts: 22
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

Joined: Mar 30, 2012
Posts: 124

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

Joined: Sep 26, 2008
Posts: 22
Is there an option, like at time of deployment CXF can build all the skeletons.
Anurag Verma
Ranch Hand

Joined: Mar 30, 2012
Posts: 124

just try out having load-on-startup=1 in your web.xml for the CXF Servlet if it works.
 
Consider Paul's rocket mass heater.
 
subject: WebService call response taking long time very first time