问题标签 [appfabric-cache]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
7 回答
20502 浏览

appfabric - AppFabric 错误代码

我已经在服务器上安装了 AppFabric。我已经创建了单台计算机的集群。我还创建了一个名为“Gagan”的缓存。按顺序使用以下命令

使用-CacheCluster -Provider xml -ConnectionString \NB-GJANJUA\Cache Start-CacheCluster

结果是缓存服务启动并运行..到目前为止一切顺利。

然后我设置我的 web.config 文件,如下所示

但是一旦我启动我的网站,它就会出现这个错误

解析器错误消息:ErrorCode:SubStatus:暂时失败。请稍后重试。(一个或多个指定的缓存服务器不可用,这可能是由于网络或服务器繁忙造成的。确保已为集群上的此客户端帐户授予安全权限,并且允许 AppFabric 缓存服务通过所有缓存主机上的防火墙。稍后重试。)

源错误:

有什么我想念的吗?

注意:我已经引用了 Microsoft.ApplicationServer.Caching.Client 和 Microsoft.APplicationServer.Caching.Core 程序集

感谢您的时间和耐心

问候 Gagan Janjua

0 投票
2 回答
3207 浏览

session-state - 具有单个 Web 服务器的 InProc 与 AppFabric 会话状态

我有一个 ASP.Net MVC 应用程序,它大量使用会话来保存状态(包括大型数据集合)。目前,它托管在单个 Web 服务器上。会话设置为默认的 InProc。

出现一个问题,即当许多用户在线时,某些用户的应用程序冻结。我猜这是因为 InProc 会话不能很好地扩展,并且进程可用的内存只有这么多。(如果内存需求超过可用内存会发生什么——它会换出到磁盘吗?)

我想到了几个有助于可扩展性的解决方案。(a) Sql server 会话状态;(b) 配置会话状态以使用 AppFabric 缓存。第一个选项看起来是一个不错的解决方案,只是它会影响性能并要求存储的项目是可序列化的。

在单个 Web 服务器也用作缓存主机的环境中配置会话状态以使用 AppFabric 缓存(又名 Velocity)怎么样?这与单服务器环境中的 InProc 有何不同?这会比 InProc 提供更多的可扩展性和可用内存,还是本质上会受到相同的限制?

0 投票
2 回答
318 浏览

windows - AppFabric 缓存和 Windows 7

对于在 Windows 7 专业机器上运行 AppFabric 缓存集群有什么建议吗?我计划有 3 个节点,并设置高可用性。请建议。下面提到的将是我的客户端配置:

0 投票
1 回答
236 浏览

caching - 对可查询的数据集使用分布式缓存是否可行?

我的情况如下。我有一个包含一百万行元组(比如first namelast name)的数据表,以及一个需要检索其名字或姓氏以查询字符串开头的一小部分行的客户端。缓存这似乎是一个 catch-22,因为:

  • 一方面,我无法在每个请求上存储和检索整个数据集(会使网络不堪重负)
  • 另一方面,我不能单独存储每一行​​,因为那样我就无法运行查询。
  • 使用本地“索引”或目录在缓存中存储值范围是可行的……除此之外,您必须基本上复制每个索引的数据,这甚至违背了使用分布式缓存的目的。

对于这种事情,什么方法是可取的?是否有可能获得使用分布式缓存的好处,或者在这种情况下根本不可行?

0 投票
2 回答
420 浏览

serialization - 将自定义缓存序列化程序与 Windows Server App Fabric 结合使用

似乎可以将自定义缓存序列化程序与 Azure AppFabric 一起使用(Jagan Peri 的自定义序列化)。

是否有可能将自定义序列化程序与 Windows Server AppFabric 缓存一起使用?

0 投票
1 回答
390 浏览

.net - Windows Server AppFabric 缓存和数据库同步

我们计划将 Windows Server AppFabric 缓存用于医疗保健应用程序。我们有一个患者主数据和其他我们想要使用 AppFabric 缓存缓存的主数据。但是,我们还使用 SQL Server 服务代理和复制设置了与其他应用程序的后端集成,这些应用程序可以更新此患者主数据和其他查找数据。当使用 Service Broker 更新此数据时,我们如何通知 AppFabric 缓存,以便缓存始终反映最新的患者主数据和其他主数据信息。我们可以使用 SQL CacheDependency 或 SQL Server 通知服务吗?

谢谢,高拉夫。

0 投票
1 回答
491 浏览

architecture - AppFabric 缓存 - Read-Through/Write-Behind 策略

在我们的新项目中,我们希望 AppFabric 缓存成为一个关键组件。作为一般准则,我们将有一个写入模型/域和一个读取模型/域:后端服务由提供者/其他服务通知,并将按照业务规则放入缓存中的一些数据。前端服务/网站将根据需要使用数据。

