简体   繁体   English

wso2 bps OutOfMemoryError-无效事件列表

[英]wso2 bps OutOfMemoryError - inefficient event list

Having WSO2 BPS 3.6.0 occasionally we encountered OutOfMemoryError and server stopped. 使用WSO2 BPS 3.6.0时,我们偶尔会遇到OutOfMemoryError并且服务器已停止。 After heap analysis we suspect: 经过堆分析后,我们怀疑:

We have a few processes which periodically look-up some information (using a web service) until the business item state is not changed. 我们有一些流程,这些流程会定期(使用Web服务)查找一些信息,直到业务项目状态不变为止。 After some time, some process instances may have MANY events (thousands, some 10k). 一段时间后,某些流程实例可能会发生许多事件(数千个事件,大约10k)。 When trying to see the instance information in the carbon console, the loaded data (instance activities) are able to cause en OutOfMemoryError and drop the server (having 6GB RAM) :( 当尝试在Carbon控制台中查看实例信息时,加载的数据(实例活动)能够导致en OutOfMemoryError并删除服务器(具有6GB RAM):(

As a workaround - we use a DB lookup: 解决方法-我们使用数据库查找:

select ode_event.event_id, ode_event.detail, ode_event.tstamp, ode_event.type,
ode_event.instance_id, ode_event.process_id,
ode_scope.scope_name
from ode_event, ode_scope where ode_event.instance_id=18204 and 
(ode_event.scope_id = ode_scope.scope_id);

though we consider idea to let any business users (even process owners) to access the database directly as very bad. 尽管我们认为让任何业务用户(甚至是流程所有者)直接访问数据库的想法非常糟糕。

Is there any (better) way / query to see the activities? 有什么(更好)的方式/查询来查看活动? Which is the correct github project to place an improvement / feature (to load the activities paginated) ? 哪个是放置改进/功能(加载分页的活动)的正确github项目?

Edit: 编辑:

seeing the source code this "behavior" is inherited from the Apache-ODE implementation (eagerly loading the whole list of scopes and events into memory) 看到源代码,这种“行为”是从Apache-ODE实现继承的(将整个范围和事件列表迅速加载到内存中)

This is the current behavior. 这是当前行为。 We can improve it by adding the pagination. 我们可以通过添加分页来改进它。 But this is the reason, that is not prioritized. 但这是原因,没有优先考虑。

If you check individual DB table sizes, you will see that event table has consumed most of the spaces. 如果检查单个数据库表的大小,您将看到事件表已占用了大多数空间。 This is because, Process debug level events are enabled by default and it generates lots of events.These events will be useful at development time, But when it comes to production, you have to disable them. 这是因为,进程调试级别的事件默认情况下处于启用状态,并且会生成许多事件。这些事件在开发时会很有用,但是在生产时,必须禁用它们。 Otherwise you are wasting production resources (CPS, Memory, DB spaces). 否则,您将浪费生产资源(CPS,内存,数据库空间)。 It will affect, performance of the entire BPS engine. 这将影响整个BPS引擎的性能。

Here are some general recommendations. 以下是一些一般性建议。

If you have larger and long running process, it is recommended to enable Event only for selected scopes that you need to monitor. 如果您的流程较长且运行时间较长,建议仅对需要监视的选定范围启用事件。 (Even Better if you can have none. :)) (如果您什么都没有,那就更好了。:)

Also, you will need to continuously clean up old data from the database. 另外,您将需要不断清理数据库中的旧数据。 (Just google BPS Documentation for scripts) Otherwise your DBA will going to complain about DB doesn't have enough space to run in near future. (只是google BPS文档的脚本)否则,您的DBA将会抱怨DB在不久的将来没有足够的空间来运行。 :) :)

Events are not required for process execution. 流程执行不需要事件。 So you can clean it up. 这样您就可以清理它。 In your scenario, is it Ok to clean up OLD events of the active BPEL process ? 在您的方案中,可以清除活动BPEL流程的OLD事件吗? Eg: Clean events older than 1/2/7.. days. 例如:清除早于1/2/7 ..天的事件。 ?. This will solve your problem for some extend. 这将在某种程度上解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM