C# AppFabric缓存非常密集

C# AppFabric缓存非常密集,c#,windows-server-2012,appfabric-cache,C#,Windows Server 2012,Appfabric Cache,问题:我做错什么了吗?配置设置不正确?AppFabric的内存使用量是否低于正常值 问题:我正在将SQL数据库表中的数据读取到AppFabric缓存中。似乎AppFabric对一个相当小的对象使用了大量内存,我不明白为什么(我最近开始使用ApppFabric,所以我对它很在行) 描述:大约60MB的SQL表在AppFabric缓存中一次转换为大约800MB 详情: 我要加载的表的SQL数据大小: <?xml version="1.0" encoding="utf-8"?> &

问题:我做错什么了吗?配置设置不正确?AppFabric的内存使用量是否低于正常值

问题:我正在将SQL数据库表中的数据读取到AppFabric缓存中。似乎AppFabric对一个相当小的对象使用了大量内存,我不明白为什么(我最近开始使用ApppFabric,所以我对它很在行)

描述:大约60MB的SQL表在AppFabric缓存中一次转换为大约800MB

详情:

我要加载的表的SQL数据大小:

<?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <configSections>
            <section name="dataCache" type="Microsoft.ApplicationServer.Caching.DataCacheSection, Microsoft.ApplicationServer.Caching.Core" />
        </configSections>
         <dataCache size="Small">
<caches>
  <cache consistency="StrongConsistency" name="MobileCache" minSecondaries="0">
    <policy>
      <eviction type="None" />
      <expiration defaultTTL="1" isExpirable="false" />
    </policy>
  </cache>
  <cache consistency="StrongConsistency" name="default" minSecondaries="0">
    <policy>
      <eviction type="Lru" />
      <expiration defaultTTL="10" isExpirable="true" />
    </policy>
  </cache>
</caches>
<hosts>
  <host replicationPort="22236" arbitrationPort="22235" clusterPort="22234"
    hostId="1073911731" size="1000" leadHost="true" account="BGZA\accName"
    cacheHostName="AppFabricCachingService" name="hostname.domain.co.za"
    cachePort="22233" />
</hosts>
<advancedProperties>
<transportProperties connectionBufferSize="131072" maxBufferPoolSize="2147483647" 
                   maxBufferSize="2147483647" maxOutputDelay="2" channelInitializationTimeout="60000" 
                   receiveTimeout="600000"/>
  <securityProperties>
    <authorization>
      <allow users="Rossp0033" />
    </authorization>
  </securityProperties>
</advancedProperties>
<deploymentSettings>
  <deploymentMode value="RoutingClient" />
</deploymentSettings>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="dataCacheClient"
         type="Microsoft.ApplicationServer.Caching.DataCacheClientSection, Microsoft.ApplicationServer.Caching.Core,Version=1.0.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          allowLocation="true"
          allowDefinition="Everywhere"/>
  </configSections>
  <dataCacheClient>
    <hosts>
      <host
         name="HostName.DomainName.co.za"
         cachePort="22233"/>
    </hosts>
    <transportProperties connectionBufferSize="131072" maxBufferPoolSize="2147483647"
                      maxBufferSize="2147483647" maxOutputDelay="2" channelInitializationTimeout="60000"
                      receiveTimeout="600000"/>
  </dataCacheClient>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup> 
</configuration>
public static void ReadPortedNumbers()
{
    MobileDataContext mdc = null;
    List<PortedNumberCollection> col;

    try
    {
        mdc = new MobileDataContext(strConnString);

        col = (from RN in mdc.tblRoutedNumbers
               select Convert(RN)).ToList();

        var CacheFactory = new DataCacheFactory();
        var myCache = CacheFactory.GetCache("MobileCache");

        myCache.Put("PortedNumberCollection", col);

    }
    catch (Exception E)
    {
        throw new System.Exception(E.GetType().ToString() + " in BG.Mobile.DAL.ReadPortedNumbers, Message : " + E.Message, E);
    }
    finally
    {
        if (mdc != null) mdc.Dispose();
    }
}

