Re: [Cppcms-users] Big cache
Brought to you by:
artyom-beilis
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... |