cppcms-users Mailing List for CppCMS C++ Web Framework (Page 66)
Brought to you by:
artyom-beilis
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
(22) |
Mar
|
Apr
(3) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(4) |
Feb
|
Mar
(8) |
Apr
(8) |
May
(8) |
Jun
(36) |
Jul
(63) |
Aug
(126) |
Sep
(47) |
Oct
(66) |
Nov
(46) |
Dec
(42) |
| 2011 |
Jan
(87) |
Feb
(24) |
Mar
(54) |
Apr
(21) |
May
(22) |
Jun
(18) |
Jul
(22) |
Aug
(101) |
Sep
(57) |
Oct
(33) |
Nov
(34) |
Dec
(66) |
| 2012 |
Jan
(64) |
Feb
(76) |
Mar
(73) |
Apr
(105) |
May
(93) |
Jun
(83) |
Jul
(84) |
Aug
(88) |
Sep
(57) |
Oct
(59) |
Nov
(35) |
Dec
(49) |
| 2013 |
Jan
(67) |
Feb
(17) |
Mar
(49) |
Apr
(64) |
May
(87) |
Jun
(64) |
Jul
(93) |
Aug
(23) |
Sep
(15) |
Oct
(16) |
Nov
(62) |
Dec
(73) |
| 2014 |
Jan
(5) |
Feb
(23) |
Mar
(21) |
Apr
(11) |
May
(1) |
Jun
(19) |
Jul
(27) |
Aug
(16) |
Sep
(5) |
Oct
(37) |
Nov
(12) |
Dec
(9) |
| 2015 |
Jan
(7) |
Feb
(7) |
Mar
(44) |
Apr
(28) |
May
(5) |
Jun
(12) |
Jul
(8) |
Aug
|
Sep
(39) |
Oct
(34) |
Nov
(30) |
Dec
(34) |
| 2016 |
Jan
(66) |
Feb
(23) |
Mar
(33) |
Apr
(15) |
May
(11) |
Jun
(15) |
Jul
(26) |
Aug
(4) |
Sep
(1) |
Oct
(30) |
Nov
(10) |
Dec
|
| 2017 |
Jan
(52) |
Feb
(9) |
Mar
(24) |
Apr
(16) |
May
(9) |
Jun
(12) |
Jul
(33) |
Aug
(8) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(6) |
| 2018 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(14) |
Jun
(1) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(8) |
Nov
(2) |
Dec
(2) |
| 2019 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
(6) |
Aug
(25) |
Sep
(10) |
Oct
(10) |
Nov
(6) |
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
(7) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(9) |
Oct
(1) |
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2026 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Lee E. <lee...@gm...> - 2012-12-29 21:06:45
|
thanks On Sat, Dec 29, 2012 at 10:59 PM, Artyom Beilis <art...@ya...> wrote: > Of course. When you access a cache and the object in L1 the request is > still sent to a central server > but instead of returing as an ansever that contains the entire object, > only the aknowledgement > that your object is up-to-date is sent. So basically you only may for a > small ping-pong rather > than entire object transfer. > > So it is consistent and transparent as if there were no L1 cache. > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------ > *From:* Lee Elenbaas <lee...@gm...> > *To:* cpp...@li... > *Sent:* Saturday, December 29, 2012 9:57 PM > *Subject:* Re: [Cppcms-users] Cache limit=0 equals unlimited? > > is a ready made mechanism for invalidating L1 cache on one instance of > cppcms from another instance of cppcms when they use cppcms_scale? > without such a mechanism running with L1 & L2 configuration can be > problematic > > > On Thu, Dec 27, 2012 at 2:14 PM, Sergey Shutov <ser...@gm...>wrote: > > Ok. Thank you very much. > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET <http://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 > > > > > -- > -- > lee > Lee Elenbaas > lee...@gm... > > > ------------------------------------------------------------------------------ > 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. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122912 > > _______________________________________________ > 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. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122912 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > -- -- lee Lee Elenbaas lee...@gm... |
|
From: Artyom B. <art...@ya...> - 2012-12-29 21:05:30
|
See, I don't know what exactly the data you have I can suggest: Separete your date into 3 categories: 1. In memory so the access is very fast (think how do you update/invalidate it) also think what is good to keep in memory and what is not 2. In cache what you need, remember that serialization and deserialization may cost as well. 3. Prefer to cache HTML rather than objects (as you save HTML generation) If you have some data that you can prefetch and it is not updated frequently do it. In the application I developed for my clients I use in-memory data structures/in-memory db very intensivly as it makes things faster and easier. But you should keep in mind how would you scale and when (now in near future in far future). Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Lee Elenbaas <lee...@gm...> >To: cpp...@li... >Sent: Saturday, December 29, 2012 9:55 PM >Subject: Re: [Cppcms-users] Big cache > > >since this type of data is already stored in some form of a db - why not get most of this information prepared before hand in the db? >intersection of lists of friends for people who are likely to be used can be kept as a new table, or as an additional column and you can have a ready and waiting index ready for you to iterate over. >the only thing you can not prepare before hand is the online status >i would not go for any already made caching solution as a cure for the problem - i would have created approached it as a data mining problem - and calculate everything possible before hand in the background > > > > >On Thu, Dec 27, 2012 at 2:12 PM, Sergey Shutov <ser...@gm...> wrote: > >Artyom Beilis <artyomtnk@...> writes: >> >> >>> >>> See, you don't cache objects of 500MB in memory...Caching system is designed >> >>for pages and other objects of reasonable sizethat their generation is >>costly,Also remember that saving objects to cache and using it from cache >>involves somememcpy... and than serving.if you want to serve huge files/data >>(and >>cache them) it is much better to use file system for this.Put them on disk and >> >>tell lighttpd, nginx or even apache to serve them, it would do it much >>better.For >>example lighttpd would know to transfer them using sendfile directly from disk >>to >>socketwithout even copying the data to user space. >> >> >> >>Thanks for answer. But i need little bit explain. For example we have social >>network (real big social network). We have 3,4,5,6... million users. >>And we have common friends. >>Algorithm: >> >>1: >>select friend_id from friends where user_id = 1 (10000 rows) >>select friend_id from friends where user_id = 2 (6000 rows) >> >>(without join's) >> >>2: >>std::set_intersection (return data we need caching) >> >>So i need store friends, common friends, online friends etc... >> >> >> >>------------------------------------------------------------------------------ >>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 >> > > >-- >-- >lee >Lee Elenbaas >lee...@gm... > >------------------------------------------------------------------------------ >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. SALE $99.99 this month only -- learn more at: >http://p.sf.net/sfu/learnmore_122912 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Artyom B. <art...@ya...> - 2012-12-29 20:59:29
|
Of course. When you access a cache and the object in L1 the request is still sent to a central server but instead of returing as an ansever that contains the entire object, only the aknowledgement that your object is up-to-date is sent. So basically you only may for a small ping-pong rather than entire object transfer. So it is consistent and transparent as if there were no L1 cache. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Lee Elenbaas <lee...@gm...> >To: cpp...@li... >Sent: Saturday, December 29, 2012 9:57 PM >Subject: Re: [Cppcms-users] Cache limit=0 equals unlimited? > > >is a ready made mechanism for invalidating L1 cache on one instance of cppcms from another instance of cppcms when they use cppcms_scale? >without such a mechanism running with L1 & L2 configuration can be problematic > > > > >On Thu, Dec 27, 2012 at 2:14 PM, Sergey Shutov <ser...@gm...> wrote: > >Ok. Thank you very much. >> >> >> >>------------------------------------------------------------------------------ >>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 >> > > >-- >-- >lee >Lee Elenbaas >lee...@gm... > >------------------------------------------------------------------------------ >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. SALE $99.99 this month only -- learn more at: >http://p.sf.net/sfu/learnmore_122912 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Lee E. <lee...@gm...> - 2012-12-29 19:58:19
|
is a ready made mechanism for invalidating L1 cache on one instance of cppcms from another instance of cppcms when they use cppcms_scale? without such a mechanism running with L1 & L2 configuration can be problematic On Thu, Dec 27, 2012 at 2:14 PM, Sergey Shutov <ser...@gm...>wrote: > Ok. Thank you very much. > > > > ------------------------------------------------------------------------------ > 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 > -- -- lee Lee Elenbaas lee...@gm... |
|
From: Lee E. <lee...@gm...> - 2012-12-29 19:56:01
|
since this type of data is already stored in some form of a db - why not get most of this information prepared before hand in the db? intersection of lists of friends for people who are likely to be used can be kept as a new table, or as an additional column and you can have a ready and waiting index ready for you to iterate over. the only thing you can not prepare before hand is the online status i would not go for any already made caching solution as a cure for the problem - i would have created approached it as a data mining problem - and calculate everything possible before hand in the background On Thu, Dec 27, 2012 at 2:12 PM, Sergey Shutov <ser...@gm...>wrote: > Artyom Beilis <artyomtnk@...> writes: > > > > > > See, you don't cache objects of 500MB in memory...Caching system is > designed > for pages and other objects of reasonable sizethat their generation is > costly,Also remember that saving objects to cache and using it from cache > involves somememcpy... and than serving.if you want to serve huge > files/data > (and > cache them) it is much better to use file system for this.Put them on disk > and > tell lighttpd, nginx or even apache to serve them, it would do it much > better.For > example lighttpd would know to transfer them using sendfile directly from > disk > to > socketwithout even copying the data to user space. > > > > Thanks for answer. But i need little bit explain. For example we have > social > network (real big social network). We have 3,4,5,6... million users. > And we have common friends. > Algorithm: > > 1: > select friend_id from friends where user_id = 1 (10000 rows) > select friend_id from friends where user_id = 2 (6000 rows) > > (without join's) > > 2: > std::set_intersection (return data we need caching) > > So i need store friends, common friends, online friends etc... > > > > ------------------------------------------------------------------------------ > 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 > -- -- lee Lee Elenbaas lee...@gm... |
|
From: Artyom B. <art...@ya...> - 2012-12-28 17:50:35
|
>________________________________ > From: william lee <we...@gm...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Friday, December 28, 2012 3:07 AM >Subject: Re: [Cppcms-users] CppCMS as Comet Server > > >wow. you do benchmark on a laptop? :) Yep >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. > Yes, you are right I've got little bit confused, however it is still hard to benchmark more then 20K concurrent requests as you need many clients on different ip addresses. > >Actually I expect more connection than that. >The more connection I can have per server, the less cost it will be. > So plan it as scalable application and use multiple processes. prefork would work better with many concurrent connections. In any case I don't see specific restrictions given enough memory and configures OS. > >I will try and see how it comes :) > Tell us how did it worked out :-) Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > >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 >> >> > >------------------------------------------------------------------------------ >Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and >much more. Get web development skills now with LearnDevNow - >350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. >SALE $99.99 this month only -- learn more at: >http://p.sf.net/sfu/learnmore_122812 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
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 > > |
|
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 > > > |
|
From: william l. <we...@gm...> - 2012-12-27 14:22:35
|
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. |
|
From: Sergey S. <ser...@gm...> - 2012-12-27 12:14:59
|
Ok. Thank you very much. |
|
From: Sergey S. <ser...@gm...> - 2012-12-27 12:12:32
|
Artyom Beilis <artyomtnk@...> writes: > > See, you don't cache objects of 500MB in memory...Caching system is designed for pages and other objects of reasonable sizethat their generation is costly,Also remember that saving objects to cache and using it from cache involves somememcpy... and than serving.if you want to serve huge files/data (and cache them) it is much better to use file system for this.Put them on disk and tell lighttpd, nginx or even apache to serve them, it would do it much better.For example lighttpd would know to transfer them using sendfile directly from disk to socketwithout even copying the data to user space. Thanks for answer. But i need little bit explain. For example we have social network (real big social network). We have 3,4,5,6... million users. And we have common friends. Algorithm: 1: select friend_id from friends where user_id = 1 (10000 rows) select friend_id from friends where user_id = 2 (6000 rows) (without join's) 2: std::set_intersection (return data we need caching) So i need store friends, common friends, online friends etc... |
|
From: Artyom B. <art...@ya...> - 2012-12-27 08:24:25
|
On the second thought I maybe misunderstood your question. How do you know that cache_limit is 1G? 1. First of all what is the average size of your objects in cache? Set cache_limit = 1G / avr(object_size). 2. There is a process shared cache that uses shared memory and its size is defined by memory size, it is little bit less efficient than thread shared cache because of less efficient memory allocation algorithm (in 1.0.2 but improved in trunk) but in general you should not feel it. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Artyom Beilis <art...@ya...> >To: "cpp...@li..." <cpp...@li...> >Sent: Thursday, December 27, 2012 10:18 AM >Subject: Re: [Cppcms-users] Big cache > > >See, you don't cache objects of 500MB in memory... > >Caching system is designed for pages and other objects of reasonable size >that their generation is costly, > >Also remember that saving objects to cache and using it from cache involves some >memcpy... and than serving. > >if you want to serve huge files/data (and cache them) it is much better to use file system for this. > >Put them on disk and tell lighttpd, nginx or even apache to serve them, it would do it much better. > >For example lighttpd would know to transfer them using sendfile directly from disk to socket >without even copying the data to user space. > >Artyom Beilis >-------------- >CppCMS - C++ Web Framework: http://cppcms.com/ >CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > > >>________________________________ >> From: Sergey Shutov <ser...@gm...> >>To: cpp...@li... >>Sent: Thursday, December 27, 2012 6:44 AM >>Subject: [Cppcms-users] Big cache >> >>Artyom Hi. Did you know about redis db? In one high load project i use redis db >>for caching. I can use native cache in my application? I have this question >>because if i store some 500 MB or 1GB :) and when memory is full it may breaks. >>Or better use cppcms_scale? But how i know how match 500 mb equals cache_limit? >> >> >>------------------------------------------------------------------------------ >>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 > > > |
|
From: Artyom B. <art...@ya...> - 2012-12-27 08:18:28
|
See, you don't cache objects of 500MB in memory... Caching system is designed for pages and other objects of reasonable size that their generation is costly, Also remember that saving objects to cache and using it from cache involves some memcpy... and than serving. if you want to serve huge files/data (and cache them) it is much better to use file system for this. Put them on disk and tell lighttpd, nginx or even apache to serve them, it would do it much better. For example lighttpd would know to transfer them using sendfile directly from disk to socket without even copying the data to user space. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Sergey Shutov <ser...@gm...> >To: cpp...@li... >Sent: Thursday, December 27, 2012 6:44 AM >Subject: [Cppcms-users] Big cache > >Artyom Hi. Did you know about redis db? In one high load project i use redis db >for caching. I can use native cache in my application? I have this question >because if i store some 500 MB or 1GB :) and when memory is full it may breaks. >Or better use cppcms_scale? But how i know how match 500 mb equals cache_limit? > > >------------------------------------------------------------------------------ >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 > > > |
|
From: Artyom B. <art...@ya...> - 2012-12-27 08:13:30
|
No, it means empty or no cache... In case of cppcms_scale, the cache size is defined by the cppcms_scale server, L1 cache size (internal cache) is defined by its size. Description cache system with cppcms_scale can work on two levels L1 the local cache that is validated against the server such that it allows not to transfer data if it is already locally cached. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Sergey Shutov <ser...@gm...> >To: cpp...@li... >Sent: Thursday, December 27, 2012 6:32 AM >Subject: [Cppcms-users] Cache limit=0 equals unlimited? > >Cache limit=0 equals unlimited? Example cppcms_scale > > >------------------------------------------------------------------------------ >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 > > > |
|
From: Sergey S. <ser...@gm...> - 2012-12-27 04:56:16
|
Shiv Shankar Dayal <shivshankar.dayal@...> writes: > > > A suggestion. If your cache is 1g then put some more ram. I do not think anything will break with such a small cache. Yep, i know. But when you store big data in cache it maybe a problem, you know. |
|
From: Shiv S. D. <shi...@gm...> - 2012-12-27 04:47:52
|
A suggestion. If your cache is 1g then put some more ram. I do not think anything will break with such a small cache. On Dec 27, 2012 10:15 AM, "Sergey Shutov" <ser...@gm...> wrote: > Artyom Hi. Did you know about redis db? In one high load project i use > redis db > for caching. I can use native cache in my application? I have this question > because if i store some 500 MB or 1GB :) and when memory is full it may > breaks. > Or better use cppcms_scale? But how i know how match 500 mb equals > cache_limit? > > > > ------------------------------------------------------------------------------ > 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 > |
|
From: Sergey S. <ser...@gm...> - 2012-12-27 04:44:36
|
Artyom Hi. Did you know about redis db? In one high load project i use redis db for caching. I can use native cache in my application? I have this question because if i store some 500 MB or 1GB :) and when memory is full it may breaks. Or better use cppcms_scale? But how i know how match 500 mb equals cache_limit? |
|
From: Sergey S. <ser...@gm...> - 2012-12-27 04:32:32
|
Cache limit=0 equals unlimited? Example cppcms_scale |
|
From: Klaim - J. L. <mj...@gm...> - 2012-12-24 17:24:56
|
On Mon, Dec 24, 2012 at 6:15 PM, Sergey Shutov <ser...@gm...>wrote: > Analysis architectures HL Internet Applications: > Maybe for some people it may be interesting > > http://www.youtube.com/watch?v=aE0yawwB6h4 Unfortunately this is for Russian speakers only. Joel Lamotte |
|
From: Sergey S. <ser...@gm...> - 2012-12-24 17:16:08
|
Analysis architectures HL Internet Applications: Maybe for some people it may be interesting http://www.youtube.com/watch?v=aE0yawwB6h4 |
|
From: Sab <rim...@gm...> - 2012-12-21 11:43:59
|
Oh that's really neat! Works like a charm! Thanks so much for the quick advices. Sab |
|
From: Artyom B. <art...@ya...> - 2012-12-21 09:59:49
|
First of all you can override the main() function of topmost application and check the requests before they are dispatched
for example
void main(std::string url)
{
if(this_is_valid_url_for_the_user(url)) {
// go to standard dispatching mechanism.
cppcms::application::main(url);
}
else {
response().make_error_response(401);
}
}
Also this thread may be helpful as it discuss roughly the same
http://thread.gmane.org/gmane.comp.lib.cppcms.user/691
Artyom Beilis
--------------
CppCMS - C++ Web Framework: http://cppcms.com/
CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>________________________________
> From: Sab <rim...@gm...>
>To: cpp...@li...
>Sent: Friday, December 21, 2012 11:51 AM
>Subject: Re: [Cppcms-users] Integrated FastCGI module
>
>No, these are not static files. The client is a user interface
>of a cluster controller, so the resources are basically funtions
>that either control some hardware or generate an XML result as
>response.
>
>I'm thinking now of using the regular Responder mode and implement
>the authorizer functionality manually, before the request is
>processed. I would like to use the cppcms dispatcher mechanism
>but I'm not sure at which point I would be able to grab the
>request and have the option to reject it (if the user does not
>have sufficient rights).
>
>It would be good to do it at a central point, before the
>dispatcher routes to the processing funtions. I thought that
>the Init() of the object that I can pass to dispatcher::assign
>could be helpful, but can I access the request (e.g. the url)
>at that point and reject the execution of the assigned function
>if the user does not have access right?
>
>Sab
>
>
>------------------------------------------------------------------------------
>LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
>Remotely access PCs and mobile devices and provide instant support
>Improve your efficiency, and focus on delivering more value-add services
>Discover what IT Professionals Know. Rescue delivers
>http://p.sf.net/sfu/logmein_12329d2d
>_______________________________________________
>Cppcms-users mailing list
>Cpp...@li...
>https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
> |
|
From: Sab <rim...@gm...> - 2012-12-21 09:51:27
|
No, these are not static files. The client is a user interface of a cluster controller, so the resources are basically funtions that either control some hardware or generate an XML result as response. I'm thinking now of using the regular Responder mode and implement the authorizer functionality manually, before the request is processed. I would like to use the cppcms dispatcher mechanism but I'm not sure at which point I would be able to grab the request and have the option to reject it (if the user does not have sufficient rights). It would be good to do it at a central point, before the dispatcher routes to the processing funtions. I thought that the Init() of the object that I can pass to dispatcher::assign could be helpful, but can I access the request (e.g. the url) at that point and reject the execution of the assigned function if the user does not have access right? Sab |
|
From: Szabolcs R. <rim...@go...> - 2012-12-21 09:48:41
|
No, these are not static files. The client is a user interface of a cluster controller, so the resources are basically funtions that either control some hardware or generate an XML result as response. I'm thinking now of using the regular Responder mode and implement the authorizer functionality manually, before the request is processed. I would like to use the cppcms dispatcher mechanism but I'm not sure at which point I would be able to grab the request and have the option to reject it (if the user does not have sufficient rights). It would be good to do it at a central point, before the dispatcher routes to the processing funtions. I thought that the Init() of the object that I can pass to dispatcher::assign could be helpful, but can I access the request (e.g. the url) at that point and reject the execution of the assigned function if the user does not have access right? Sab 2012/12/21 Lee Elenbaas <lee...@gm...> > if what you need is to authorize static files - just serve them all > through the CppCMS app to the client > then the cppcms can use headers to serve the files back from the lighty or > return unauthorize response if you need to deny it > > > On Thu, Dec 20, 2012 at 2:36 PM, Sab <rim...@gm...> wrote: > >> True. Simply adding FCGI_AUTHORIZER in fastcgi_api.cpp line 440) worked >> out fine. I get the request and can deny it by returning 401. That's cool. >> >> BUT! >> >> I just can't digest the fact that there is no info about the url in this >> authorize request message! The CONTENT_LENGTH, PATH_INFO, >> PATH_TRANSLATED, >> and SCRIPT_NAME are in fact empty. How stupid is that!?!? You were right: >> this authorizer feature of FastCGI is absolutely useless without knowing >> what the user actually tries to access! >> >> I think I will just use a responder and implement the authorizer myself >> before processing the request. I wanted to keep the authorization >> separated >> from the processing but that will not work out. >> >> Thanks so much for your hints. >> >> Sab >> >> >> >> ------------------------------------------------------------------------------ >> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial >> Remotely access PCs and mobile devices and provide instant support >> Improve your efficiency, and focus on delivering more value-add services >> Discover what IT Professionals Know. Rescue delivers >> http://p.sf.net/sfu/logmein_12329d2d >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > > > > -- > -- > lee > Lee Elenbaas > lee...@gm... > > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
|
From: Lee E. <lee...@gm...> - 2012-12-20 23:23:31
|
if what you need is to authorize static files - just serve them all through the CppCMS app to the client then the cppcms can use headers to serve the files back from the lighty or return unauthorize response if you need to deny it On Thu, Dec 20, 2012 at 2:36 PM, Sab <rim...@gm...> wrote: > True. Simply adding FCGI_AUTHORIZER in fastcgi_api.cpp line 440) worked > out fine. I get the request and can deny it by returning 401. That's cool. > > BUT! > > I just can't digest the fact that there is no info about the url in this > authorize request message! The CONTENT_LENGTH, PATH_INFO, PATH_TRANSLATED, > and SCRIPT_NAME are in fact empty. How stupid is that!?!? You were right: > this authorizer feature of FastCGI is absolutely useless without knowing > what the user actually tries to access! > > I think I will just use a responder and implement the authorizer myself > before processing the request. I wanted to keep the authorization separated > from the processing but that will not work out. > > Thanks so much for your hints. > > Sab > > > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > -- -- lee Lee Elenbaas lee...@gm... |