public static PortedNumberCollection Convert(tblRoutedNumber DataClass)
{
    try
    {
        PortedNumberCollection BusinessClass = new PortedNumberCollection();

        BusinessClass.PortedID = DataClass.PortedID;
        BusinessClass.MSISDN = DataClass.MSISDN;
        BusinessClass.RoutingLabel = DataClass.RoutingLabel;
        BusinessClass.RouteAction = DataClass.RouteAction;

        return BusinessClass;
    }
    catch (Exception E)
    {
        throw new System.Exception(E.GetType().ToString() + " in BG.Bus.Mobile.DALConvertor.Convert(tblRoutedNumber DataClass): " + E.Message);                

    }
}

[DataContract][Serializable]
public class PortedNumberCollection
{
    [DataMember]        
    public Int64 PortedID;

    [DataMember]        
    public string MSISDN;

    [DataMember]        
    public string RoutingLabel;

    [DataMember]
    public string RouteAction;
}   

应用结构空闲内存使用率:

<?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <configSections>
            <section name="dataCache" type="Microsoft.ApplicationServer.Caching.DataCacheSection, Microsoft.ApplicationServer.Caching.Core" />
        </configSections>
         <dataCache size="Small">
<caches>
  <cache consistency="StrongConsistency" name="MobileCache" minSecondaries="0">
    <policy>
      <eviction type="None" />
      <expiration defaultTTL="1" isExpirable="false" />
    </policy>
  </cache>
  <cache consistency="StrongConsistency" name="default" minSecondaries="0">
    <policy>
      <eviction type="Lru" />
      <expiration defaultTTL="10" isExpirable="true" />
    </policy>
  </cache>
</caches>
<hosts>
  <host replicationPort="22236" arbitrationPort="22235" clusterPort="22234"
    hostId="1073911731" size="1000" leadHost="true" account="BGZA\accName"
    cacheHostName="AppFabricCachingService" name="hostname.domain.co.za"
    cachePort="22233" />
</hosts>
<advancedProperties>
<transportProperties connectionBufferSize="131072" maxBufferPoolSize="2147483647" 
                   maxBufferSize="2147483647" maxOutputDelay="2" channelInitializationTimeout="60000" 
                   receiveTimeout="600000"/>
  <securityProperties>
    <authorization>
      <allow users="Rossp0033" />
    </authorization>
  </securityProperties>
</advancedProperties>
<deploymentSettings>
  <deploymentMode value="RoutingClient" />
</deploymentSettings>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="dataCacheClient"
         type="Microsoft.ApplicationServer.Caching.DataCacheClientSection, Microsoft.ApplicationServer.Caching.Core,Version=1.0.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          allowLocation="true"
          allowDefinition="Everywhere"/>
  </configSections>
  <dataCacheClient>
    <hosts>
      <host
         name="HostName.DomainName.co.za"
         cachePort="22233"/>
    </hosts>
    <transportProperties connectionBufferSize="131072" maxBufferPoolSize="2147483647"
                      maxBufferSize="2147483647" maxOutputDelay="2" channelInitializationTimeout="60000"
                      receiveTimeout="600000"/>
  </dataCacheClient>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup> 
</configuration>
public static void ReadPortedNumbers()
{
    MobileDataContext mdc = null;
    List<PortedNumberCollection> col;

    try
    {
        mdc = new MobileDataContext(strConnString);

        col = (from RN in mdc.tblRoutedNumbers
               select Convert(RN)).ToList();

        var CacheFactory = new DataCacheFactory();
        var myCache = CacheFactory.GetCache("MobileCache");

        myCache.Put("PortedNumberCollection", col);

    }
    catch (Exception E)
    {
        throw new System.Exception(E.GetType().ToString() + " in BG.Mobile.DAL.ReadPortedNumbers, Message : " + E.Message, E);
    }
    finally
    {
        if (mdc != null) mdc.Dispose();
    }
}

public static PortedNumberCollection Convert(tblRoutedNumber DataClass)
{
    try
    {
        PortedNumberCollection BusinessClass = new PortedNumberCollection();

        BusinessClass.PortedID = DataClass.PortedID;
        BusinessClass.MSISDN = DataClass.MSISDN;
        BusinessClass.RoutingLabel = DataClass.RoutingLabel;
        BusinessClass.RouteAction = DataClass.RouteAction;

        return BusinessClass;
    }
    catch (Exception E)
    {
        throw new System.Exception(E.GetType().ToString() + " in BG.Bus.Mobile.DALConvertor.Convert(tblRoutedNumber DataClass): " + E.Message);                

    }
}

