This project is read-only.

Project Description
Miramemcachedsession is a pure memcached based implementation of a .net SessionStateProvider. This can be used in load-balanced environments with short lived sessions. This provider should only be used in very specific scenarios. It's developed in the c# language.

The memcached session provider should be used very carefully and only in specific setups. Always use a separate memcached instance / cluster to separate session data from cache data. Since session data is more critical than cache. This article explains why one shouldn't use memcached as a sessionstore
Internally the api requires that session data needs to get locked for the duration of a request, we solved this by using a lockkey in memcached. This should cover most race conditions.


- application name : you can configure multiple applications to use the same memcached instance / cluster for session data. It is essential to provide a unique applicationname.
- lock timeout: The maximum duration that a process can lock the session data, this should be configurated at MIN(sessiontimeout, requesttimeout)


<?xml version="1.0"?>
    <sectionGroup name="mirabeau">
      <!-- This section must be used to configure the sessionstate provider, do not use this section for normal caching. -->
      <section name="memcachedsessionstate" type="Enyim.Caching.Configuration.MemcachedClientSection, Enyim.Caching" />
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
    Use this section as a template if you're connecting to regular memcached servers.
    Note: you must have the section if you're using the parameterless constructor of EnyimMemcachedClient.
    <!-- you can use protocol="Text" if your memcached is < 1.3 but you should probably upgrade -->
    <memcachedsessionstate protocol="Binary">
        <!-- make sure you use the same ordering of nodes in every configuration you have -->
        <add address="" port="11211" />
        <!--<add address="" port="20004" />
        <add address="" port="20006" />
        <add address="" port="20008" />-->
      <socketPool minPoolSize="10" maxPoolSize="100" connectionTimeout="00:10:00" deadTimeout="00:00:10" />
      <locator type="Enyim.Caching.Memcached.KetamaNodeLocator, Enyim.Caching" />
      <keyTransformer type="add your type here" />
      <transcoder type="add your type here" />
      <!-- uncomment the section below if your memcached instance requires authentication 
      <authentication type="Enyim.Caching.Memcached.PlainTextAuthenticator" zone="AUTHZ" userName="USER NAME" password="PASSWORD" />
        <add name="MemcachedSessionProvider"

Last edited Oct 29, 2010 at 9:52 AM by Ruzzie, version 5