How can I keep a large list in apache memory

Markus Jelsma markus at
Tue Mar 9 15:37:11 MSK 2010

Storing data in memcache can be done from almost any language available. You 
need to run a memcached server [1] somewhere and connect to it from some 
program. Then you can simply set key/value pairs.

A PHP example:
$m = new Memcache('host');
$m->set('key', 'value');

If you set all your user/IP pairs in the cache, you can then retrieve them in 
your Nginx config. Make sure you have the memc module compiled in. It would 
also be a good idea to compile the eval module; with it, you can store the 
value in a variable.

Then, using that value (the IP address), you can select your backend.


On Tuesday 09 March 2010 13:19:04 ramprasad_ap wrote:
> Can you give me an example how to store an array in memcache
> I am quiet new to ngnix , Do I require any extramodules or is memcache
>  always a part of nignx
> Posted at Nginx Forum:
> _______________________________________________
> nginx mailing list
> nginx at

Markus Jelsma - Technisch Architect - Buyways BV
050-8536620 / 06-50258350

More information about the nginx mailing list