我正在用autobahn-cpp做一些酒吧和子测试。但是,我发现当您以比子端点可以消耗的频率更快的频率发布某些数据时,这将导致路由器(交叉开关)缓存一些数据并且内存使用量增加。最终,路由器将耗尽所有内存并被操作系统杀死。
例如
出版商:
while(1)
{
session->publish("com.pub.test",std::make_tuple(std::string("hello, world")) );
std::this_thread::sleep_for(std::chrono::seconds(1)); // sleep 1s
} // pub a string every seconds
订户:
void topic1(const autobahn::wamp_event& event)
{
try
{
auto s = event.argument<std::string>(0);
std::cerr << s << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(2)); //need 2s to finish the job
}
catch (std::exception& e)
{
std::cerr << e.what() << std::endl;
}
}
main()
{
...
session>subscribe("com.pub.test", &topic1);
...
} // pub runs faster than the sub can consume
经过几次housr:
2016-01-7 10:11:32+0000 [Controller 16142] Worker 16145: Process connection gone (A process has ended with a probable error condition: process ended by signal 9.)
DMSG:
Out of memory: Kill process 16145(Crossbar.io Wor) score 4 or sacrifice child
我发现了类似问题,请参阅链接https://github.com/crossbario/crossbar/issues/48
系统信息:ubuntu 14.04(32位),CPython 2.7.6,Crossbar.io 0.11.1,Autobahn 0.10.9