[英]Scalability of Boost.Asio
I'm curious how far others have pushed Boost.Asio in terms of scalability. 我很好奇其他人在可扩展性方面推动Boost.Asio有多远。 I am writing an application that may use close to 1000 socket objects, a handful of acceptor objects, and many thousand timer objects.
我正在编写一个可能使用将近1000个套接字对象,几个接收器对象以及数千个计时器对象的应用程序。 I've configured it such that there's a thread pool invoking
io_service::run
and use strand
s in the appropriate places to ensure my handlers do not stomp on each other. 我已经配置它,例如,有一个线程池调用
io_service::run
和使用strand
S IN的适当位置,以确保我的处理程序不践踏对方。
My platform is Red Hat Enterprise Linux with Boost 1.39, though I'm not opposed to upgrading to a more recent version of boost. 我的平台是带有Boost 1.39的Red Hat Enterprise Linux,尽管我不反对升级到Boost的最新版本。
We are using 1.39 on several Linux flavors for timers, network (both TCP and UDP), serial (20+ lines, two of which run at 500 kbps), and inotify events, and while we don't have many socket connections, we do have a few hundred async timers at any time. 我们在几种Linux风格的计时器上使用1.39,用于定时器,网络(TCP和UDP),串行(20条以上的线路,其中两条以500 kbps的速度运行)和inotify事件,尽管我们没有很多套接字连接,但我们随时都有数百个异步计时器。 They are in production and they work well, for us.
他们正在生产中,对我们来说运作良好。 If I were you, I'd make up a quick prototype and performance-test it.
如果您是我,我将组成一个快速的原型并对其进行性能测试。
Boost 1.43 claims a number of Linux-specific performance improvements in ASIO, but I am yet to benchmark them for our product. Boost 1.43声称在ASIO中有许多Linux特定的性能改进,但是我还没有将它们作为我们产品的基准。
I've used boost asio with a client / server where the server has several hundreds of concurrent connections all day long. 我已经将boost asio与客户端/服务器一起使用,其中服务器全天都有数百个并发连接。 Each session does a lot of read/write operations for several hours each.
每个会话每次都要进行几个小时的大量读/写操作。 I would recommend using the latest version of boost asio.
我建议使用最新版本的boost asio。 I can't remember version 1.39 but I've had issues with older versions.
我不记得版本1.39,但是旧版本存在问题。 The current version of boost asio seems stable.
boost asio的当前版本似乎稳定。
The software I'm talking about only runs on Windows I should mention as well though which differs from your situation. 我要说的软件也只能在Windows上运行,尽管这与您的情况有所不同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.