[DataContract][Serializable]
public class PortedNumberCollection
{
    [DataMember]        
    public Int64 PortedID;

    [DataMember]        
    public string MSISDN;

    [DataMember]        
    public string RoutingLabel;

    [DataMember]
    public string RouteAction;
}   

服务器配置:

<?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <configSections>
            <section name="dataCache" type="Microsoft.ApplicationServer.Caching.DataCacheSection, Microsoft.ApplicationServer.Caching.Core" />
        </configSections>
         <dataCache size="Small">
<caches>
  <cache consistency="StrongConsistency" name="MobileCache" minSecondaries="0">
    <policy>
      <eviction type="None" />
      <expiration defaultTTL="1" isExpirable="false" />
    </policy>
  </cache>
  <cache consistency="StrongConsistency" name="default" minSecondaries="0">
    <policy>
      <eviction type="Lru" />
      <expiration defaultTTL="10" isExpirable="true" />
    </policy>
  </cache>
</caches>
<hosts>
  <host replicationPort="22236" arbitrationPort="22235" clusterPort="22234"
    hostId="1073911731" size="1000" leadHost="true" account="BGZA\accName"
    cacheHostName="AppFabricCachingService" name="hostname.domain.co.za"
    cachePort="22233" />
</hosts>
<advancedProperties>
<transportProperties connectionBufferSize="131072" maxBufferPoolSize="2147483647" 
                   maxBufferSize="2147483647" maxOutputDelay="2" channelInitializationTimeout="60000" 
                   receiveTimeout="600000"/>
  <securityProperties>
    <authorization>
      <allow users="Rossp0033" />
    </authorization>
  </securityProperties>
</advancedProperties>
<deploymentSettings>
  <deploymentMode value="RoutingClient" />
</deploymentSettings>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="dataCacheClient"
         type="Microsoft.ApplicationServer.Caching.DataCacheClientSection, Microsoft.ApplicationServer.Caching.Core,Version=1.0.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          allowLocation="true"
          allowDefinition="Everywhere"/>
  </configSections>
  <dataCacheClient>
    <hosts>
      <host
         name="HostName.DomainName.co.za"
         cachePort="22233"/>
    </hosts>
    <transportProperties connectionBufferSize="131072" maxBufferPoolSize="2147483647"
                      maxBufferSize="2147483647" maxOutputDelay="2" channelInitializationTimeout="60000"
                      receiveTimeout="600000"/>
  </dataCacheClient>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup> 
</configuration>
public static void ReadPortedNumbers()
{
    MobileDataContext mdc = null;
    List<PortedNumberCollection> col;

    try
    {
        mdc = new MobileDataContext(strConnString);

        col = (from RN in mdc.tblRoutedNumbers
               select Convert(RN)).ToList();

        var CacheFactory = new DataCacheFactory();
        var myCache = CacheFactory.GetCache("MobileCache");

        myCache.Put("PortedNumberCollection", col);

    }
    catch (Exception E)
    {
        throw new System.Exception(E.GetType().ToString() + " in BG.Mobile.DAL.ReadPortedNumbers, Message : " + E.Message, E);
    }
    finally
    {
        if (mdc != null) mdc.Dispose();
    }
}

public static PortedNumberCollection Convert(tblRoutedNumber DataClass)
{
    try
    {
        PortedNumberCollection BusinessClass = new PortedNumberCollection();

        BusinessClass.PortedID = DataClass.PortedID;
        BusinessClass.MSISDN = DataClass.MSISDN;
        BusinessClass.RoutingLabel = DataClass.RoutingLabel;
        BusinessClass.RouteAction = DataClass.RouteAction;

        return BusinessClass;
    }
    catch (Exception E)
    {
        throw new System.Exception(E.GetType().ToString() + " in BG.Bus.Mobile.DALConvertor.Convert(tblRoutedNumber DataClass): " + E.Message);                

    }
}

