工作管理器线程约束和页面无法显示 [英] Work managers threads constraint and page cannot be displayed

查看:115
本文介绍了工作管理器线程约束和页面无法显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们对某些功能有占用大量内存的处理,并且我们希望将并行请求的数量限制为该处理.我们可以通过在WebLogic中使用工作管理器"进行配置,并对该servlet的线程数进行限制.

例如,如果我们将最大线程限制设置为3,则如果有10个并行请求,则为0. 7个请求正在排队.在某些情况下,这些在队列中等待的请求可能需要多达30-40分钟的时间来处理.我们进行了简单的测试,由于15分钟后超时,无法显示收到的页面,而1小时后收到了消息.

是否有人知道WebLogic中是否有设置来增加/减少超时并避免无法显示页面?

感谢任何人对此有任何想法.

解决方案

是否有人知道WebLogic中是否有设置来增加/减少超时并避免无法显示页面?

可能有些东西,但是我实际上没有检查,因为无论如何这都是一个坏建议.通过查找此内容,您正在尝试解决此处的错误问题.即使您不介意用户在等待(更不用说他可以刷新页面并排队越来越多的作业),浏览器也无法像您所描述的那样进行长时间运行(> 3000万).

因此,我认为正确的答案是:使用异步,这是一个完美的用例.当用户单击按钮时,将JMS消息发送到队列(或创建Quartz作业),并向用户发送带有请求ID的页面,告诉他稍后再返回.处理完成后,请在某处更新状态,并使状态/结果对用户可用.确实,这样做的用户体验会更好,并且与浏览器相比,您所面对的问题更少.

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.

解决方案

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.

这篇关于工作管理器线程约束和页面无法显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