44 points · by niels · 17y ago · 38 comments
It may be that since twisted(python) can only use one cpu effectively per interpreter(GIT et al) that it got left behind java which can easily use multiple CPUs for threads.
A slightly different architecture might be required then where multiple python processes are used.
Most of the problems we have seen have been related to the database. It was and still is the biggest bottleneck. And all the people I know that drive big sites will confirm this.
This all said, one should evaluate problems and not blindly use Python for everything. Python is a great language, but some other language is a better choice for some problems. And here Java and specially Java's NIO library is a much better choice for doing a server that should handle tons of open connections.
Because of GIL, there is no point of using multiple threads in Python. Scaling must be done through adding more processes. Than an IPC communication starts to be an issue - that's what messaging middleware is for. The sooner you integrate messaging with your project - the better.
Once you have a messaging platform - comet can be done in any technology you prefer, it really doesn't matter. That's because the scaling complexity is handled by the message broker.
I have faith that Comet will have its day eventually, but clearly it's not quite time. With the current crop of production quality web servers, handling 100k requests per second (polling) is a solved problem. Keeping 100k simultaneous connections alive (comet) is by no means solved. It'll be cool when it happens though.
??? Many many big sites are already using comet, and have been for some years, so I'm not sure I understand your comments.
If you're small and need to use off-the-shelf tech to get your thing up and running quickly, you're still best off going with Polling today.
A quick example would be to look at Thinkature vs. Twiddla. They had a team of two, one of which spent an entire year building a web server from the ground up so that they could use Comet. Twiddla only has me as a developer, and I'd rather spend my time improving the product, so we use Polling.
One year later, Twiddla has a ~300ms lag between when you draw a line and when it appears on a remote screen, whereas Thinkature is out of business. I don't think it's that black and white of a tradeoff, but hopefully you see the thrust of what I'm saying.
One day soon, there will be a mod_comet for Apache, or IIS 9 with Comet support built in. That will be the day it makes sense for small, lean teams to build a business around it.
Obviously you have to decide how important things are to your success, and decide if you should build it yourself, or use some existing code out there. For me, it was a no brainer decision.
mod_comet is missing the point. Apache is the issue when using comet. Apache is what needs fixing/replacing.
If Mibbit was using polling, my bandwidth bill would be through the roof.
axod does mibbit by himself, we(hypernumbers) use comet and are a small team, meebo used comet from the start.
there really isnt much of a barrier with comet, it was actually a hell of a lot easier than the flash sockets setup I implemented before it.
* probably worth mentioning facebook used mochiweb for their chat (off the shelf), I do find it hard to believe the only lightweight webservers around are in erlang
SUPPORT :: On top of the speed Java has a supported hardware stack (Solaris). So if doing 100K connections is important to you, you can find engineers who can diagnose difficult problems on your whole stack.
--------------
[1] http://www.youtube.com/watch?v=37NaHRE0Sqw at 23:23 . Java is quick without Kilim too, this is just an example with stats.
Has anybody tried comet using Yaws?
I'd agree, Java+NIO is a great system. Extremely fast+scalable.
I don't know of anything else built in.
How much memory and CPU is required to simply hold open the connection and sit there is definitely of interest to people. Of course, I'd like to see real world tests too, but that might be rather difficult to pull off without specially written, extremely efficient code on the test side.
AFAIK douban.com seems to be the largest (pure) Python site.
Here's the mail sent about two years back to the quixote users list: http://mail.mems-exchange.org/durusmail/quixote-users/5657/
Some of that gotta add some fat; which might be OK for the great majority of the people, but the few who need raw performance might end up cutting some bacon off.
That dude at amix.dk actually knows his stuff.
If I was doing it For Realz™ I reckon Erlang would be the go, still haven't gotten up to anywhere near that level of proficiency though. 37Signals recently rewrote their push server in Erlang and reported great results.
It seems like yet another attempt to put some more air into java's bubble.