您的位置:首页 > 编程语言 > MATLAB

阿里云搭建基于MatlabMPI的集群(八):NFS性能调优

2017-05-23 16:36 423 查看
MatlabMPI的底层通信很大程度上取决于NFS的传输性能,在阿里云搭建基于MatlabMPI的集群(六):NFS文件共享系统安装与配置中,我们用最基本的moun语句挂载了共享文件目录。笔者在运行4线程并行运算程序时发现,以上挂载方式导致的通信开销非常大,本文介绍NFS挂载的一些参数。

NFS 的 superblock 定义

struct rpc_clnt *    client;    /* RPC 客户端句柄 */
struct nfs_rpc_ops * rpc_ops;   /* RPC 客户端函数向量表 */
int                  flags;     /* 标识信息 */
unsigned int         rsize;     /* 每次读请求的最小数据量 */
unsigned int         rpages;    /* 每次读请求的最小数据量(以页为单位)*/
unsigned int         wsize;     /* 每次写请求的最小数据量 */
unsigned int         wpages;    /* 每次写请求的最小数据量(以页为单位)*/
unsigned int         dtsize;    /* 每次读目录信息的最小数据量 */
unsigned int         bsize;     /* NFS 服务器端的块大小 */
unsigned int         acregmin;  /* 正规文件在缓存中驻留的最小允许时间 */
unsigned int         acregmax;  /* 正规文件在缓存中驻留的最大允许时间 */
unsigned int         acdirmin;  /* 目录文件在缓存中驻留的最小允许时间 */
unsigned int         acdirmax;  /* 目录文件在缓存中驻留的最大允许时间 */
unsigned int         namelen;   /* NFS 服务器端的主机名称最大长度 */
char *               hostname;  /* NFS 服务器端的主机名称 */
struct nfs_reqlist * rw_requests;  /* 异步读写请求队列信息 */


MatlabMPI官网提供的挂载方式为:

mount -o acdirmin=0.1, \
rw,sync,hard,intr,rsize=8192,wsize=8192,nfsvers=2,udp \
node-a:/export/gigabit /wulf/gigabit


实际使用过程中发现adirmin=0.1是一个非法的挂载参数,笔者所用版本的nfs文件共享系统adirmin是一个unsigned int类型的数,故为了较高的传输速度,可以用以下几种方式挂载:

sudo mount -t nfs -o acdirmin=0,rw,sync,hard,intr,rsize=8192,wsize=8192,nfsvers=2,udp hitnode1:/gigabit/kepner /gigabit/kepner


sudo mount -t nfs  -o acdirmin=0 hitnode1:/gigabit/kepner /gigabit/kepner


sudo mount -t nfs -o acdirmin=0,rw,sync,hard,intr,rsize=32768,wsize=32768,nfsvers=4,udp hitnode1:/gigabit/kepner /gigabit/kepner
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  nfs 性能