Main

May 21, 2008

Cache::Swifty now on CPAN

Yesterday (the day has just change here in Japan), I uploaded Cache::Swifty to CPAN, a perl frontend for the very fast, memory-mapped cache: swifty.

Although you still have to install swifty manually, I hope it would release the pain of installing a perl module manually.

October 10, 2007

Swifty 0.06

This is a minor bugfix release from Swifty 0.05 and Cache::Swifty 0.05.

Bugs fixed are as follows:

  • fix build problem on i386 systems
  • only set do_refresh flag if the flag is not yet being set
  • handle EINTR when calling flock
  • add destructor (perl only)

September 27, 2007

KeyedMutex - a mutex for web services

Yesterday, I wrote:

Normally, a cache entry has a single lifetime. The problem is that if a cache entry is read frequently and if it takes time to update the entry, a situation known as thundering herd would occur on expiration; i.e. many cache consumers will detect expiration and send same update requests to the backend, causing a performance decline. There are two solutions to the problem:
  • use a proxy that combines identical update requests as a single request
  • initiate an update request prior to expiration, when lifetime being left gets below a certain threshold

Kazuho at Work: Swifty 0.05 and the Thundering Herd

As a complement for the second appoarch I took in Swifty 0.05, I wrote a tiny server that enforces exclusive access to databases. Actually it is not a proxy but works much like a mutex object between processes, but has a slightly different interface to fit into the realities of web services. Here comes the sample code.

Continue reading "KeyedMutex - a mutex for web services" »

September 26, 2007

Swifty 0.05 and the Thundering Herd

This is the release announcement of swifty 0.05.

Changes from previous version (0.03) are:

  • added code to support PowerPC and SPARC (not tested at all)
  • added internal checksum routine to guaranty integrity of cached data
  • added refresh_before property

About the refresh_before property

Continue reading "Swifty 0.05 and the Thundering Herd" »

September 18, 2007

Swifty 0.03

This is the release announcement of swifty version 0.03 and its perl binding Cache-Swifty 0.03.

To install swifty, run configure, make, and make install. To install Cache-Swifty, run perl Makefile.PL, make, and make install. Changes from the previous version are:

  1. change cache model from direct map to n-way set associative (max. of n is 64)
  2. bug fixes
  3. optimizations in perl binding

Continue reading "Swifty 0.03" »

September 12, 2007

Swifty-0.02 and Perl Binding

This is the announcement of swifty version 0.02 and its perl binding Cache-Swifty 0.02.

To install swifty, run configure, make, and make install. To install Cache-Swifty, run perl Makefile.PL, make, and make install. Changes from the previous version are:

  1. added configure script
  2. expiration handling by modification time and a global lifetime property
  3. introduction of perl binding

As part of the perl binding, I created a benchmark comparing swifty and memcached (the benchmark script is included in the perl binding).

Continue reading "Swifty-0.02 and Perl Binding" »

July 30, 2007

swifty - a very fast shared memory cache

For a couple of months while developing my new web service, I have been wondering what would be the most efficient way of caching small data, such as SQL responses or HTML snippets. I looked at Cache::Cache and memcached, but was not satisfied by their design, since I did not have any plans of scaling-out my service to multiple servers, but wanted to squeeze maximum performance out from a single server. So last week, as a little fun while creating my presentation slides for my company, I started to write my own cache library, swifty.

Continue reading "swifty - a very fast shared memory cache" »