lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.1k stars 161 forks source link

High CPU usage #634

Open paulmenzel opened 3 years ago

paulmenzel commented 3 years ago

[Edited]

Uploading several files with over 100 GB size using mput -c *.tar.gz with a bandwidth limit of 10 MB/s (set net:limit-total-rate 10000000), the CPU usage is displayed by 100 % by top, and around 62 % using ps.

$ ps -o pid,tid,class,ni,pri,psr,pcpu,stat,comm -C lftp
  PID   TID CLS  NI PRI PSR %CPU STAT COMMAND
14318 14318 TS    0  19   2 62.3 S+   lftp

Is that expected? I wouldn’t have thought, that the CPU is involved that much in a file transfer.

paulmenzel commented 3 years ago

I recorded a sample using perf, but do not see anything yet, as I do not know how to do that with C++ programs.

 $ sudo perf record -p 14318 -F 999 -o /scratch/local2/lftp.data -- sleep 10
 [ perf record: Woken up 2 times to write data ]
 [ perf record: Captured and wrote 0.390 MB /scratch/local2/lftp.data (9985 samples) ]
 $ perf report -i /scratch/local2/lftp.data -s comm,dso
  57.61%  lftp  [kernel.kallsyms]
  40.61%  lftp  lftp
   0.80%  lftp  libc-2.33.so
   0.79%  lftp  [vdso]
   0.17%  lftp  [unknown]
   0.01%  lftp  [ixgbe]
   0.01%  lftp  [kvm]