具体表现是:我使用rsync往服务器同步文件,我设置了超时timeout=5(不设置这个值也会出现这样的问题),然后运行大约1小时后,不断出现timeout的错误提示,出现大约10多个后,程序卡在rsync上不往下运行。此时的CPU很高,如下:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2243 luffyctz 25 0 3900 1184 944 R 99 0.0 8:08.98 rsync
请问这是什么问题呢?
server端的log补充:
2015/03/24 20:05:59 [9603] Service registration expired, refreshing it
2015/03/24 20:05:59 [9603] rsyncd registering 1 service with slpd for 300 seconds:
2015/03/24 20:05:59 [9603] Could not resolve hostname: Name or service not known
2015/03/24 20:10:36 [23380] rsync error: timeout in data send/receive (code 30) at io.c(171) [receiver=2.6.8]
客户端的错误提示:
rsync error: timeout in data send/receive (code 30) at io.c(171) [receiver=2.6.8]
rsync: connection unexpectedly closed (4 bytes received so far) [sender]
阿神2017-04-17 13:09:07
-v can add log level, you can try adding it.
In addition, your rsync server can also configure the log level. What errors does the rsync server display?
迷茫2017-04-17 13:09:07
Clear the number and file size of synchronized files. I once encountered a situation where the CPU was very high and there was no speed limit, and it was occupied crazy. Use --bwlimit=500
to limit it to 500kb/s.
In addition, you should really open the log and paste the complete log. Just saying a timeout cannot diagnose