Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1839439
  • 博文数量: 333
  • 博客积分: 10791
  • 博客等级: 上将
  • 技术积分: 4314
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-08 07:39
文章分类

全部博文(333)

文章存档

2015年(1)

2011年(116)

2010年(187)

2009年(25)

2008年(3)

2007年(1)

分类: 服务器与存储

2010-05-19 14:39:56

以下所有关于性能的选项可以在客户端也可以在服务器端。

目录

  • 1 Translator performance/readahead
  • 2 Translator performance/writebehind
  • 3 Translator performance/io-threads
  • 4 Translator performance/io-cache

Translator performance/readahead

read-ahead 选项的功能是根据预测预先读取一列磁盘块。当应用程序忙于处理所读入的程序时,GlusterFS 可以预先读取下一组所需要的数据,从而保持连续高效的读取效率。另外,在传输的时候将较小的IO读取操作整合为较少的大的读取操作以减少网络和磁盘的压力。

volume readahead

  type performance/read-ahead

  option page-count 4           # 2 is default option

  option force-atime-update off # default is off

  subvolumes

end-volume

  • page-size

每个内存块的大小,用于切分从服务器收到的读取流。默认为128KB

  • page-count

预读取块的最大个数。这个最大值仅适用于顺序读取。

  • force-atime-update

保存文件的最新时间,默认是“off”(与mount –o noatime等同)。


注意: 这个功能特性最好与ib-verbs选项或者与10GbE接口配合使用。当使用FastEthernet GbE 接口时,即使不使用read-ahead也可以达到最大吞吐量。

Translator performance/writebehind

一般情况下,写操作会比读操作慢。write-behind使用“后台聚合写”技术极大提升写操作的速度。“后台聚合写”技术就是将多个小的写操作整合成为几个大的写操作,并在后台执行 (non-blocking) 在客户端使用Write-behind 将小的写操作聚合成几个比较大的写操作以减少网络包的数量。在服务器端,如果外来的写请求很小的话,使用该选项以减少磁盘寻道时间。

volume writebehind

  type performance/write-behind

  option cache-size 3MB    # default is equal to aggregate-size

  option flush-behind on    # default is 'off'

  subvolumes

end-volume

  • cache-size (or window-size)

这个操作设定总的写缓存大小。

  • flush-behind

使用该选项将close()flush()放在后台执行,这样的话客户端可以继续执行请求。其默认值为“off”。

  • enable-O_SYNC

使用O_SYNC标志使得write-behind关闭同步文件锁,以防止别的程序日DBMS打断其操作。

Translator performance/io-threads

IO-threads增加并发数,充分利用系统资源。

volume iothreads

  type performance/io-threads

  option thread-count 8  # default is 16

  subvolumes

end-volume

thread-count :线程池中的线程数。

Translator performance/io-cache

这个选项在客户端和服务器端都非常有用。

客户端:当客户端在读取没有编辑的文件时,这个在选项能够减少客户端的网络和服务器的压力。

服务器端:允许多个客户端同时在缓存中更新各自的数据。

A sample IO-Cache config:

volume io-cache

  type performance/io-cache

  option cache-size 64MB             # default is 32MB

  option priority *.h:3,*.html:2,*:1 # default is '*:0'

  option cache-timeout 2             # default is 1 second

  subvolumes

end-volume

  • priority

使用逗号将各个priority的值分开,其值的格式为,:的格式如“*.mpg”, 是整数。如果将数值设置的很小,说明 先释放该类文件。

  • cache-timeout (force-revalidate-timeout)

失效时间,默认值为1秒。

  • cache-size

IO缓存的大小。默认值为64M

阅读(6158) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~