Work managers threads constraint and page cannot be displayed

左心房为你撑大大i 提交于 2019-12-13 04:46:38

问题


We have a memory intensive processing for certain functionality and we would like to limit the number of parallel requests to this processing. We are able to configure by using "Work Managers" in WebLogic and putting a limit on the number of threads for that servlet.

For example, if we put maximim thread limit as 3, then if there are 10 parallel requests; 7 requests are in queue. There could be situations where these the requests waiting in queue could take up to 30-40 minutes to be processed. We did simple testing and the received page cannot be displayed due to timeout after 15 mins and received the message after 1 hour.

Does any one know if there is a setting in WebLogic to increase/decrease timeout and avoid page cannot be displayed?

Appreciate if any one has any thoughts around this.


回答1:


Does any one know if there is a setting in WebLogic to increase/decrease timeout and avoid page cannot be displayed?

There might be something but I actually didn't check as it would be a bad advice anyway. By looking for this, you are trying to solve the wrong problem here. A browser is just not made for long-running process like the one you are describing (>30mn) even if you don't mind the user waiting (not mentioning that he could refresh the page and queue more and more jobs).

So, the right answer here is in my opinion: use asynchronism, this is the perfect use case. When the user clicks on the button, send a JMS message to a queue (or create a Quartz job) and send the user a page with a request ID telling him to come back later. When the processing is done, update the status somewhere and make the status/result available to the user. Really, the user experience will be better doing this and you'll face less problems than with a browser.




回答2:


1) Use some other tool (not browser) like WGET where you can control timeout parameter (--timeout).

2) Why do you use HTTP? Use message driven beans and send message JMS to that and don't care about time outs.




回答3:


Perhaps quartz can do what you need? Start a job and check in on it as you need to?



来源:https://stackoverflow.com/questions/1676199/work-managers-threads-constraint-and-page-cannot-be-displayed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!