锐起无盘服务器supercache的设置方法_第1页
锐起无盘服务器supercache的设置方法_第2页
锐起无盘服务器supercache的设置方法_第3页
锐起无盘服务器supercache的设置方法_第4页
锐起无盘服务器supercache的设置方法_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、锐起无盘服务器supercache的设置方法2010-01-31 11:11大家好,我是挨踢民工.因工作关系有接触无盘.国内无盘高手找效率最高的,都用bxp做无盘.我想是因为bxp服务端带缓存算法.我小白也就找简单的做,我用的是锐起.可锐起没服务端缓存(自3.0后终于有客户端缓存了),网上大多文章都说要配合supercach来做服务端缓存.和怎么设置却没个准谱.最近我翻译了supercache的使用说明(请在看这篇前先阅读, 空间传送门:/blog/ 也可以在这下载: /ywwz/file/

2、supercache/SuperCacheIII官方使用说明翻译.html)(见文章末尾),结合锐起服务端总结的一个设置方法.这里和大家分享一下.先让大家看看范例服务器的状态:请大家注意镜像存放的目录和回写目录.还有我得告诉大家这台服务器是正在带客户机的机器,并非试验机.实际只带70+台,那个122台并非想迷惑大家. 我们先说读盘的设置吧.,我这边的体系是把游戏都放在虚拟磁盘里,无盘只放一些最常用的游戏.所以读盘压力非常小.我甚至经常把客户机的系统镜像直接放服务器的D盘里-和服务器系统同一块硬盘 =.=; 在设置前先得获取一些参数,一般我是用系统自带的perfmon(系统性能监控器)来获取这些

3、参数.perfmon的使用方法我简单地说一下.运行perfmon - 在perfmon的图表上右键属性 - 直接跳到数据选项卡,把数据选项卡里默认的3个计数器删除掉 - 点击添加按钮,弹出添加计数器对话框 - 点选性能对象为Volume Filter(卷过滤器) 这里请注意,Volume Filter这个性能对象有时会不出现,这时只要退回上一步的添加按钮那再试一遍即可.我不清楚原因,知道的朋友请帮忙科普一下.此时应该是这样的画面:读盘应该注意一下几个计数器:Read - Average bytes per operation 每次读取操作的平均字节数 这个决定了supercache的页面尺寸.

4、Read - Bytes per second 每秒的读取字节数 相当于读盘流量Read - Operations per second 每秒的读取操作数 硬盘最重要的参数,iops.这里只计算读取的iops. 相当于读盘的压力Read - Percent cache hits 缓存命中率 用来判断你设置的supercache是否高效的关键参数.看看范例服务器的数据,这里J盘是放系统镜像,K盘是放(相对于系统)不怎么读的数据盘.图形表示:数据表示(平均数):这些数据表明,J盘平均的读取大小在12KB左右.流量0.2KB/S,每秒的io才0.02,压力很小.缓存命中率100%,但我是在白天没什么

5、人流(看压力就知道了)的情况下测试的.请无视这个100%同样的方法看,K盘几乎没在用.缓存页面大小(Cache page size)按图就应该设置成接近12KB的数.页面值设置大了浪费内存;设置小了虽然提高效率可系统需要更多额外内存来管理页面,你得确保你系统是否有那么多内存.无论怎么你都得确保系统可用内存应该在20%-25%左右.缓存大小(Cache size)一般像我自己用的才3G的系统,非常纯粹的系统.最小地给128MB,多的话个200MB也够了.当然前提是系统里不要放太多没用的东西,这个考验做系统的能力了.缓存排序(Sort algorithm)按说明书系统镜像的读取是属于有明显热点的,

