Thanks! This is great!<div>-Brett</div><div><br><br><div class="gmail_quote">On Wed, Jul 15, 2009 at 8:57 AM, andrei dragus <span dir="ltr"><<a href="mailto:andreidragus@yahoo.com">andreidragus@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
<br>
Hello,<br>
<br>
A new module that provides a new caching method using memcached servers was added.<br>
It provides a way to access memcached servers using the existing memcache API.<br>
<br>
Advantages over the existing "localcache" module:<br>
- memory costs are no longer on the server<br>
- many servers may be used so the memory is virtually unlimited<br>
- the cache is persistent so a restart of the server will not affect the cache<br>
- memcached is an open-source project so it can be used to exchange data with various other applications<br>
- servers may be grouped together (e.g. for security purposes : some can be inside a private network, some can be in a public one).<br>
<br>
Limitations:<br>
- keys (in key:value pairs) may not contain spaces or control characters<br>
<br>
Requirements:<br>
- libmemcahed is a dependency of the module ( see docs)<br>
- memcached servers must exist somewhere accessible via the network.<br>
<br>
Usage:<br>
- memcached module must be loaded<br>
- server parameters must be set<br>
E.g:<br>
<br>
...<br>
modparam("memcached", "server","group1 = localhost:9999,127.0.0.1" );<br>
modparam("memcached", "server","y = random_url:8888" );<br>
...<br>
This creates two groups of servers( one called "group1" and one called "y").<br>
<br>
<br>
- Calls to the two groups will be done via the memcache API by passing the first parameter as "memcached_($GROUP_NAME)".<br>
E.g:<br>
<br>
...<br>
cache_store("memcached_group1","key","$ru value");<br>
...<br>
This stores "key"="$ru value" on the group denoted by "group1".<br>
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).<br>
<br>
<br>
...<br>
cache_fetch("memcached_y","key",$avp(i:10));<br>
cache_remove("memcached_y","key");<br>
...<br>
This attempts to fetch/remove key from the group named "y".<br>
<br>
Thanks, Andrei.<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br></div>