comet 与 php 套接字服务器?

发布于 2024-08-17 20:12:02 字数 136 浏览 5 评论 0原文

我读到如果很多用户使用你的 comet 实现,php 就不能很好地扩展?是因为apache服务器还是php语言?

什么是套接字服务器?它能解决这个问题吗?

有人为很多用户设置了 php comet 服务器,可以提供一些建议吗?

i've read that php doesn´t scale well if a lot of users are using your comet implementation? is that because of the apache server or the php language?

what is a socket server and does it fix that problem?

someone that has set up a php comet server for a lot of users that could give some advice?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

微暖i 2024-08-24 20:12:02

我读到,如果很多用户使用您的 comet 实现,php 就无法很好地扩展?

在哪里?

有很多关于扩展和编程语言的废话。

当然,使用 PHP 来实现 comet 存在一些问题 - 但与并发无关,除了 comet 扩展性不好之外(基于非注释 Web 的应用程序不受并发会话数量的限制,并且使用更少的内存) 。

主要考虑因素是内存管理:PHP 是为请求-应答类型的操作而设计的 - 所有数据都可以在迭代之间清除。如果您在服务器中编写面向对象代码,那么您绝对应该考虑使用循环引用检查器。

什么是套接字服务器,它能解决这个问题吗?

呃……你不知道吗?套接字服务器是使用套接字进行通信的服务器的通用描述 - 例如网络服务器、邮件服务器、文件服务器......

虽然可以用 PHP(或许多其他语言)实现套接字服务器,但它并没有解决PHP中的内存管理问题。

C.

i've read that php doesn´t scale well if a lot of users are using your comet implementation?

Where?

There's a lot of nonsense published about scaling and programming languages.

Certainly there are isues with using PHP for comet - but nothing to do with concurrency, other than the fact that comet does not scale well (a non-coment web based app is not limited by the number of concurrent sessions, and uses less memory).

The main consideration is memory-management: PHP was designed for request-reply type operation - where all the data can be cleared down between iterations. If you are writing OO code in your server, then you should definitely think about using the circular reference checker.

what is a socket server and does it fix that problem?

err....you don't know? A socket server is a generic description of a server which uses sockets to communicate - e.g. a webserver, a mail server a file server....

Although it's possible to implement a socket server in PHP (or in many other languages) it doesn't the address the memory management problem in PHP.

C.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文