-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Mark,
On 12/11/12 11:16 AM, Mark Eggers wrote: > On 12/11/2012 7:14 AM, Christopher Schultz wrote: >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 >> >> Julien, >> >> Warning: this is long. Like, André-or-Mark-Eggers long. >> > > Ouch (not really, thanks for the chuckle). Hemingway I am not, > thorough I try to be. Maybe more like Faulkner ;) > Very nice explanation. This may be useful for managing some > long-running financial calculations on a client's web site (and > convince them to manage more server-side rather than Javascript / > client side). Honestly, anything that takes more than a few seconds should be completely batched with an out-of-band notification. Just because you can wrap an HTTP request/response around something doesn't mean you should. Further responses below. >> So, a recap of throughput (req/sec) of the above 3 >> implementations: >> >> Standard: .15873 Background: .76923 Async: >> 200.00000 >> >> Using asynchronous dispatching can improve our throughput a huge >> number of times. >> >> It's worth repeating what I said earlier: if your server can't >> actually handle this much load (200 emails per second, let's >> say), then using asych isn't going to change anything. Honestly, >> this trick only works when you have a lot of heterogeneous >> requests. For example, maybe 10% of your traffic is handling >> orders as implemented above, while the rest of your traffic is >> for much smaller sub-500ms-requests. > > I suppose you could just up the thread pool in Tomcat. However, > sooner or later you're going to run out of resources somewhere. > It's probably less expensive overall to use the asynchronous method > than to dump more threads into an Executor thread pool. Well, the point is that when you are "handing" requests faster (because the work is really being done by another thread), you can process a request queue faster with fewer threads. So, you don't have to have a huge thread pool to handle a huge number of requests. You probably still have to have the same number of threads (processors versus real-workers) total in the JVM -- maybe even more -- but you can process lighter-weight requests much more quickly if you don't have to tie-up request processors all the time. > Testing would be good. Always. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEAREIAAYFAlDHdaQACgkQ9CaO5/Lv0PB5eQCfY7oUomOapHW9wIZap0ovge0Z HbwAoL2AclWKKS1qw3JxmHZv1/f3TosT =xHaZ -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org