質問

First I am not quite sure what will happens if max thread count is reached for Resin Standalone server 4.0.32. Based on my observation, Resin will either put the requests on hold (process them in order) or disconnect the connection. But I don't know how Resin decides this. So I want to know what is happening behind it.

Also I am wondering if I can customize the behavior of the server for this case, so assume resin has reached the maximum number of threads allowed. and for the request in the queue, if they are in the queue for more than 2 minutes, I want the server return a 503 to the client. Is this achievable?

Any comments or information are appreciated. Thank you.

We are using Resin 4.0.32 open source edition, java 1.6_16

役に立ちましたか?

解決

I was confirmed by ferg in the Caucho official forum about the the behavior:

Normally you shouldn't ever hit the thread-max, because the thread-max is set to a far higher number than your application should normally reach.

If it does, though, the pending thread execute() is queued. Eventually one of the threads will finish and pick up the requested execute().

(Unless you deliberately set the thread-max to something very low, which might mean that all the threads are doing useful things. But there's no good reason to do that. Threads are relatively cheap.)

http://forum.caucho.com/showthread.php?t=29823

So this confirms my observation that after reaching maximum threads allowed, the other request will be queued to process. And also if there is much more than the server can handle, some of the request will be denied.

For my second question about if we can customize to return 503 about the request, I did more research and I conclude it can not be done with resin standalone since I can not find any information about it. The only thing I can find is that Apache web server will return 503 while working with resin application server when the web server failed to connect to resin app server.

Hope this helps.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top