Files
Linux/存储/NFS/NFS服务优化.md
offends cee91802b3
Some checks failed
continuous-integration/drone Build is failing
synchronization
2025-08-25 15:57:40 +08:00

28 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

> 本文作者:丁辉
# NFS服务优化
> NFS内核优化
```bash
cat >>/etc/sysctl.conf<<EOF
sunrpc.tcp_slot_table_entries=128
sunrpc.udp_slot_table_entries=128
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.wmem_max = 16777216
net.core.rmem_max = 16777216
EOF
sysctl -p
```
**参数解释**
| 参数 | 描述 |
| :---------------------------: | :----------------------------------------------------------: |
| sunrpc.tcp_slot_table_entries | TCP 协议下 RPC 服务的 slot table entries 数量。 |
| sunrpc.udp_slot_table_entries | UDP 协议下 RPC 服务的 slot table entries 数量。 |
| net.core.wmem_default | 此参数表示TCP连接的默认套接字发送缓冲区大小以字节为单位。它确定为每个套接字分配的发送缓冲区的初始大小。 |
| net.core.rmem_default | 此参数表示TCP连接的默认套接字接收缓冲区大小以字节为单位。它确定为每个套接字分配的接收缓冲区的初始大小。 |
| net.core.wmem_max | 此参数表示TCP连接的最大套接字发送缓冲区大小以字节为单位。它限制了每个套接字的发送缓冲区可以增长到的最大大小。 |
| net.core.rmem_max | 此参数表示TCP连接的最大套接字接收缓冲区大小以字节为单位。它限制了每个套接字的接收缓冲区可以增长到的最大大小。 |