Boost.Asio的可扩展性 [英] Scalability of Boost.Asio

查看:141
本文介绍了Boost.Asio的可扩展性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇别人怎样迄今已在可扩展性方面推动Boost.Asio的。我写这封信可能使用接近1000 socket对象,接受对象的屈指可数,而几千计时器对象的应用程序。我已经配置它,这样有 io_service对象::运行,并使用■在适当的地方线程池调用为确保我的处理不影响对方。

I'm curious how far others have pushed Boost.Asio in terms of scalability. I am writing an application that may use close to 1000 socket objects, a handful of acceptor objects, and many thousand timer objects. I've configured it such that there's a thread pool invoking io_service::run and use strands in the appropriate places to ensure my handlers do not stomp on each other.

我的平台是红帽企业Linux与升压1.39,虽然我不反对升级到最新版本提振。

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.

推荐答案

我们正在在几个Linux版本的定时器,网络(TCP和UDP),串行使用1.39(20+线,其中两条为500 kbps的运行)和inotify事件,虽然我们没有太多的套接字连接,我们确实有在任何时候几百异步定时器。他们在生产,他们的工作很好,对我们来说。如果我是你,我会做一个快速原型和性能测试。

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. 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.

声称中的一些ASIO的Linux特有的性能改进,但我还没有他们的标杆为我们的产品。

Boost 1.43 claims a number of Linux-specific performance improvements in ASIO, but I am yet to benchmark them for our product.

这篇关于Boost.Asio的可扩展性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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