Why not store the key/value pairs in memcache? This works like charm and
using
Nginx’ memc and eval modules you can retrieve the IP addresses from the
cache
instantly.
On Tuesday 09 March 2010 12:12:06 ramprasad_ap wrote:
$user[‘user2’] = 10.1.1.2;
Is there a way I can load the userlist into memory in apache nginx Info Page
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:
On Tue, 2010-03-09 at 12:08 -0800, James Matthews wrote:
Is there a reason why you don’t want to use a database?
memcached is a database. It’s a key/value store. It’s not a relational database, but the OP’s data isn’t relational, it’s
key/value pairs, which is exactly what memcached was designed to handle.
Regards,
Cliff
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.