This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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!
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).
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).
Joined: Jun 02, 2010
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):
Is it normal, that the time is so diffrent for 1st request and for the last one? After all this is simple webservice...
Joined: Oct 04, 2006
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!