tag:blogger.com,1999:blog-7760753019966991240.post7210656859174970515..comments2023-02-08T21:19:06.114-08:00Comments on Alecco Locco: A Gazillion-user Comet Server With libevent, Part 0Alecco Loccohttp://www.blogger.com/profile/02688489614138537585noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-7760753019966991240.post-52880369787859298882010-11-17T10:08:14.265-08:002010-11-17T10:08:14.265-08:00Hi,
Take a look at http://migratory.ro where we&#...Hi,<br /><br />Take a look at <a href="http://migratory.ro" rel="nofollow">http://migratory.ro</a> where we've published recently the new benchmark of Migratory Push Server.<br /><br />We achieved with Migratory Push Server data streaming up to 1 million users and almost reached 1Gbps b/w with under 100 milliseconds end-to-end data latency on a small server (Dell SC1435 2 x dual-core @2GHz + 16 GB RAM). Benchmark document available at:<br /><br /><a href="http://migratory.ro/data/MigratoryPushServerBenchmarks.pdf" rel="nofollow">http://migratory.ro/data/MigratoryPushServerBenchmarks.pdf</a><br /><br />MihaiUnknownhttps://www.blogger.com/profile/16673700563233514402noreply@blogger.comtag:blogger.com,1999:blog-7760753019966991240.post-63005281000947881392010-02-01T12:50:01.549-08:002010-02-01T12:50:01.549-08:00@StreamHub Team - that makes no sense. You don'...@StreamHub Team - that makes no sense. You don't need ephemeral ports for inbound connections. You need them for outbound connections.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7760753019966991240.post-65433641445961332172009-09-01T20:19:56.866-07:002009-09-01T20:19:56.866-07:00@Mark
I'm sorry that's the lost code but ...@Mark<br /><br />I'm sorry that's the lost code but on a quick glance on test/regress_http.c it seems it was with something along the lines of:<br /><br /><b>event_once</b>(-1, <b>EV_TIMEOUT</b>, http_chunked_trickle_cb, state, &when);<br /><br />Note <b>EV_TIMEOUT</b>. From the man page <b>event(3)</b>:<br /><br /><b>event_once</b>(int fd, short event, void (*fn)(int, short, void *), void *arg, struct timeval *tv);<br /><br />This call flushes. The code on test/* is very good to get a starting skeleton for your code! Niels did a great job, as usual :)<br /><br />[Note: code looks horrible because Blogger doesn't allow <pre> in comments.]<br /><br /><b>Please let me know how it goes</b>. Don't hessitate to send me an email!<br /><br />Cheers.<br /><br />AleccoAlecco Loccohttps://www.blogger.com/profile/02688489614138537585noreply@blogger.comtag:blogger.com,1999:blog-7760753019966991240.post-34236580304237371272009-09-01T18:52:09.374-07:002009-09-01T18:52:09.374-07:00Hi,
I'm doing as what you set out to do, writ...Hi,<br /><br />I'm doing as what you set out to do, write a comet server using libevent. The one thing I'm banging my head on is how to send back responses from the server, using libevent calls. I can use the chunk calls, evhttp_send_reply_start(), evhttp_send_reply_chunk() & evhttp_send_reply_end(), but they don't appear to flush the write buffer. What calls were you going to use to send back responses to the browser? Thanks!Unknownhttps://www.blogger.com/profile/13454921698730814720noreply@blogger.comtag:blogger.com,1999:blog-7760753019966991240.post-17779177851229614512009-07-21T08:29:47.227-07:002009-07-21T08:29:47.227-07:00Not bad for so little code. Event-driven network ...Not bad for so little code. Event-driven network IO is definitely the only way to get the scalability. We use Java NIO for <a href="http://www.stream-hub.com/" rel="nofollow">our Comet server</a>. On a single machine we found we could get as many clients as free ports, so circa 64000. To get more clients than that we had to implement a cluster. We found it was best to have 10000-30000 clients per cluster-node or the message latency would go up too much.<br /><br />Its interesting how a lot of people are now talking about using Erlang and other languages built for concurrency. We will definitely be watching how that develops. However, we've found one of the limiting factors in getting big Comet scalability is the Operating Systems TCP/IP implementation. You may be able to get better results by increasing the TCP buffer sizes on Linux. Different languages often end up making the same OS system calls anyway whether it be BSD, WinSock or Posix...StreamHub Teamhttps://www.blogger.com/profile/05639361016094370609noreply@blogger.comtag:blogger.com,1999:blog-7760753019966991240.post-62041493273706087092008-10-30T08:48:00.000-07:002008-10-30T08:48:00.000-07:00Hi,Nice work. Just to clarify some things on Liber...Hi,<BR/><BR/>Nice work. Just to clarify some things on Liberator.<BR/><BR/>We have benchmarked up to 30,000 concurrent clients on a single server. Client side load balancing is generally for redundancy or if you want even more clients. The 30,000 top figure or '1 million updates to 10,000 clients' suite-spot are both on single servers (multi threaded not multi process)<BR/><BR/>Liberator uses our own event manager which i believe works similarly to libevent, and makes use of epoll, /dev/poll, poll, select etc as appropriate.<BR/><BR/>I have never tried to push it further than 30,000 clients, i assumed 16bit port numbers would limit you to 32k or 64k - and since our business case never really needed higher numbers i never investigated if it that was the case of if there were ways around it.<BR/><BR/>Looking forward to seeing any further developments you have, sadly i dont have time to try out these things as much as when I first implemented Liberator.Martin Tylerhttps://www.blogger.com/profile/13759697889909116267noreply@blogger.comtag:blogger.com,1999:blog-7760753019966991240.post-89154232899775466282008-10-30T06:58:00.000-07:002008-10-30T06:58:00.000-07:00@madssj you have to consider that the Erlang garba...@madssj you have to consider that the Erlang garbage collector does not work in the same way the Java GC used to work. In Erlang you never have a need to "stop the world" during garbage collection as the heaps are per process.Unknownhttps://www.blogger.com/profile/04275650041583817414noreply@blogger.comtag:blogger.com,1999:blog-7760753019966991240.post-28021543670600415762008-10-28T18:59:00.000-07:002008-10-28T18:59:00.000-07:00For a JSON Parse, consider using libjsox:http://co...For a JSON Parse, consider using libjsox:<BR/><BR/>http://code.google.com/p/libjsox/<BR/><BR/>It tends to work quite well, and doesn't force an object model on to you.<BR/><BR/>(Though its much simpler, like SAX vs DOM XML Parsers, but using it you can build your own objects).<BR/><BR/>-Paulpaul.quernahttps://www.blogger.com/profile/14902860346092995007noreply@blogger.comtag:blogger.com,1999:blog-7760753019966991240.post-50896146883730505912008-10-27T12:35:00.000-07:002008-10-27T12:35:00.000-07:00@Michael CarterThanks :)@CollinI'll definitely hav...<B>@Michael Carter</B><BR/><BR/>Thanks :)<BR/><BR/><B>@Collin</B><BR/><BR/>I'll definitely have a look.<BR/><BR/><B>@madssj</B><BR/><BR/>Liberator and others scale by client-side load balancing, as in picking a server out of a pool. I didn't get to horizontal or vertical scaling yet, but a simple idea could be to have the server could know if it is slave (configuration or runtime parameter) to subscribe up the channels it has clients in... Using libevent and Comet :)<BR/><BR/>About Erlang, I have the utmost respect for them, though I don't agree with their scaling arguments. For example having garbage collection often means picking to waste a ridiculous amount of memory on discarded objects (and wait for the best moment to run GC) or kill the CPU cache every time the GC is called (like that hibernate thing seems to do.) I don't know Erlang internals so this is just an educated guess, take it with a grain of salt.<BR/><BR/><B>@Stephan.Schmidt</B><BR/><BR/>This is "Part 0" with a mock up, so it is a "hello world" example. The idea of this first post was to get an idea of what we should expect later on. <BR/><BR/>The code is right there, the purpose is to see how fast plain libevent would be and how much memory it'll take. But I have to bite my tong and spare the spoilers :)Alecco Loccohttps://www.blogger.com/profile/02688489614138537585noreply@blogger.comtag:blogger.com,1999:blog-7760753019966991240.post-85413510350166150422008-10-27T02:25:00.000-07:002008-10-27T02:25:00.000-07:00"44,000 requests per second"Real requests or simpl..."44,000 requests per second"<BR/><BR/>Real requests or simple-doing-nothing-requests?<BR/><BR/>http://mailinator.blogspot.com/2008/08/benchmarking-talkinator.html<BR/><BR/>Because Talkinator "on my quad-core desktop the talkinator server can push about 39000 messages per second."<BR/><BR/>And<BR/><BR/><I>"Keep in mind this is processed messages as in decoded, packaged, and queued for particular recipients. (I often see claims of people sending millions of messages per second on various non-chat systems - this is quite easy if you don't have an incoming request to parse and are sending one-to-one endpoints - simply fill a 10G buffer with pre-formatted messages, start the timer, and hit "send" - basically your CPU is doing nothing and all you're measuring is the speed of your network)."</I><BR/><BR/>Peace<BR/>-stephanStephan.Schmidthttps://www.blogger.com/profile/03845125686370893937noreply@blogger.comtag:blogger.com,1999:blog-7760753019966991240.post-8426225745687679422008-10-27T01:23:00.000-07:002008-10-27T01:23:00.000-07:00Nice!How would you scale it to more than one machi...Nice!<BR/><BR/>How would you scale it to more than one machine though?<BR/><BR/>I think that's one of the reasons that many implementations use erlang. Scaling there is "free".Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7760753019966991240.post-83173593476368268232008-10-26T23:21:00.000-07:002008-10-26T23:21:00.000-07:00I'd consider the strategy employed by the orbited....I'd consider the strategy employed by the orbited.org project.<BR/><BR/>They are emulating a feature of HTML5, Web Socket, over HTTP in current browsers.<BR/><BR/>This let's them be forward compatible and lets us leverage existing protocols without having to figure out how to implement XMPP over Bayeux over HTTP or build some convoluted Bayeux to IMAP agent.<BR/><BR/>Give me a socket and a protocol and I'll move the earth, or something like that.Collinhttps://www.blogger.com/profile/11168270330036893286noreply@blogger.comtag:blogger.com,1999:blog-7760753019966991240.post-54109716898402488752008-10-26T23:19:00.000-07:002008-10-26T23:19:00.000-07:00Impressive work. More please! =)I couldn't find yo...Impressive work. More please! =)<BR/><BR/>I couldn't find your email anywhere -- I don't suppose you could drop me a line sometime? My email is CarterMichael@gmail.comUnknownhttps://www.blogger.com/profile/04840627424816383146noreply@blogger.com