For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > June 2007 > Memcache'ing of ip prefixes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Memcache'ing of ip prefixes
Fangorn

2007-06-27, 4:13 am

Hi,

My situation is as
follows:

I have a list of ip prefixes with assigned AS numbers. I
aggregated
them, so there are ~120000 of them (prefixes, not as numbers :) ).
I
need to look them up real quick, so I use Net::Patricia and it does
the
job well,
but...

I have multiple processes using the data, and multiple
machines
running the same processes. As the data takes ~20MB in memory, it's
a
little inconvinient to multiply it more than 100
times.

So I thought: MEMCACHE. Or something like this. But it seems
that
memcache is actually suitable for simple key-value assignments, and
I
have no idea how I could use it to store my Net::Patricia
object.

So - my questions
are:

1. Is there a way to store what I already have in memcache and share
it
among
processes?

2. If not - what would be a good way to store ip prefixes, where
good
means: speed efficient (less than one second lookup times!) and
easily
cachable, preferably in memcache, but a 'host only' cache would
be
acceptable.

Let's assume an sql-database is not an option here. Nor is rbldnsd
and
dns txt queries.

--
Best regards,
Daniel
daniel@siechniewicz.com

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com