其中专用高速缓存配置中使用? [英] Which Dedicated Cache configuration to use?

查看:164
本文介绍了其中专用高速缓存配置中使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个大型的电子商务网站正在从共享缓存切换其会话高速缓存专用缓存。

A large e-commerce site is looking to switch its session cache from Shared cache to dedicated cache.

它通常是在中型服务器(5-6)...运行在高峰时段,它运行于20中的服务器。在非常繁忙的时候,它是不是不合理的有每秒2000+请求到网站

It is usually running on medium-size servers (5-6)... During busy times, it's running on 20 medium servers. During the very busy times, it is not unreasonable to have 2000+ requests per second to the site

同样位于缓存这里不够好,或者必须缓存在奉献工作者角色?

Is co-located cache good enough here or must cache be in the dedicate worker role?

此外,必须高可用性会话数据启用?该网站依靠会话数据成为良好的用户体验present。但是,高速缓存保存到Azure的Blob存储,所以我不知道我完全获得高可用性选项

Also, must high-availability be enabled for session data? The site relies upon session data to be present for good user experience. But the cache is persisted to Azure blob storage, so I'm not sure I totally get the high-availability option

推荐答案

使用专用的角色取决于你想要多少角色运行,以及是否您的Web角色的内存使用情况来确定,如果他们规模。例如,如果你的Web角色总是推内存使用,它是内存和CPU不说是向外扩展的触发 - 再考虑使用专用的角色缓存,您的网络角色就可以处理负载更长的时间。如果你的Web角色是CPU密集型的,然后每个角色到高速缓存内存奉献可能是preferred。您还需要考虑到,如果在专用的角色运行,则需要多个角色来处理负载和可用性,因此,即使在非繁忙时间,你将有运行缓存至少3个角色(但可能更少的网络角色) 。您可能还希望,如果你做大量部署或缩小来使用专用缓存 - 在角色有意频繁关闭。

The use of dedicated roles depends on how many roles you want to run, and whether or not the memory usage of your web roles determines if they scale. For example, if your web roles are always pushing memory usage, and it is memory and not CPU that is the trigger for scaling out - then consider using dedicated roles for the cache, as your web roles can then handle the load for longer. If your web roles are cpu intensive, then dedicating memory on each role to the cache may be preferred. You also need to consider that if running in dedicated roles, you need more than one role to handle the load and availability, so even during non-busy times, you will have at least 3 roles running the cache (but possibly fewer web roles). You may also want to use dedicated cache if you do lots of deployments or scaling down - where roles are shut down intentionally and frequently.

在同一地点的角色缓存的一个考虑是,如果你有粘性会话延迟会更低,因为该项目是在同一台机器上。不幸的是,天青负载平衡器循环赛,而不是粘在所有,使得会话获取回到同一机器是低的机会(的时间为5角色1/5)。这意味着大多数的时间的高速缓冲存贮器项将是从群集中的另一个角色取出,所以共同位于延迟益处丢失。

One consideration on co-located role caching is that if you had sticky sessions the latency would be lower, as the item is on the same machine. Unfortunately, the Azure load balancer is round robin, and not sticky at all, so the chance that a session gets back to the same machine is low (1/5 of the time for 5 roles). This means that most of the time the cache item will be fetched from another role in the cluster, so co-located latency benefits are lost.

缓存是分布式的内存 - 没有Blob存储,我知道的(除了'集群的运行状态' - 无论是加载到缓存中的项目提供给其他机器从集群。它被存储(在内存中)在机器(从机器B到机器A的读不还其存储在机器A - 见下文评论)。缓存的项目总是在只读存储器和高速缓存大小是由现有的有限内存。

The cache is distributed and in-memory - there is no blob storage that I am aware of (except for 'cluster's runtime state' - whatever that is. An item loaded into cache is made available to other machines on the cluster from the machine that it is stored (in memory) on (a read from machine B to machine A does not also store it on machine A - see comment below). Cached items are always in memory only, and the cache size is limited by available memory.

高可用性选项复制该项目以一个单独的机器(不存储),所以如果一台机器出现故障时,仍然有一个副本的某个地方。高可用性也将使用更多的内存,作为一个项目在两个不同的地方使用内存。失败也许对您的电子商务应用足够低的机会 - 如果一个项目没有被缓存(无论是通过故障或失效),可能从重建持续的数据。如果你是,例如,保持在篮下缓存和不持久化存储,你不希望它失去了某个角色回收 - 在这种情况下,高可用性可能是最好的选择。

The high availability option copies the item to a separate machine (not storage), so if one machine fails, there is still a copy somewhere. High availability will also use more memory, as an item uses memory in two different places. The chances of failure maybe low enough for your e-commerce app - if an item is not cached (either through failure or expiry) it may be reconstructed from persisted data. If you are, for example, keeping the basket in cache and not persisted to storage, you don't want it lost if a role recycles - in which case high availability may be the best option.

这篇关于其中专用高速缓存配置中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