Read-Through/Write-Behind 似乎是一个好方法。但是如何为真正的业务解决方案实施它?我看到的每个示例都使用 ADO.NET 的简单查询来加载数据。在我们的例子中,加载数据是业务相关的,并且会涉及到许多程序集和交互。将我们所有的业务部署到每个缓存主机上似乎不是一个好的解决方案。

另一种方法是每个域都有一个独特的服务,负责从缓存中获取/读取和写入/放入缓存。不理想并且会降低性能,因为它将成为 AppFabric 缓存的包装器。

如果您还有其他问题,请不要犹豫。

感谢帮助 !

0 投票
3 回答
12043 浏览

appfabric - AppFabric 扩展问题故障排除(间歇性错误代码):子状态错误)

我们已经为我们的 Web 应用程序实现了 AppFabric Windows Server 缓存。最初,我们能够毫无问题地使用缓存。然后我们将流量增加了大约 100 倍,并开始遇到间歇性异常。异常大约每 2 天发生一次,每次大约一分钟。

我们的配置:

  • 9 个 Web 服务器在缓存中插入/检索对象:
    • 主要是临时的 500 字节操作类型对象
    • 使用 1 个命名区域
    • 使用标签存储的对象
    • 为给定标签批量检索
  • 缓存集群:
    • 1 台主机(领导)AppFabric 1.1(get-cachehost 报告的版本为 3)
    • SQL 配置提供程序
    • 主机上 96GB 的 RAM,默认 50% (48GB) 分配给 AppFabric
    • 缓存主机配置
    • 缓存客户端配置

错误发生的顺序(在 1 分钟内,九个网络服务器中的每一个都发生异常):

  • System.Net.Sockets.SocketException:现有连接被远程主机强行关闭 Microsoft.ApplicationServer.Caching.DataCacheException:ErrorCode<ERRCA0016>:SubStatus<ES0001>:The connection was terminated, possibly due to server or network problems or serialized Object size is greater than MaxBufferSize on server. Result of the request is unknown. ---> System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:15:00'. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host --- End of inner exception stack trace --- at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.FramingDuplexSessionChannel.EndReceive(IAsyncResult result) at Microsoft.ApplicationServer.Caching.WcfClientChannel.CompleteProcessing(IAsyncResult result) --- End of inner exception stack trace --- at Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody) at Microsoft.ApplicationServer.Caching.DataCache.GetNextBatch(String region, DataCacheTag[] tags, GetByTagsOperation op, IMonitoringListener listener, Byte[][]& state, Boolean& more) at Microsoft.ApplicationServer.Caching.CacheEnumerator.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator'2.MoveNext() at System.Linq.Enumerable.<ExceptIterator>d__99'1.MoveNext() at System.Collections.Generic.List'1..ctor(IEnumerable'1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable'1 source)

  • Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode<ERRCA0017>:SubStatus<ES0006>:There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions. Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.) at Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody) at Microsoft.ApplicationServer.Caching.DataCache.GetNextBatch(String region, DataCacheTag[] tags, GetByTagsOperation op, IMonitoringListener listener, Byte[][]& state, Boolean& more) at Microsoft.ApplicationServer.Caching.CacheEnumerator.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator'2.MoveNext() at System.Linq.Enumerable.<ExceptIterator>d__99'1.MoveNext() at System.Collections.Generic.List'1..ctor(IEnumerable'1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable'1 source)

  • Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode<ERRCA0018>:SubStatus<ES0001>:The request timed out. at Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody) at Microsoft.ApplicationServer.Caching.DataCache.GetNextBatch(String region, DataCacheTag[] tags, GetByTagsOperation op, IMonitoringListener listener, Byte[][]& state, Boolean& more) at Microsoft.ApplicationServer.Caching.CacheEnumerator.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator'2.MoveNext() at System.Linq.Enumerable.<ExceptIterator>d__99'1.MoveNext() at System.Collections.Generic.List'1..ctor(IEnumerable'1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable'1 source)

我们还在缓存服务器上创建了一个跟踪日志会话,以捕获更多信息以诊断问题 - 任何有关如何分析此问题的建议将不胜感激(如果需要,我可以提供)。

我们还监控了各种 AppFabric、CLR 和网络性能计数器,下面是事件发生时的屏幕截图:

AppFabric 性能捕获

提前感谢您在解决此问题时可以分享的任何想法或建议。

更新 1

