可扩展的Delphi TCP服务器实现 [英] Scalable Delphi TCP server implementation

查看:215
本文介绍了可扩展的Delphi TCP服务器实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于可用于可扩展TCP服务器的基础的组件的任何建议?我目前有一个使用Indy的实现,可以说100个相对活跃的连接或1000个相对不活动的连接,但每个连接模式的一个线程限制了可以处理的并发活动连接数。



我们的目标可能是1,000个连接,每个处理10个消息每秒或10,000个连接,每个处理1个消息每秒在一个好的服务器(8-16核心)。这是否现实?我真的很想听听任何现实世界的实现,因为我发现在理论上可能起作用不一定在实践中工作,我不想追逐一个不能奏效的提议的解决方案。



编辑: IOCP会很好,但我只想使用商业级的课程/组件,所以他们需要像Indy或IP一样专业 *在我想到使用它们之前工作。此外,我无意滚动我自己的解决方案 - 花费太多时间来做商业级。最后,我正在寻找一个重要的改进,我已经有了。我相信我可以挤出至少20-50%以上(基于Indy),但我永远无法处理10,000个并发客户端,每秒10,000个邮件,无论我尝试多么努力。是否有符合这些条件的东西是另一回事。



尽管我没有使用它,我已经决定接受提到IOCP类的答案,因为他们看起来像现阶段最好的调查路径。

解决方案

有一个项目 http://voipobjects.com/ ,基于前 iopoclasses 项目。



它声称要处理数千个并发连接


IOCP引擎是快速
创建的类,组件和例程的集合可扩展和性能的TCP / UDP应用程序。
使用IOCP类创建的应用程序可以处理数千个
的同时连接。



库是用Delphi编写的 - 支持Delphi 7 - 2010。 >

库使用IO完成端口技术。在Win32世界中有最强大的
技术,用于创建高度可扩展性和性能
TCP / UDP应用程序。除了旧版Win9x / WinME版本之外,所有桌面
Windows操作系统都支持此技术。



此库已获得MPL1.1许可。另外它包括一些文件
从Jedi项目(Winsock2标题翻译)。



https://bitbucket.org/voipobjects/iocpengine



Any suggestions for components to use as a base for a scalable TCP server? I currently have an implementation that uses Indy which works well for say 100 relatively active connections or 1,000 relatively inactive connections, but the one thread per connection model limits the number of concurrent active connections that can be handled.

Let's say my goal might be 1,000 connections each processing 10 messages per second or 10,000 connections each processing 1 message per second on a good server (8-16 cores). Is this realistic? I'd really like to hear of any real-world implementations because I have found that what might work in theory does not necessarily work in practice and I do not want to be chasing a proposed solution that will not work.

Edit: IOCP would be good, but I only want to use commercial-grade classes/components, so they need to be as "professional" as Indy or IP*Works before I would think of using them. Furthermore, I have no intention of "rolling my own" solution - it would take too much time to make it commercial-grade. Lastly, I am looking for a significant improvement on what I already have. I am sure I can squeeze at least 20-50% more out of what I have (based on Indy), but I am never going to be able to handle 10,000 concurrent clients, or 10,000 messages per second, no matter how hard I try. Whether there is something out there that meets these conditions is another matter.

I have decided to accept the answer referring to the IOCP classes, even though I have not used them, because they look like the best path for investigation at this stage.

解决方案

There is a project at http://voipobjects.com/ which is based on the former iopcclasses project.

It claims to handle thousands simultaneous connections:

IOCP engine is set of classes, components and routines for rapid creation high scalable and performance TCP/UDP applications. Application created using IOCP classes can handle thousands simultaneous connections.

Library is written in Delphi - Delphi 7 - 2010 are supported.

Library uses IO completion ports technology. There is most powerful technology in Win32 world for creation highly scalable and performance TCP/UDP applications. This technology is supported in all desktop Windows OSes except old Win9x/WinME versions.

This library is licensed under MPL1.1. Also It includes some files from Jedi project (Winsock2 header translation).

https://bitbucket.org/voipobjects/iocpengine

这篇关于可扩展的Delphi TCP服务器实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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