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
|
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... |
From: Sab <rim...@gm...> - 2012-12-20 12:36:32
|
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 |
From: Artyom B. <art...@ya...> - 2012-12-19 07:51:16
|
One small note: I don't think there should be a big problem to change fastcgi connector to handle authorizer requests. I think it should be enough to accept role == FCGI_AUTHORIZER in addition to role == FCGI_RESPONDER in fastcgi_api.cpp line 440) but you should be aware of the following fastcgi specs: The Authorizer application receives HTTP request information from the Web server on the FCGI_PARAMS stream, in the same format as a Responder. The Web server does not send CONTENT_LENGTH, PATH_INFO, PATH_TRANSLATED, and SCRIPT_NAME headers Which makes it quite useless for control of specific files as PATH_INFO and SCRIPT_NAME are critical for content detection. 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: Wednesday, December 19, 2012 9:36 AM >Subject: Re: [Cppcms-users] Integrated FastCGI module > > >CppCMS does not support "authorizer" FastCGI mode (and honestly I'm not aware of any framework that does, correct me if I wrong). > >authorizer FastCGI request is quite unusual one and not frequently used. > > >Quoting original main > >> HTTP-Requests and allow or deny them according to the rights of the currently logged in user." > >Usually user management is done using session cookies. Can you explain what are you trying to do, maybe >it can be done withoutusing lighttpd/fastcgi authorization module? > >For example if you want to serve some static files according to some permissions, there are other ways to do it. > >Also if you must to use fastcgi authorizer (which is basically simple responder with status for authorization requests) you can start a speparate thread and use libfastcgi directly, see: > >http://www.fastcgi.com/devkit/examples/authorizer.c > > > >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: Tuesday, December 18, 2012 4:51 PM >>Subject: Re: [Cppcms-users] Integrated FastCGI module >> >>Thanks for the answers. >> >>I built the hello word app and configured my Lighty to look for the application >>on port 9000 as a FastCGI module. It seems to work fine, the main function gets >>called and I can send a response back to the server. So that looks just fine. >> >>But as soon as I configure Lighty to run in authorizer mode, my application does >>not receive the request. As far as I understand the authorizer mode, the server >>should first send the request to the FastCGI module, the module should decide if >>the access is granted or not and return accordingly a 200 or 401 as status in >>the response. But I don't receive the request in my CppCMS app. According to the >>server's error.log, the fastcgi module is called and it returns immediately with >>no further comment, so it goes on to find the physical path (which in my case >>does not exists but that shouldn't be the reason not to execute the FastCGI >>function). >> >>What am I doing wrong? >> >>My config.js: >>{ >> "service" : { >> "api" : "fastcgi", >> "port" : 9000, >> "ip" : "127.0.0.1" >> } >>} >> >>The critical parts of my lighttpd.conf: >>server.modules = ( >> "mod_access", >> "mod_alias", >> "mod_compress", >> "mod_redirect", >> "mod_accesslog", >> "mod_fastcgi", >> "mod_rewrite" >>) >> >>fastcgi.server = ( >> "" => >> (( "host" => "127.0.0.1", >> "port" => 9000, >> "check-local" => "disable", >> "docroot" => "/", >> "mode" => "authorizer" >> )) >>) >> >>This is my error.log: >> >>2012-12-18 13:15:16: (request.c.304) fd: 8 request-len: 406 >>GET /test24 HTTP/1.1 >>Host: localhost >>User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.16) Gecko/20120511 >>Iceweasel/3.5.16 (like Firefox/3.5.16) >>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 >>Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 >>Accept-Encoding: gzip,deflate >>Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 >>Keep-Alive: 300 >>Connection: keep-alive >> >>2012-12-18 13:15:16: (response.c.241) run condition >>2012-12-18 13:15:16: (response.c.300) -- splitting Request-URI >>2012-12-18 13:15:16: (response.c.301) Request-URI : /test24 >>2012-12-18 13:15:16: (response.c.302) URI-scheme : http >>2012-12-18 13:15:16: (response.c.303) URI-authority: localhost >>2012-12-18 13:15:16: (response.c.304) URI-path : /test24 >>2012-12-18 13:15:16: (response.c.305) URI-query : >>2012-12-18 13:15:16: (response.c.349) -- sanatising URI >>2012-12-18 13:15:16: (response.c.350) URI-path : /test24 >>2012-12-18 13:15:16: (mod_access.c.135) -- mod_access_uri_handler called >>2012-12-18 13:15:16: (mod_fastcgi.c.3636) handling it in mod_fastcgi >>2012-12-18 13:15:16: (response.c.470) -- before doc_root >>2012-12-18 13:15:16: (response.c.471) Doc-Root : /var/www >>2012-12-18 13:15:16: (response.c.472) Rel-Path : /test24 >>2012-12-18 13:15:16: (response.c.473) Path : >>2012-12-18 13:15:16: (response.c.521) -- after doc_root >>2012-12-18 13:15:16: (response.c.522) Doc-Root : /var/www >>2012-12-18 13:15:16: (response.c.523) Rel-Path : /test24 >>2012-12-18 13:15:16: (response.c.524) Path : /var/www/test24 >>2012-12-18 13:15:16: (response.c.541) -- logical -> physical >>2012-12-18 13:15:16: (response.c.542) Doc-Root : /var/www >>2012-12-18 13:15:16: (response.c.543) Rel-Path : /test24 >>2012-12-18 13:15:16: (response.c.544) Path : /var/www/test24 >>2012-12-18 13:15:17: (mod_fastcgi.c.3061) got proc: pid: 0 socket: >>tcp:127.0.0.1:9000 load: 1 >>2012-12-18 13:15:17: (mod_fastcgi.c.1492) released proc: pid: 0 socket: >>tcp:127.0.0.1:9000 load: 0 >>2012-12-18 13:15:17: (response.c.561) -- handling physical path >>2012-12-18 13:15:17: (response.c.562) Path : //test24 >>2012-12-18 13:15:17: (response.c.618) -- file not found >>2012-12-18 13:15:17: (response.c.619) Path : //test24 >>2012-12-18 13:15:17: (response.c.128) Response-Header: >>HTTP/1.1 404 Not Found >>Content-Type: text/html >>Content-Length: 345 >>Date: Tue, 18 Dec 2012 12:15:17 GMT >>Server: lighttpd/1.4.28 >> >>Any suggestions? >> >>Thanks, >>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 >> >> >> >------------------------------------------------------------------------------ >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 > > > |