Out of my Mind...

Random Thoughts From My Sleep Deprived Mind.

    • Edit
    • Delete
    • Autopost

    Configuring Multiple Connection Pools with JRuby MemCache Client

    The JRuby MemCache Client uses Greg Whalin's Java based MemCache client to connect to the servers that implement the MemCache protocol. This client uses a connection pool to connect to and communicate with the memcached servers.

    There is one pool by default. It is called "default". You do not need to specify a pool name if you only need one connection pool. This would happen if you only need to talk to a group of servers.

    This becomes a little more complicated if you need to communicate with multiple memcached server groups for different purposes. A great example would be using both memcached and Kestrel on the same cluster. This is the situation that we find ourselves under on Project Kenai.

    The solution is simple. You can pass a :pool_name parameter when you are building the configuration for the MemCache client:

    <script src="http://gist.github.com/157876.js"></script>

    This results in a separate connection pool being created and allows you to use the JRuby MemCache client to talk to both Kestrel and memcached servers.

    • 29 July 2009
    • Views
    • 0 Comments
    • Permalink
    • Favorited 0 Times
    • Tweet

    Comments 0 Comments

    Leave a Comment

  • Frederic Jean's Posterous

    New father of twins, still catching up on sleep deprivation.

    Aspiring software craftsman with a deep interest in using alternative language on the Java Virtual Machine to simplify and speed up software development.

  • About Frederic Jean

    New father of twins, still catching up on sleep deprivation.

    Aspiring software craftsman with a deep interest in using alternative language on the Java Virtual Machine to simplify and speed up software development.

  • Subscribe

    Subscribe to this posterous
    Unsubscribe
    Follow this posterous RSS
  • Follow Me

Theme created for Posterous by Obox