【问题标题】:Can the server's in-memory cache be used in Azure?服务器的内存缓存能否在 Azure 中使用?
【发布时间】:2019-07-04 18:04:24
【问题描述】:

我需要我的 Web API 具有缓存来存储一些数据。我一直在研究 Azure 上的缓存,可以看到微软推荐使用 Redis 缓存。

我能否使用普通服务器的内存缓存来存储只能由 Web API 访问的简单数据,或者 Redis 是我唯一的选择。 Azure 上的服务器内存是否有任何限制?

【问题讨论】:

  • 您想使用什么 Azure 服务,Azure App Services 或 Azure Functions 还是其他?您想使用哪种编程语言?
  • Azure 应用服务 (Web API) 和 .NET Core

标签: azure caching azure-redis-cache


【解决方案1】:

当然可以。 Azure Redis 缓存不是唯一的选择。您可以考虑使用Microsoft.Extensions.Caching.MemoryMemoryCache 来存储您的简单数据,并确保您的数据大小小于Azure App Service 上的可用tails 内存大小,该大小受Azure App Services 的内存限制不同的层,如下图来自App Service limits

同时,您也可以考虑使用带有支持更多内存的 HTTP 触发器的 Azure Functions 来实现您的 Web API,请参考Functions limits

希望对你有帮助。

【讨论】:

  • 谢谢...很高兴知道我们可以为简单的东西保持简单..
  • 假设,我的 MVC5 Web 应用程序有大约 500 个并发连接(使用网站的用户),该应用程序托管在 Azure 应用程序服务中。我想使用 [MemoryCache] 和 [OutputCache] 存储一个包含 5000 条记录的列表和一个页面,该页面分别在 HTML 表中呈现此记录列表。能否请您大致了解一下它会消耗多少内存以及我在哪里可以监控使用情况等等?
猜你喜欢
  • 2021-12-30
  • 2021-10-18
  • 2021-08-14
  • 2013-02-28
  • 2012-05-10
  • 1970-01-01
  • 1970-01-01
  • 2012-10-22
  • 1970-01-01
相关资源
最近更新 更多