[OpenSIPS-Users] [NEW]memcached implementation for memory caching

Brett Nemeroff brett at nemeroff.com
Wed Jul 15 16:34:27 CEST 2009


Thanks! This is great!-Brett


On Wed, Jul 15, 2009 at 8:57 AM, andrei dragus <andreidragus at yahoo.com>wrote:

>
>
> Hello,
>
> A new module that provides a new caching method using memcached servers was
> added.
> It provides a way to access memcached servers using the existing memcache
> API.
>
> Advantages over the existing "localcache" module:
>        - memory costs are no longer on the server
>        - many servers may be used so the memory is virtually unlimited
>        - the cache is persistent so a restart of the server will not affect
> the cache
>        - memcached is an open-source project so it can be used to exchange
> data with various other applications
>        - servers may be grouped together (e.g. for security purposes : some
> can be inside a private network, some can be in a public one).
>
> Limitations:
>        - keys (in key:value pairs) may not contain spaces or control
> characters
>
> Requirements:
>        - libmemcahed is a dependency of the module ( see docs)
>        - memcached servers must exist somewhere accessible via the network.
>
> Usage:
>        - memcached module must be loaded
>        - server parameters must be set
>        E.g:
>
>        ...
>        modparam("memcached", "server","group1 = localhost:9999,127.0.0.1"
> );
>        modparam("memcached", "server","y = random_url:8888" );
>        ...
>        This creates two groups of servers( one called "group1" and one
> called "y").
>
>
>        - Calls to the two groups will be done via the memcache API by
> passing the first parameter as "memcached_($GROUP_NAME)".
>        E.g:
>
>        ...
>        cache_store("memcached_group1","key","$ru value");
>        ...
>        This stores "key"="$ru value" on the group denoted by "group1".
>        The key is only stored on one of the servers in a consistent fashion
>    (subsequent calls with "key" will be stored, deleted from the same
> server).
>
>
>        ...
>        cache_fetch("memcached_y","key",$avp(i:10));
>        cache_remove("memcached_y","key");
>        ...
>        This attempts to fetch/remove key from the group named "y".
>
> Thanks, Andrei.
>
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090715/1beff8e9/attachment.htm 


More information about the Users mailing list