Re: [Cppcms-users] CppCMS as Comet Server
Brought to you by:
artyom-beilis
From: william l. <we...@gm...> - 2012-12-28 01:07:47
|
wow. you do benchmark on a laptop? :) Thanks for the detailed reply, and here is another reference I read about: http://webcache.googleusercontent.com/search?q=cache:2iV4meP2vIMJ:blog.urbanairship.com/blog/2010/09/29/linux-kernel-tuning-for-c500k/+&cd=1&hl=en&ct=clnk&gl=us It mentioned C65K Myth. Actually I expect more connection than that. The more connection I can have per server, the less cost it will be. I will try and see how it comes :) thanks, William L. On Fri, Dec 28, 2012 at 5:54 AM, Artyom Beilis <art...@ya...> wrote: > Actually it is very good questions... > > What is the performance, I did some benchmarks but had not full time to > publish them... > > In general I could easily handle 20,000 connections and send updates (SSE) > using vanila CppCMS code > and broadcast around 50,000 messages per second (i.e. each connection 2.5 > msg/s) > > Having 200-500 connections I could send about 100,000 messages per second. > > This was done using the most stright forward implementation using > event-stream API I had written about it in the blog. > > Now to handle more than 20,000 K connections you need more network > interfaces (ips) (as TCP/IP can't handle theoretically more than 65K > connections in single IP address) which i couldn't check. > > Now when you deal with Comet everything is handled in currently single > event loop one thread. So to scale up today the > easiest is to use prefork mode (more then 1 worker process see > service.worker_processes) > thus you would have several event loops and you can scale them > over multiple CPUs. It would be slower for low loads for much better for > high onces. > > For example using 20,000 connections I could send 120,000 msgs/s i.e. > 6/msg per connection which was quite liner scale up over CPUs on this > particular machine. > > However using prefork with comet would require IPC so you would need to > notify somehow each process on event, but it is must to > have to scale over multiple CPUs and especially over multiple hosts. > > Also in general such benchmarking requires: > > - Tuning TCP/IP stack, make big backlog - very important and setting > appropriate backlog option in application, also make sure you have wide > port range, etc. > - Ensure you have high ulimits to handle many descriptors > > Also I should note that I expect to do some optimization in CppCMS 1.2 to > increase these numbers after some extensive profiling I did > (there is lots of space for improvement) > > All these numbers I got running on Laptop with i5 2.4 GHz 2 cores 4 > threads 4GB RAM (of wich I used quite a few) > > > Regards > > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------ > *From:* william lee <we...@gm...> > *To:* cpp...@li... > *Sent:* Thursday, December 27, 2012 4:22 PM > *Subject:* [Cppcms-users] CppCMS as Comet Server > > Hi, > I'm thinking of using CppCMS to implement a Comet Server for Pushing short > messages to connected users via Http. > > Do you have any ideas from performance perspective, how much connections > CppCMS application can handle at the same time per server? > > The server spec is like 10G RAM, 8Core CPU etc, and http traffic is not > heavy, I'm thinking about keep a connection for 10 mins then release it and > let it reconnect back. > > If anyone have some benchmark result, that will be great! > > Thanks and appreciated > > Happy New Year > William L. > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122712 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122712 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |