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