PHP + Comet (long-polling) scaling / hosts
Asked Answered
T

4

6

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

Teleran answered 6/12, 2010 at 23:22 Comment(0)
J
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!!

Jonejonell answered 6/12, 2010 at 23:27 Comment(2)
The use of a dedicated server won't fix the problem. The problem is the choice of web server.Sontich
Right, as Matt said this is similar to what I currently have. It will not scale to 1000s of concurrent open connections.Teleran
S
1

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!

Sleepless answered 12/12, 2010 at 22:7 Comment(2)
Thanks for the suggestion. How many simultaneous connections are you able to handle using the Push Module w/ NGinx? I am also building a real-time chat system.Teleran
We've tested with up to 200+ dummy connections on a Mediatemple (dv) server, with Apache serving the front end. It scales pretty well out of the box.Sleepless
B
0

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.

Befriend answered 6/12, 2010 at 23:30 Comment(0)
D
0

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/

Dingdong answered 6/12, 2010 at 23:36 Comment(1)
Thanks. I looked into similar options, but I would have to be the one hosting those production servers right? I could not find someone providing that kind of "specialized" hosting.Teleran

© 2022 - 2024 — McMap. All rights reserved.