我试图让 iperf3 作为 Windows 服务运行。 我在文档中看到关于 -D 命令和 -R 命令的注释,用于安装和删除服务。
我能够运行 -D 并且它在 Windows 的后台运行,但不能作为 services.msc 下的 Windows 服务。
我已经在 Windows 2008R2、Windows 2012R2 和 Windows 10 中进行了测试。
是否可以作为 Windows 服务运行? 如果是这样,我应该运行什么命令?
这是我正在运行的:iperf3.exe -s -D
我尝试使用最新版本的 iperf 2。相同的行为。
iperf3 确实是为类 UNIX 操作系统设计的,并且仅受其支持。
有些人制作了 Windows 变体,您应该尝试联系其中之一,或者也许有人会看到此问题评论。
@bmah888您能否删除用户文档中将 iperf 作为 Windows 服务运行的引用? 它令人困惑,因为它不受支持并且不再起作用。 https://iperf.fr/iperf-doc.php#service
嗯,谢谢你的建议。 我不控制 iperf.fr 上的内容(该部分似乎适用于 iperf2,而我维护 iperf3),但让我看看我是否可以将您的信息传达给合适的人。
Install iperf3 as Windows service.cmd
::
:: Install iperf3 as Windows service
::
SET iperfdir=C:\iperf3
SET iperfprog=iperf3.exe
SET iperflog=iperf3-server-logs.txt
SET servicename=iperf3
SET start=auto
SET binpath=%iperfdir%\srvany.exe
SET iperfoptions=--server --daemon --port 5201 --version4 --format [m] --verbose --logfile %iperfdir%\%iperflog%
SET displayname=iPerf3 Service
SET description=iPerf3 Service provide a possibility to test network speed
::
::
sc.exe create %servicename% displayname= "%displayname%" start= %start% binpath= "%binpath%"
sc description %servicename% "%description%"
::
reg add HKLM\SYSTEM\CurrentControlSet\services\%servicename%\Parameters /v AppParameters /t REG_SZ /d "%iperfoptions%"
reg add HKLM\SYSTEM\CurrentControlSet\services\%servicename%\Parameters /v Application /t REG_SZ /d "%iperfdir%\%iperfprog%" /f
::
pause
::
Install iperf3 as Windows service.cmd
文件。net start iperf3
net stop iperf3
我们注意到有时,服务模式下的 iperf3 停止工作,只有服务重启才有帮助。 作为一个简单的解决方法,我们创建了一个简单的批处理文件并安排它每天运行:
Restart-iperf3-service.cmd
::
:: Stop iperf3 service
net stop iperf3
::
:: Start iperf3 service
net start iperf3
::
nssm 是比资源工具包中的 srvany 更好的选择。
最有用的评论
将 iperf3 安装为 Windows 服务
要求
安装
Install iperf3 as Windows service.cmd
Install iperf3 as Windows service.cmd
文件。问题
我们注意到有时,服务模式下的 iperf3 停止工作,只有服务重启才有帮助。 作为一个简单的解决方法,我们创建了一个简单的批处理文件并安排它每天运行:
Restart-iperf3-service.cmd
相关文件