Install SCache on Ubuntu with PHP
Thursday, December 20, 2012 CST
by: Eric Potvin
Recently, I was looking for a session manager tool (other than memcached and redis) to compare and compare benchmark. I found
Scache is high performance session manager for distributed web applications' session data. SCache provides both persistent and on-demand expiring key-value storage with structured
filesystem-like keyspace for referencing the data.
After reading what they had to say, I got curious and decided to try it.
The installation was easy on Ubuntu. I downloaded their .deb package and that was it.
If you are running a different *nix based OS, you can build it from source.
This comes with the default config but, of course, you can always change it:
sudo vi /etc/scache/scached.conf
and restart the service.
Using scache with PHP
Then I created a simple PHP file to test it.
$SCache = scache_open('a_secret_key');
$key = 'abc';
$scachePath = 'key/' . $key;
$data = scache_get($SCache, $scachePath);
$result = fetch_data($key); // function to fetch your data
scache_set($SCache, $scachePath, $result);
Their complete tutorial is available at: http://scache.nanona.fi/tutorial.html.
You can also use
scache as the session handler. Unfortunately scache's session handler emulation is very poorly tested mostly due to scached original mission to provide more flexible replacement for session handler (handle with care).
; in php.ini
; optionally set connection information
Link to this Article
To link directly to this article from your web site, use one of the following snippets below.
Install SCache on Ubuntu with PHP | Book Of Zeus
<a href="http://www.bookofzeus.com/articles/install-scache-on-ubuntu-with-php/" title="Install SCache on Ubuntu with PHP">Install SCache on Ubuntu with PHP | Book Of Zeus</a>