在执行小型写入时,我一直在努力解决 SMB/CIFS 共享的性能问题。
首先,让我描述一下我当前的网络设置:
服务器
客户端(同一台计算机双启动有线 Gig-E)
配置文件
[global]
printcap name=cups
winbind enum groups=yes
include=/var/tmp/nginx/smb.netbios.aliases.conf
socket options=TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
security=user
local master=no
realm=*
passdb backend=smbpasswd
printing=cups
max protocol=SMB3
winbind enum users=yes
load printers=yes
workgroup=WORKGROUP
Run Code Online (Sandbox Code Playgroud)
我目前正在使用以下用 C++ 编写的程序(在此处的GitHub 上)测试小型写入性能:
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
int main(int argc, char* argv[])
{
ofstream outFile(argv[1]);
for(int i = 0; i < 1000000; i++)
{
outFile << "Line …Run Code Online (Sandbox Code Playgroud)