PHP + Comet (long-polling) scaling / hosts

寵の児 提交于 2019-12-04 22:32:22

问题


I have developped an application using PHP/MySQL which used comet technology, presicely long-polling. The proof of concept works great, but I am expecting traffic to quickly reach thousands of simultanous connections = thousands of open connections on the webserver.

I do not have the ability to setup my own server (e.g. using lighttpd), and usually rely on simple 5$/month PHP hostings for other web projects. However, I realize those won't do the trick as they are not meant to support such a high number of simultanous open connections.

What are my other options? I could not find any host specialized in comet applications.

Thanks


回答1:


you would be better of with dedicated server, which will be more expensive, but it will do the job, i personally like 1and1.co.uk, and if your in america 1and1.com

hope that helps!!




回答2:


I've been in the same situation as you, and just decided to go with a dedicated server, where I would then install Nginx and the Push Module. This was a real-time chat for a newspaper's website, and it has worked great so far. Apache will go under real quick as Jon mentions, while nginx performs great, and the push module is as simple as it gets. Good luck!




回答3:


Yeah Apache isn't designed to be used with many open connections. You may want to look into running cometd on top of Jetty. You will have to do some programming in Java, but you would still be able to do all your web requests in php. You might be able to find a Java/Jetty and PHP web host.

I'd like to see what other solutions people have.




回答4:


I have read that Apache does not handle well many open connections to server. Many people recommend nginx or StreamHub Comet Server (Python):

Python Comet Server

http://ajaxpatterns.org/HTTP_Streaming

Or you can use complete Comet Framework (works with PHP): http://www.ape-project.org/



来源:https://stackoverflow.com/questions/4372003/php-comet-long-polling-scaling-hosts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!