zoukankan      html  css  js  c++  java
  • NFS生产场景优化

    1.硬件上多块网卡bond,增加吞吐量,至少千兆。sas/ssd磁盘组raid5或raid10

    2.服务端配置:/data 172.16.1.0/24(rw,sync,all_squash,anonuid=65534,anongid=65534)

    3.客户端挂载:mount -t nfs -o nosuid,noexec,nodev,noatime,nodiratime,rsize=131072,wsize=131072 172.16.1.15:/data /mnt

    注释:nosuid:禁止suid权限 noexec:禁止执行可执行文件 nodev:禁止字符设备和块设备文件 noatime:不更新访问时间

    rsize、wsize:NFS读写块的大小,即最大一次读写的数据量。显然如果太小,那么读写次数就会增加,IO就会增加。如果太大,则

    可能导致传输过程中数据的丢失。

    4.NFS服务器内核优化:

    vim /etc/sysctl.conf

    net.core.rmem_default = 8388608            #TCP默认数据接收窗口大小

    net.core.wmem_default = 8388608           #TCP默认数据发送窗口大小

    net.core.rmem_max = 16777216              #TCP最大数据接收窗口大小

    net.core.wmem_max = 16777216             #TCP最大数据发送窗口大小

    可以理解为TCP-socket读写缓冲区的大小,NFS和mount之间通过TCP连接。

  • 相关阅读:
    luogu P3804 【模板】后缀自动机 (SAM)
    莫队
    luogu P4688 [Ynoi2016]掉进兔子洞
    FZOJ 2331 LYK loves graph
    字典树
    luogu P6623 [省选联考 2020 A 卷] 树
    luogu P6018 [Ynoi2010]Fusion tree
    luogu P3264 [JLOI2015]管道连接
    最小斯坦纳树
    9. 回文数
  • 原文地址:https://www.cnblogs.com/Peter2014/p/7684422.html
Copyright © 2011-2022 走看看