[DataContract][Serializable]
public class PortedNumberCollection
{
    [DataMember]        
    public Int64 PortedID;

    [DataMember]        
    public string MSISDN;

    [DataMember]        
    public string RoutingLabel;

    [DataMember]
    public string RouteAction;
}   

客户端配置:

<?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <configSections>
            <section name="dataCache" type="Microsoft.ApplicationServer.Caching.DataCacheSection, Microsoft.ApplicationServer.Caching.Core" />
        </configSections>
         <dataCache size="Small">
<caches>
  <cache consistency="StrongConsistency" name="MobileCache" minSecondaries="0">
    <policy>
      <eviction type="None" />
      <expiration defaultTTL="1" isExpirable="false" />
    </policy>
  </cache>
  <cache consistency="StrongConsistency" name="default" minSecondaries="0">
    <policy>
      <eviction type="Lru" />
      <expiration defaultTTL="10" isExpirable="true" />
    </policy>
  </cache>
</caches>
<hosts>
  <host replicationPort="22236" arbitrationPort="22235" clusterPort="22234"
    hostId="1073911731" size="1000" leadHost="true" account="BGZA\accName"
    cacheHostName="AppFabricCachingService" name="hostname.domain.co.za"
    cachePort="22233" />
</hosts>
<advancedProperties>
<transportProperties connectionBufferSize="131072" maxBufferPoolSize="2147483647" 
                   maxBufferSize="2147483647" maxOutputDelay="2" channelInitializationTimeout="60000" 
                   receiveTimeout="600000"/>
  <securityProperties>
    <authorization>
      <allow users="Rossp0033" />
    </authorization>
  </securityProperties>
</advancedProperties>
<deploymentSettings>
  <deploymentMode value="RoutingClient" />
</deploymentSettings>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="dataCacheClient"
         type="Microsoft.ApplicationServer.Caching.DataCacheClientSection, Microsoft.ApplicationServer.Caching.Core,Version=1.0.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          allowLocation="true"
          allowDefinition="Everywhere"/>
  </configSections>
  <dataCacheClient>
    <hosts>
      <host
         name="HostName.DomainName.co.za"
         cachePort="22233"/>
    </hosts>
    <transportProperties connectionBufferSize="131072" maxBufferPoolSize="2147483647"
                      maxBufferSize="2147483647" maxOutputDelay="2" channelInitializationTimeout="60000"
                      receiveTimeout="600000"/>
  </dataCacheClient>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup> 
</configuration>
public static void ReadPortedNumbers()
{
    MobileDataContext mdc = null;
    List<PortedNumberCollection> col;

    try
    {
        mdc = new MobileDataContext(strConnString);

        col = (from RN in mdc.tblRoutedNumbers
               select Convert(RN)).ToList();

        var CacheFactory = new DataCacheFactory();
        var myCache = CacheFactory.GetCache("MobileCache");

        myCache.Put("PortedNumberCollection", col);

    }
    catch (Exception E)
    {
        throw new System.Exception(E.GetType().ToString() + " in BG.Mobile.DAL.ReadPortedNumbers, Message : " + E.Message, E);
    }
    finally
    {
        if (mdc != null) mdc.Dispose();
    }
}

public static PortedNumberCollection Convert(tblRoutedNumber DataClass)
{
    try
    {
        PortedNumberCollection BusinessClass = new PortedNumberCollection();

        BusinessClass.PortedID = DataClass.PortedID;
        BusinessClass.MSISDN = DataClass.MSISDN;
        BusinessClass.RoutingLabel = DataClass.RoutingLabel;
        BusinessClass.RouteAction = DataClass.RouteAction;

        return BusinessClass;
    }
    catch (Exception E)
    {
        throw new System.Exception(E.GetType().ToString() + " in BG.Bus.Mobile.DALConvertor.Convert(tblRoutedNumber DataClass): " + E.Message);                

    }
}

[DataContract][Serializable]
public class PortedNumberCollection
{
    [DataMember]        
    public Int64 PortedID;

    [DataMember]        
    public string MSISDN;

    [DataMember]        
    public string RoutingLabel;

