James Black wrote:
In order to answer this question, you also need to know how long it takes to respond to each individual request. Suppose processing each request takes less than a second, then at a peak rate of 1/sec, you have no problem. However if processing a request took 20s, then a server with 16 threads will choke pretty quickly.Hello, We are finally ready to bring my web services into production, and I have some concerns about what type of system to use it on. I am hoping that some people here will be able to give me an idea about performance issues. I have been developing on an Ultra10 with 128M RAM, so have done little than just basic testing. If I want to handle bursty requests, up to about 1/sec, will Tomcat be able to handle this type of load, or it is better to tie Tomcat in with Apache, and have Apache handle the HTTP connections?
In a sense this makes knowing when your server will overload pretty darn easy, you just need to know how long it takes to process a single request and how many threads/processes you have to handle requests; then avoid making the load anything like that high, by changing what a request does or spreading the load across multiple balanced servers.
In the real world, your threads will slow each other down and there may be other demands on processing time (eg the db you mention). The only safe way to figure out what will happen is to use a load testing tool; there's plenty out there to choose from.
It doesnt sound like your system is going to be bottlenecked by tomcat or apache if its only handling 1 request per second. On one site I worked on, overload happened at more like 12/s, and that was mainly because request processing took 7s or so at a time, mostly in the DB; the overhead of the servlet engine/apache itself was still waaaay below .1s per request.I am doing a lot of database queries and generating 2D and 3D graphs from the data. Any idea what type of system I would need? In terms of needed RAM?
Its impossible to say from this amount of information how much RAM you will need. Can't you do some measurements in your dev environment and try to scale it up? One comment I would make, if this really is intended to scale, don't put the DB and the webserver on the same machine. They will compete for memory, disk access. So, tuning one will detune the other - its a nightmare.
It does sound like your dev environment is short of RAM. Thinking about how that must pan out...
30Mb for emacs (say)
72Mb for tomcat + JVM (IIRC this is the default -Xmx setup)
20Mb for apache 1.3 (roughly 1Mb/process no mod_perl etc, 20 in pool)
plus say 20Mb for a smallish DB.
plus 5Mb for your web service client?
I've already used more memory than you have, without looking at Solaris. I guess your machine thrashes badly under any load - you'll be memory limited long before you're CPU limited. Developers here get 500Mb, RAM is so cheap these days. Devs are usually running bits of both the client and server environment plus their dev tools, they need the juice.
If by this you mean 'does tomcat use a separate thread for each request', the answer is yes.Is Tomcat threaded for each request?
Again: at 1 request/sec the bottleneck will /not/ be tomcat or apache (or axis). A more likely bottleneck will be that your requests take too long because of that graphics processing or DB access. But the only good way to resolve this is to do some load testing, or profile your application. I found JProbe from sitraka is pretty good for profiling (its expensive but pays for itself in time saved, used it on Solaris and Windows), and you could look at Apache JMeter for load testing.Thank you for taking the time to look at this. I am a bit nervous as to how well my web services will function under stress.
Hope this helps
Baz