6、一般为了保险起见我都是用MFU排序.反正CPU也空闲在那-因为锐起没服务端缓存算法CPU非常闲.预读(Read-ahead)这个会造成缓存排序错乱,没必要.当然如果你内存多分配的缓存很大勾选上去也无妨.延迟写入模式(Deferred-write mode)关闭,读盘只有在超级用户时才写入数据.而且镜像包经不起数据丢失的折腾.这是范例服务器上放系统镜像的J盘的supercache的设置:(K盘忘记设置了 囧范例服务器的内存有8G,CPU也是4核滴.把页面值设置的小小滴把缓存设置得大大地,不打紧.前几天接手一台服务器.这台服务器不仅带无盘还带很多服务.我把系统镜像放在和系统同一块硬盘的D盘.测试时

7、发现,即使不带客户机读盘的流量和IOPS都很大,所以无论我怎么设置命中率都提不高.因为读取太没规律了.所以在测试时也得注意读盘的流量和IOPS,像我那个都没怎么读的读盘命中率100%就没什么好炫耀了.像这种还做其他服务的无盘服务器就得找个空闲的盘放系统咯.有点老生常谈的感觉呵. _无论怎么设置,最终以高峰期读盘的缓存命中率的高低来判断,通常应该在90%.请记住这点.同时也得注意磁盘的负载情况,读盘很少出现负载不够的情况,等说回写盘时在看.接着就是回写盘的设置了,对于无盘来说这个事最重要的了,不然还不如去搞虚拟磁盘的本地回写更简单.同样用perfmon测试参数.性能对象PhysicalDisk,

8、% Disk Time计数器 简单的说是磁盘的负载率.超过100%时,读写的延迟就会加大.Read - Percent cache hits 是滴,回写盘也是需要读数据滴.这个参数的影响可以参照读盘缓存的设置Write - Average bytes per operation 每次写入操作的平均字节数 同样也是用来确定写盘缓存页面值的.Write - Bytes per second 每秒的写入字节数 回写流量Write - Operations per second 每秒钟的写入操作次数 回写压力看看范例服务器的数据,F盘是回写盘.图形表示:数据表示(平均值):虽然读取缓存命中率是100%

9、,从流量和iops可以看出读的压力很小.忽略这100%.写操作的iops也才8,流量还不到1MB/S,压力很轻.磁盘的操作时间也才5%,负担很小.这是范例服务器的回写盘F:的supercache的设置:大多参数可以参考读盘的设置.页面值32KB,主要是考虑到缓存大道快2GB的情况,额外的内存花销太大,所以没选择4KB.4KB和47KB差太多了,内存很多时读盘可以无视每次操作的平均字节数,写盘可不行.64KB又太浪费,而且印象中以前supercache2不推荐超过32KB的页面值,supercache3倒没这个提示.综合一下就设置32KB了.在考虑好系统空闲内存(通常是25%,这个很重要不要嫌我

10、烦)后写盘缓存应该尽量大.这个和读盘的缓存不一样,读盘缓存太多了是浪费,回写盘的缓存多了可以避免突发流量增大.回写盘排序只能用MFU.不然几乎没有排序效果.回写盘的延迟回写模式肯定是要开的,但不要开无限延迟写入.延迟时间是可以大致算出来的,在高峰期时缓存大小/传输流量,得到的是读写塞满缓存时的时间.如果这个时间小于15s那就再缩小点填入,如果大于15s要么填15s要么就随便咯.千万别太大.比如我那台服务器高峰期最大流量大概还不到3MB/S,2000/3那要进10分钟才能塞满缓存,可我也才设置20s.脏页(缓存里的延写数据)太多服务器关机都慢.无论怎么设置,请以磁盘时间(% Disk Time)

11、来判断磁盘负载是否降低.同时也要注意读取缓存的命中率通常应该60%.示范服务器当时的性能:以下说明皆摘至SuperCache官方网站里(/servers/scsv-server_release_notes.htm 需翻墙)的发行注解,我很勉强地靠查字典翻译的.平时国内网站并没多做说明的地方我用蓝色的字标明.SuperCacheIII配合锐起的使用方法我会随后再发.如果我下完Tokyo Hot后还有时间的话.有翻译上的问题请发邮件至如果支持就到这顶我吧,除了Tokyo Hot,我看得到你们的支持也让我乐和乐和嘿

12、. /blog/转贴请附上以上信息(=_= 我是贪慕虚荣D淫Cache Tuning缓存优化The various resources in a computer system processors, buses, memory, controllers and adapters, storage devices, network interfaces, software, etc. are all factors which determine the rate at which a given task may be executed. Mos

13、t system resources are shared by the many different software components that are required to execute a task. For example, processor time, system memory, and storage devices must be shared by the operating system kernel and its drivers, operating system services, and other services and applications.计

14、算机系统的各种资源-比如处理总线 内存 控制器和适配器 存储设备 网络接口 软件等 - 这些因素决定了一项任务的执行效率.当执行任务时大多数系统资源需要被各种各样的软件组件共享.例如,处理器时间系统内存 和 存储设备会被系统内核 系统驱动 系统服务和 其他服务 应用程序所共享.Balancing the use of system resources so as to maximum system performance is system performance tuning. Much of this tuning is realized automatically by the oper

15、ating system. However, the operating system provides many parameters that can be modified to improve overall system performance, according to the applications or services being executed. (See Microsofts Web site for Windows Server 2003 or Windows 2000 server editions performance tuning.)均衡调整各个系统资源的使

16、用让系统性能最大化,这就是系统性能优化.系统性能优化的调度大多是由操作系统自动完成的.然而,操作系统也提供很多优化整体系统性能的参数,你可以根据程序和服务运行的状况手动调整.(具体内容可以到微软的网站查找 Windows Server 2003 或 Windows 2000服务器版本 的性能优化)SuperCache and SuperVolume improve system performance when storage resources are over-utilized compared with system memory and processor resources. How

17、ever, memory and processor resources must be shared among many system components, as described earlier. It is the responsibility of the systems engineer or system administrator to balance the use of these resources in order to optimize system performance.如前面所说,处理器内存等系统资源共享于各个系统组件,当存储设备是所有系统资源的瓶颈时,Su

18、perCache和SuerVolume可以改善系统性能.通常是由系统引擎或者系统管理员调整这些资源,优化系统性能.SuperCache and SuperVolume feature a variety of parameters to assist in system performance tuning. Each parameters is described below, along with recommended settings.SuperCzche和SuperVolume的各个参数对系统的影响以及各个参数的描述以及设置建议都如下表.Parameter (Switch)参数,括号

19、内为命令行开关Product适用产品Range(Default)参数值范围,括号内为默认值Description and use参数说明Lazywrite latency, in seconds (-lw)懒写延迟,单位秒SC, SVSC, SV(off, 0),1-14400,infinite(关闭,0),1-14400,无限Describes the period, in seconds, during which written data are present in the cache and not on the disk. When off (or 0; write-through

20、 mode), write data are written synchronously to the cache and disk.当数据没有写入硬盘并且还在缓存里的这段时间就是懒写延迟,单位秒.当你设定此值为”关闭”(或者为0,我们称之为”直接写入”模式),SuperCache和SuperVolume同步地写入数据到缓存和硬盘里.When not 0 (write-deferred mode), write data are written to the cache and asynchronously to the disk. The cache is called dirty whil

21、e the written data are present in the cache but are not yet written to disk. The amount of time between when the data are written to the cache and when they are written to the disk is the lazywrite latency.为非0值时(我们称之为”延迟写入”模式),SuperCache和SuperVolume异步地写入数据到缓存和硬盘里.我们把存于缓存还没写入硬盘里的数据称之为”脏页”.数据写入缓存到写入硬盘

22、之间的时间,我们称之为”懒写延迟”.When infinite, write data are written to the cache only as required to make new cache mappings. As old pages age, they become eligible for cleaning to be reused for new mappings.当此值设定为无限时,如果有新的缓存映射请求, 写入数据只被写入缓存.当缓存老化,一个新的缓存映射请求将覆盖他们.Deferred writing trades improved write performan

23、ce with greater risk of data loss. The longer the period, the lower the rate at which dirty data will be written out to disk by the lazywriter. Cache performance may be improved by lowering this rate (increasing the latency.) However, the longer dirty data are present in the cache, the greater the r

24、isk of data loss and corruption in the event of a power failure or system crash.延迟写入作业在提高性能的同时也伴随着更高的数据丢失风险.设定的懒写延迟时间越大,脏页数据写入磁盘的比例就越低.这个比例越低缓存性能就越高(增加懒写延迟值).然而,在缓存里的脏页越多,突然断电或者系统崩溃时丢失数据的危险就越高.Important: A non-zero lazywrite latency setting is an average: some dirty data will be written out in a sho

25、rter period, some will be written out after a longer period. We recommend use of this setting only on systems with uninterruptible power supplies (UPS).要点:一个非0值的懒写延迟应设置这样的平均值:有些脏页数据在短时间内写出,有些则在较长的时间之后写出.我们建议只在配备了不间断电源(UPS)的系统上设置非0值.SuperCache: Unlike SuperVolume, SuperCache also writes out dirty dat

26、a in response to internal requests for cache page mappings. If the cache become full of dirty data and read or write requests are made for pages not in the cache, dirty pages will be forcibly written out. This operation is given priority over the lazywriter.SuperCache:与SuperVolume不同,SuperCache在响应内部页

27、面映射请求时也会把脏页数据写出.也就是说整个缓存都被脏页充满时,如果读作业或写作业产生的页面不在缓存内,这需要映射新的页面到缓存里,SuperCache都会把脏页数据强制写出.这个操作优先于懒写.可以参考排序算法的解释SuperVolume: Unlike SuperCache, during initialization, SuperVolume automatically loads the entire volume image into its cache. During this time, the cache write mode is always write-through.

28、Upon completion of the image load, the write mode is changed to the configured setting. While loading, the configured setting will be reported even though it may differ from the actual setting. SuperVolume:与SuperCache不同,SuperVolume初始化时将自动载入镜像到缓存内.这时缓存的写入模式是直写模式.等镜像加载完毕,写入模式才转为设定的值.在载入过程中即使这个配置模式不同于实

29、际操作SuperVolume还是会报告配置的模式.Cache size, in MB (-cs)缓存大小,单位MBSCSCdepends on page size (no default)依赖页面大小(没有默认值)Describes the size of the cache, in megabytes. This is the single most important parameter to consider for cache tuning. For most server systems, 1 to 2 GB of physical memory (RAM) must be rese

30、rved for the operating system, services and applications. The remaining physical memory can be used effectively for SuperCache.缓存的大小,单位MB.这是优化缓存时应考虑的非常重要的参数.对于服务器系统,操作系统 服务 应用程序需要1-2GB的物理内存(RAM).SuperCache将有效地应用其他剩余的物理内存.On systems with more than 4 GB of RAM, SuperCache can dramatically increase per

31、formance with little worry about starving memory from other system components. On systems with 4 GB of RAM or less, due consideration must be given to sharing memory resources.如果系统有大于4G的内存,SuperCache可以极大的提高性能而不必当心系统组件所需求的内存不足.如果系统只有4G内存或更少,在配置时应考虑其他系统组件所需求的内存量.Care should always be exercised when at

32、tempting to allocate as much memory as possible to SuperCache. The system can become memory starved, and its performance greatly hindered. Under extreme circumstance, the system may crash.在分配给SuperCache”尽可能多的内存”时应考虑系统性能会在内存不足时急剧下降,极端地系统甚至会崩溃.To tune cache performance, observe the following two metri

33、cs: memory utilization in Task Manager, and application performance using an appropriate application performance monitoring tool. Set the cache size to a relatively low value (its much faster to allocate memory to the cache in a busy system than to free memory from the cache), and, over a reasonable

34、 period of time, note the values of the two metrics.优化缓存性能时应注意以下两个指标:任务管理器里的内存使用率;以及用适当的性能监测工具检测应用程序的性能.设定一个较小缓存值(系统繁忙时,分配内存比释放内存快很多),并观察那两个指标的值在合理的时间内.Incrementally increase the cache size, watching its effect over time on the two metrics. At some point the performance will peak, after which it wil

35、l drop again. The performance will begin to drop when the other system components start to feel the lack of physical memory and the operating system begins paging out virtual memory. Reset the cache size to the value where the highest performance was realized. The cache is now rough-tuned.递增缓存值,观察一段

36、时间那两个指标的影响.缓存值的递增可能会在某点达到峰值,并在随后的某点再次下降.这是因为当系统组件感到内存不足时,操作系统将使用虚拟内存.把实现性能最高的缓存值设定为当前缓存值.现在缓存经过粗调.Use the other parameters available to fine-tune the caches performance.用其他参数继续微调缓存的性能.Page size, in KB (-ps)页面大小,单位KBSCSC4, 8, 16, 32, 64, 128, 2564, 8, 16, 32, 64, 128, 256Describes the granularity of

37、the cache and of volume mappings, in kilobytes. It is similar to allocation unit size in the NTFS. 缓存在卷映射时的颗粒大小,单位KB.这有点像NTFS的簇. Cache fragmentation: The smaller the page size, the lower the average invalid data per page (eg. lower cache fragmentation). This increases cache efficiency, improving the

38、 probability of cache hits. Reduced cache fragmentation is often the single most important factor in improving overall cache performance.缓存碎片:缓存页面值越小,平均每页面的无效数据就越少(就是越低的缓存碎片).这增加了缓存的效率,提高了缓存命中率.减少缓存碎片通常是提高缓存的整体效能的一个重要因素. Cache overhead: The smaller the page size the greater the system resources requ

39、ired for cache overhead. The physical and virtual memory resources required to manage the cache pages is greater, since there are more pages for a given cache size. Similarly, the physical and virtual memory resources required to manage the volume map is greater, since there are more mappings for a

40、given volume size. And the memory and processor resources required for executing an I/O request are greater, since more pages must be managed per transfer.缓存额外开销:越小的缓存页面值将增大系统的额外开销.在缓存值一定时,页面值减小会导致更多的页面需要管理,用于管理缓存页面的物理内存将增加.类似地,当磁盘卷数据大小一定时,页面值减小会有更多的映射作业,也将增加用于管理磁盘卷映射的物理内存和虚拟内存资源.并且,每次传输将会有更多的页面需要管理

41、,执行I/O操作时将消耗更多的内存和处理器资源.Other factors: Among the factors to include in determining the cache page size are: the average transfer size, the ratio of reads to writes, read-ahead requirements, and the state of file-system caching (enabled or disabled). Generally, larger page sizes should be used only w

42、hen transfer sizes are large. The default Windows NT file-system to storage-class driver transfer size is 64 KB. Disk data compression algorithms are optimized to 64 KB. 其他因素:在众多因素中决定缓存页面大小的是:平均传输尺寸 读和写的比率 预读需求 和 系统缓存状态(开或关).一般地,大的传输尺寸用大的缓存页面值.Windows NT 文件系统默认用64KB传输到存储类别设备.各种磁盘数据压缩算法优化也为64KB.With

43、a high proportion of reads requests, a slightly smaller page size may be desirable. When used in conjunction with the read-ahead feature, read performance may be optimized. In many read-heavy applications, read-ahead values of 1 to 3 will prove effective.如果读取请求比例很高,稍微减少页面大小是可取的.配合预读特性,可能进一步优化读取性能.许多

44、需”沉重地读取”的程序会连续读取一大片数据的程序,预读设定在1-3被证明是有效的.When file-system caching is disabled (files are opened with the FILE_WRITE_THROUGH option), or the storage volume is accessed in RAW mode, the average transfer size is tied directly to the application. PerfMon can report the average size of the transfers, and

45、 the number can be used to calculate and set the appropriate cache page size.当禁用文件系统缓存时(在配置文件中设置打开 FILE_WRITE_THROUGH 选项),或者以RAM模式访问存储卷,平均传输尺寸直接由应用程序决定.用系统内置的PerfMon可以查看这个值,并倾向于把这个值估算或设定为缓存页面值.Read ahead, in pages (-ra)预读页面SCSC(0)-15(0)-15Describes the number of additional, trailing cache pages that

46、 will be read from disk when a read request cannot be serviced immediately from the cache. Applications with a high proportion of reads generally benefit from a read-ahead setting of 1-3. Applications that perform large-size read requests, or frequent bursts of sequential reads, may benefit from a l

47、arger read-ahead setting.读取请求没有命中缓存时,从磁盘预先映射到缓存的页面数.高读取比例的应用程序一般设定为1-3为好.如果应用程序经常执行大尺寸的读取,或者经常突发顺序读取,设定一个更高的预读值为好.The maximum value of this setting varies according to page size. For page sizes of 4, 8, 16, 32, and 64 KB, the maximum value is 15 pages. For page sizes of 128 and 256 KB, the maximum values are 7 and 3 pages, respectively.最大值根据页面值不同而不同.页面值为4 8 16 32 和64KB时最大值为15页.页面值为128KB时为7页,页面值为256KB时最大值为3页.Most Frequently Used Algorithm (-mfu)“最频繁排序的”算法SCSC(off), on(关)

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论