Earlier today I reported having a problem trying to deal with
concurrent HTTP requests on a servlet which accesses a resource
that can only support one connection at a time.
The nature of the application is such that serial behavior is
okay -- so it's okay for the processing to take awhile. What was
not okay was to return HTTP 500s or some other internal/busy error.
At first I tried synchonizing doPost(). That worked and gave acceptable
performance. But sometimes it appeared that the whole system would hang.
After several hours of inactivity for example, a slew of concurrent
requests (the release of a barrier, for those familiar with the term) was
issued and although the requests were answered, the performance per
request was much worse than usual. In checking the logfiles, it looked
like something went out to lunch after the request headers were read.
I can post the details if anyone is interested.
There was a suggestion that I convert the applet to use SingleThreadModel
and do not synchnoize the doPost() method. This failed. I was getting
back HTTP 500s for 80% of the requests. The suggestion seemed valid...
Finally, after Jon kindly pointed me to the Mutex code, I tried that.
And I'm pretty happy with it. It does what it advertises and worked
out of the box. Nice job, Pier.
Anyway, maybe others will find this report from the trenches useful.
--
::: Greg Barish ([EMAIL PROTECTED]) :::::::::::::::::::::::::::::::::::::::
----------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]