    [DataMember]
    public string RouteAction;
}   

C代码:

<?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <configSections>
            <section name="dataCache" type="Microsoft.ApplicationServer.Caching.DataCacheSection, Microsoft.ApplicationServer.Caching.Core" />
        </configSections>
         <dataCache size="Small">
<caches>
  <cache consistency="StrongConsistency" name="MobileCache" minSecondaries="0">
    <policy>
      <eviction type="None" />
      <expiration defaultTTL="1" isExpirable="false" />
    </policy>
  </cache>
  <cache consistency="StrongConsistency" name="default" minSecondaries="0">
    <policy>
      <eviction type="Lru" />
      <expiration defaultTTL="10" isExpirable="true" />
    </policy>
  </cache>
</caches>
<hosts>
  <host replicationPort="22236" arbitrationPort="22235" clusterPort="22234"
    hostId="1073911731" size="1000" leadHost="true" account="BGZA\accName"
    cacheHostName="AppFabricCachingService" name="hostname.domain.co.za"
    cachePort="22233" />
</hosts>
<advancedProperties>
<transportProperties connectionBufferSize="131072" maxBufferPoolSize="2147483647" 
                   maxBufferSize="2147483647" maxOutputDelay="2" channelInitializationTimeout="60000" 
                   receiveTimeout="600000"/>
  <securityProperties>
    <authorization>
      <allow users="Rossp0033" />
    </authorization>
  </securityProperties>
</advancedProperties>
<deploymentSettings>
  <deploymentMode value="RoutingClient" />
</deploymentSettings>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="dataCacheClient"
         type="Microsoft.ApplicationServer.Caching.DataCacheClientSection, Microsoft.ApplicationServer.Caching.Core,Version=1.0.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          allowLocation="true"
          allowDefinition="Everywhere"/>
  </configSections>
  <dataCacheClient>
    <hosts>
      <host
         name="HostName.DomainName.co.za"
         cachePort="22233"/>
    </hosts>
    <transportProperties connectionBufferSize="131072" maxBufferPoolSize="2147483647"
                      maxBufferSize="2147483647" maxOutputDelay="2" channelInitializationTimeout="60000"
                      receiveTimeout="600000"/>
  </dataCacheClient>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup> 
</configuration>
public static void ReadPortedNumbers()
{
    MobileDataContext mdc = null;
    List<PortedNumberCollection> col;

    try
    {
        mdc = new MobileDataContext(strConnString);

        col = (from RN in mdc.tblRoutedNumbers
               select Convert(RN)).ToList();

        var CacheFactory = new DataCacheFactory();
        var myCache = CacheFactory.GetCache("MobileCache");

        myCache.Put("PortedNumberCollection", col);

    }
    catch (Exception E)
    {
        throw new System.Exception(E.GetType().ToString() + " in BG.Mobile.DAL.ReadPortedNumbers, Message : " + E.Message, E);
    }
    finally
    {
        if (mdc != null) mdc.Dispose();
    }
}

public static PortedNumberCollection Convert(tblRoutedNumber DataClass)
{
    try
    {
        PortedNumberCollection BusinessClass = new PortedNumberCollection();

        BusinessClass.PortedID = DataClass.PortedID;
        BusinessClass.MSISDN = DataClass.MSISDN;
        BusinessClass.RoutingLabel = DataClass.RoutingLabel;
        BusinessClass.RouteAction = DataClass.RouteAction;

        return BusinessClass;
    }
    catch (Exception E)
    {
        throw new System.Exception(E.GetType().ToString() + " in BG.Bus.Mobile.DALConvertor.Convert(tblRoutedNumber DataClass): " + E.Message);                

    }
}

[DataContract][Serializable]
public class PortedNumberCollection
{
    [DataMember]        
    public Int64 PortedID;

    [DataMember]        
    public string MSISDN;

    [DataMember]        
    public string RoutingLabel;

