TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Fast polling using C, memcached, nginx and libevent

49 点作者 bsaunder超过 14 年前

5 条评论

amix超过 14 年前
It should be noted that this post was written over one year ago and we are not using polling any longer, but comet solution.<p>We wanted to do realtime notifications and polling isn't a way to do this. We tried different options and in the end wrote our own comet solution using JBoss Netty. Working with JBoss Netty was really great, but we hit perfomance limits on lots of open connections (100.000+).<p>At that time node.js was released and I did some experiments with it and found it it had great perfomance and very low memory footprint. I also had an university course on the V8 VM (by the actual Google team :)) so I was pretty interested in V8 and node.js at that time. I experimented more with this and eventually we rewrote our comet solution to node.js<p>Fast forward today we are still running node.js and processing many millions notifications each day. I would recommend digging into node if you are interested in building a scaleable notification system. Our comet implementation for node.js is under 1 KLOC.<p>Other posts you might be interested in:<p>* <a href="http://amix.dk/blog/post/19484#Comet-with-node-js-and-V8" rel="nofollow">http://amix.dk/blog/post/19484#Comet-with-node-js-and-V8</a><p>* <a href="http://amix.dk/blog/post/19456#Plurk-Comet-Handling-of-100-000-open-connections" rel="nofollow">http://amix.dk/blog/post/19456#Plurk-Comet-Handling-of-100-0...</a><p>* <a href="http://amix.dk/blog/post/19489#Comet-long-polling-for-all-browsers-using-ScriptCommunicator" rel="nofollow">http://amix.dk/blog/post/19489#Comet-long-polling-for-all-br...</a>
评论 #1727982 未加载
评论 #1728225 未加载
评论 #1730504 未加载
评论 #1728113 未加载
xtacy超过 14 年前
What is the bottleneck here? I am surprised that the CPU utilisation is just 2%, which means, either the disk or the network is the bottleneck. Both these aren't discussed. And of course, one shouldn't forget the fact that if CPU is the bottleneck, we need "true" concurrency and there should be threads on every single core. :-)
评论 #1728057 未加载
aiurtourist超过 14 年前
Check the second comment on that post. I'm glad someone else looked at that guy's C and thought "Whoooaaa, oh no."<p>How can we take posts like this seriously?
评论 #1727617 未加载
评论 #1727448 未加载
jcsalterego超过 14 年前
It was nice to see zedshaw reviewing C code in the comments there.
评论 #1729498 未加载
评论 #1730481 未加载
BenSchaechter超过 14 年前
I'm interested to hear other peoples' thoughts on comet versus polling. I've done polling solutions before and am in the process of setting up a comet based solution.<p>In my opinion, having fewer requests to the server is better. But if someone can combat me on this, I'd really be interested in hearing another voice.