Re: Instiki with SQL backend

Tobias Luetke
Sat, 20 Aug 2005 13:00:53 -0000

Caching in memory has the same problems as madeline. If someone
updates the page you have to somehow invalidate the cache in every
fcgi process.

Caching needs to be backed by something centralized. Ignoring all the
approaches which work but suck (heh) there is basically the file
system and memcached. Memcached is perfect fit for memory caching
because its blazingly fast and offers great features like timed
expiry. The downside is that you will require your users to start and
maintain a memcached server.
Ruling this out this leaves you with the file system, you can either
write out the memory cache as PStore and load it per request or you
just dump the entire html file in the web servers root and save
yourself the trouble.

The beauty about the caches_page approach is that the requests for the
files completely bypass rails. A good web server is able to send the
html form disk to network card using a DMA and bypassing even the CPU.

Hope this helps.

On 8/16/05, Alex Verhovsky <alex-vV7tgcE2N9Nhl2p70BpVqQ@public.gmane.org>
wrote:
> Tobias Luetke wrote:
>
> >Go with caches_page for optimizing, then all you have to really worry
> >about is searching. Thats going to be slow no matter what but at least
> >its going to run against a practically idle database because all the
> >other pages come from static files.
> >
> >
> I hear you. Have a question though.
>
> For the sake of searches, All Pages and especially RSS feeds. Why not
> cache the raw markup, too, and do it in memory? If we only cache the
> last revisions this way, even on something as [relatively] big as
> rubyonrails.org we are probably talking about 2000 pages * 2 kb / page
> =~ 4 Mb of RAM per FastCGI process. Even if I''m somehow off by an
order
> of magnitude, and it''s 40 Mb (for a rather huge wiki),
it''s still not
> unreasonable for an active web site.
>
> Alex
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Tobi
http://typo.leetsoft.com - Open source weblog engine
http://blog.leetsoft.com - Technical weblog