LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Tip about using Memcache with LSAPI

Litespeed attempts to make starting up very fast, and it does so by initializing Rails framework in a parent process, then doing the fork. That way, all that disk-scouring to find all the rails files, which takes about 6 seconds of heavy iowait, is only done once.

However it also means that any connections you initialize will also be shared among child processes.

Database connections - the LSAPI parent process explicitly disconnects after loading, so they’ll be re-initialized for each child.

Memcache connections you need to do yourself. I do so at the bottom of my environment.rb (I’m using memcache-client, which sets a global CACHE):

CACHE.reset

Thanks for our forum user fantasydreaming contributing this tip. 8-)

 
litespeed_wiki/rails/memcache.txt · Last modified: 2007/03/24 17:42 by mistwang
 
© Copyright 2003-2007 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.