    [DataMember]
    public string RouteAction;
}   
publicstaticvoid ReadPortedNumbers()
{
MobileDataContext mdc=null;
列表col;
尝试
{
mdc=新的MobileDataContext(strConnString);
col=(从mdc.tblRoutedNumber中的RN开始)
选择Convert(RN)).ToList();
var CacheFactory=new DataCacheFactory();
var myCache=CacheFactory.GetCache(“MobileCache”);
myCache.Put(“PortedNumberCollection”,col);
}
捕获(例外E)
{
抛出新的System.Exception(例如BG.Mobile.DAL.ReadPortedNumber中的GetType().ToString()+),消息:“+E.Message,E”;
}
最后
{
如果(mdc!=null)mdc.Dispose();
}
}
公共静态PortedNumber集合转换(tblRoutedNumber数据类)
{
尝试
{
PortedNumberCollection BusinessClass=新PortedNumberCollection();
BusinessClass.PortedID=DataClass.PortedID;
BusinessClass.MSISDN=DataClass.MSISDN;
BusinessClass.RoutingLabel=DataClass.RoutingLabel;
BusinessClass.RouteAction=DataClass.RouteAction;
返回商务舱;
}
捕获(例外E)
{
抛出新的System.Exception(例如BG.Bus.Mobile.DALConvertor.Convert(tblRoutedNumber数据类)中的GetType().ToString()+):“+E.Message”;
}
}
[数据合同][可序列化]
公共类PortedNumber集合
{
[数据成员]
公营部门没有这样做;
[数据成员]
公共字符串MSISDN;
[数据成员]
公共字符串路由标签;
[数据成员]
公共字符串路由;
}   
加载(放置)数据后AppFabric内存使用情况

我想为阅读本文的未来用户回答我自己的问题

不要使用AppFabric而是查看Redis或MemCached之类的产品。他们在我所能看到的各个方面都更好


AppFabric仍然有太多问题,无法在我的生产系统中使用

如果您使用的是AppFabric 1.1,您需要知道它的内部GC不会释放任何分配的内存。因此,如果确定要使用的内存量或启用LRU,则可以限制CacheCluster主机的内存(例如,
SET CacheHostConfig-HostName ServerName-CachePort PORT-CacheSize 1024
)。这将确保您的内存使用不超过该级别。重要的是要理解,它将不可避免地上升到这个水平。

我不知道这是否能解释它,但大多数内存缓存过度分配,以防止大量分配。尝试加载表的一半(理想情况下是随机加载),看看它是否使用了appfabric当前使用的一半内存,而不是使用完全相同的数量。顺便说一句:在单个键上用一个大对象填充缓存(
“PortedNumberCollection”
)是一个非常糟糕的主意;无论何时访问它,都必须发送整个内容,这将影响带宽。另外一个想法是:尝试使用
NetDataContractSerializer
序列化
col
(即IIRC,应用结构客户端库使用的内容);看看isI对AppFabric过度分配行为的理解有多大,但接受您的建议并加载半个表会给我与加载整个表相同的内存使用率(这是一个好问题),这让我相信有问题……您没有回答自己的问题。你的回答也不是很贴切。任务管理器为appfabric缓存服务显示的“内存”量与存储在其中的数据量无关(以SQL server为例)。这里有几个链接可以帮助您:最佳实践:某种程度上是一种解释:我不知道确切的数学,但是是的,我可以看到缓存中的数据增加了10倍。我已经被扔了所有这些。。。好几次。问题是,即使是垃圾收集,所有正确的设置,超过足够的内存和CPU使用Put选项,总是会增加它应该替换对象和内存(IMO)的内存。除非有人能向我提供将同一对象“放入”同一缓存区域的工作样本,而内存不会持续增长,否则我的答案是,它还没有为我的生产系统做好准备。仅供参考:我在生产集群上使用AppFabric(Velocity CTP3)已经超过4年了(是的,我知道CTP不是为了生产而建造的)拥有超过100万台移动设备,非常成功。我最近刚转到AF 1.1,所以我仍在学习差异,但系统很好。是的,内存分配问题看起来很可怕,但我不担心,只要我没有看到超时和错误。我不断按键更新内存中的对象。不确定你在看什么我作为一个仍然使用AppFabric的人,让我全力支持这个答案,尤其是粗体部分。此外,这个答案比以往任何时候都更相关、更正确。我完全按照你提到的做了。不幸的是,我没有经历过