Re: [Cppcms-users] CppCMS as Comet Server
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-12-27 21:55:17
|
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 > > > |