This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Web Services and the fly likes The number of WS instances - how to change it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "The number of WS instances - how to change it" Watch "The number of WS instances - how to change it" New topic
Author

The number of WS instances - how to change it

Anna Smalska
Greenhorn

Joined: Jun 02, 2010
Posts: 4
annasmalska@interia.pl
annasmalska

Hello, I have hot a problem and I really need your help. I have got small web application with a web service, build like this:



Everything is working this fine, but it turned out, that in one time, the number of instances of this web service can’t be more than 5. When there are more clients who at this same time want to use this web service, they will have to wait. So I wanted to ask, how I can change it. I am using Netbeans with glassfish as server. I guest this is connected with number of beans in ‘pool’, but I really don’t know where to change this option. Thanks!
Manan Panchal
Greenhorn

Joined: Nov 17, 2008
Posts: 24
How can you say that there is 5 instance of ws?
Anna Smalska
Greenhorn

Joined: Jun 02, 2010
Posts: 4
I put simple


When I turn on application, and execute 20 concurrent request for this webservice, I got only 5 times 'running', and after 20 seconds, when those instances finished, the other requests started (again 5 of them).

So can somebody help me?
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I suspect that this is not an issue with your application, but rather with the server you are using.
I think you need to, for instance, increase the size of the threadpool holding the threads that processes requests.
Take a look at this article: http://blogs.sun.com/binublog/entry/monitoring_in_glassfish
It mentions the number of threads that process HTTP requests (which includes web service requests).
Best wishes!
Anna Smalska
Greenhorn

Joined: Jun 02, 2010
Posts: 4
hi, yeah, I was just browsing Glassfish admin console, and I found option 'Max Thread Pool Size' which was set to 5 ^^. And I wanted to write this, but you were first ^^ and you were right ^^. Thank you anyway

But I have got one more question, if you dont mind.

my webservice is simple, it doesn't do anything, it doesnt return anything (empty WS).
Later I made WS Client as normal j2se application, and I created 20 threads, and each of them was connecting to this WS (in this same time).
here are results (times of each of the request):
time: (9.376)
time: (11.375)
time: (11.391)
time: (11.396)
time: (13.404)
time: (13.416)
time: (13.429)
time: (14.431)
time: (15.431)
time: (17.437)
time: (17.44)
time: (18.443)
time: (18.452)
time: (18.458)
time: (19.457)
time: (19.462)
time: (20.461)
time: (20.471)
time: (21.501)
time: (22.477)

Is it normal, that the time is so diffrent for 1st request and for the last one? After all this is simple webservice...
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi again!
Ah, the art of testing! I cannot say that this is my strongest area, but I'll share some of the experiences I've had.

Yes, variations in the time it takes to process a request is normal, since there are a lot of factors that affect the response time:
- Are you running anything but GlassFish on the server computer?
If so, this will inevitably affect the test, since the OS need to share resources between the different applications.
- For how long are you running the test?
The first time a test executes and the first time the server receives requests, it may have to load resources needed to process the request.
Subsequent requests does not require this and so those requests can be processed more quickly.
- Garbage collection.
The JVM may, at any point in time, decided that it is time for a GC. When this happens, it will delay any processing done by the JVM at that point in time.
GC may actually freeze the entire JVM for a short duration of time (if I have understood correctly).

Finally, I would recommend you to take a look at soapUI - a free program for testing web services.
With soapUI you can, among other things, perform load testing on web services.

I just ran a 60 second load test with 20 threads and 20 threads in the GlassFish thread pool against the Calculator example web service from NetBeans.
In addition, I configured high level of monitoring for everything in the GlassFish monitoring panel.
soapUI gave me the max response time 669 mS, the minimum response time 2 mS and the average response time 12.87 mS.
In the GlassFish monitoring for the web application in which the web service was deployed, I got a max response time of 27 mS and a request count of 89150.
The conclusion is that the max response time in soapUI is not entirely correct - it is always good to have more than one single source of the "truth" when load-testing.
Hope this is of any help!
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The number of WS instances - how to change it