以下是在间歇性错误期间 AppFabric 缓存服务器上连续发生的异常(从跟踪日志中提取):

  • System.ServiceModel.CommunicationException: The socket connection was aborted because an asynchronous send to the socket did not complete within the allotted timeout of 00:00:00.0082078. The time allotted to this operation may have been a portion of a longer timeout. ---> System.ObjectDisposedException: The socket connection has been disposed. Object name: 'System.ServiceModel.Channels.SocketConnection'. --- End of inner exception stack trace --- at System.ServiceModel.Channels.SocketConnection.ThrowIfNotOpen() at System.ServiceModel.Channels.SocketConnection.BeginRead(Int32 offset, Int32 size, TimeSpan timeout, WaitCallback callback, Object state) at System.ServiceModel.Channels.SessionConnectionReader.BeginReceive(TimeSpan timeout, WaitCallback callback, Object state) at System.ServiceModel.Channels.SynchronizedMessageSource.ReceiveAsyncResult.PerformOperation(TimeSpan timeout) at System.ServiceModel.Channels.SynchronizedMessageSource.SynchronizedAsyncResult'1..ctor(SynchronizedMessageSource syncSource, TimeSpan timeout, AsyncCallback callback, Object state) at System.ServiceModel.Channels.FramingDuplexSessionChannel.BeginReceive(TimeSpan timeout, AsyncCallback callback, Object state) at Microsoft.ApplicationServer.Caching.WcfServerChannel.CompleteProcessing(IAsyncResult result)

  • System.ServiceModel.CommunicationObjectAbortedException: The communication object, System.ServiceModel.Channels.ServerSessionPreambleConnectionReader+ServerFramingDuplexSessionChannel, cannot be used for communication because it has been Aborted. at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.FramingDuplexSessionChannel.OnEndSend(IAsyncResult result) at Microsoft.ApplicationServer.Caching.ReplyContext.EndSend(IAsyncResult result)

  • System.ServiceModel.CommunicationObjectFaultedException: The communication object, System.ServiceModel.Channels.ServerSessionPreambleConnectionReader+ServerFramingDuplexSessionChannel, cannot be used for communication because it is in the Faulted state. at System.ServiceModel.Channels.CommunicationObject.ThrowIfDisposedOrNotOpen() at System.ServiceModel.Channels.OutputChannel.Send(Message message, TimeSpan timeout) at Microsoft.ApplicationServer.Caching.ReplyContext.Reply(Message message, TimeSpan timeout)

  • System.TimeoutException: Sending to via http://www.w3.org/2005/08/addressing/anonymous timed out after 00:00:15. The time allotted to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: Cannot claim lock within the allotted timeout of 00:00:15. The time allotted to this operation may have been a portion of a longer timeout. --- End of inner exception stack trace --- at System.ServiceModel.Channels.FramingDuplexSessionChannel.OnSend(Message message, TimeSpan timeout) at System.ServiceModel.Channels.OutputChannel.Send(Message message, TimeSpan timeout) at Microsoft.ApplicationServer.Caching.ReplyContext.Reply(Message message, TimeSpan timeout)

更新 2

经过一天的故障排除后,我们采取了以下措施,取得了一些改进:

  1. 在此基础上,我们增加到maxConnectionsToServer. 3结果,AppFabric Caching:Cache perf counter 记录的客户端请求/秒增加了 50%,但间歇性错误并没有停止发生

  2. 我们在缓存服务器配置上增加了maxBufferSizemaxBufferPoolSize2147483647(int32.max) 。到目前为止,我们能够处理没有错误的 300 倍流量。我们将继续增加流量和监控。更多更新要关注

更新 3

我们向集群添加了另外两台各 16GB 的主机,并启用了 HighAvailability 模式(通过Secondaries=1)。目前,原始主机保留在集群中,内存为 96GB - 所有主机都有cacheSize = 12GB。在缓存客户端上,我们将其MaxConnectionToServer增加到12(每个核心 1 个)。以下是我们的发现:

  • 偶尔我们会得到(每 10 分钟一次或两次):
    • ErrorCode<ERRCA0017>:SubStatus<ES0005>:There is a temporary failure. Please retry later. (There was a contention on the store.)
    • ErrorCode<ERRCA0017>:SubStatus<ES0004>:There is a temporary failure. Please retry later. (Replication queue was full. This may happen during reconfiguration of cluster hosts.)
  • 如上所述,原来的 96GB 缓存主机仍然会出现 1 分钟的中断。新的缓存主机没有经历过中断

我们计划从原始缓存主机中移除 80GB 内存。更多更新。

更新 4

通过将缓存主机中的 RAM 量减少到 16GB,似乎已经解决了这个问题。我们不再看到流量增加到 400 倍的间歇性错误。好像封号了。现在转到下一个问题:高可用性

0 投票
1 回答
127 浏览

appfabric-cache - Windows 应用程序结构缓存

我正在使用带有多个命名缓存的 Windows AppFabric 缓存。可以为每个命名缓存设置单独的过期策略。

如果可能,请让我知道如何通过配置文件实现这一点。

示例代码

请注意,根据代码,我猜第三个标签中指定的策略是针对名为 AFCM 的命名缓存。请在这方面澄清我。

0 投票
2 回答
313 浏览

azure - 如何在 Azure 上部署自定义 DataCacheStoreProvider 以进行直写和后读

是否可以在 Azure 上部署自定义 DataCacheStoreProviders?我目前正在尝试在本地部署和测试一个,但我不确定如何去做,因为文档没有涵盖我的场景。任何帮助,将不胜感激。