Am 24.08.2016 um 11:57 schrieb Milano Nicolum: > Another symptom of the issue is that listing the directory content via sftp.ls > sftp.ls(sftpAbsolutePath) call takes approx. 100 seconds, tcpdump says it > transfers about 1555 KB server -> client and 58KB client -> server. > > If I connect to the server via SSH (using putty), run the ll command in > console > and redirect the command output to a textfile, the resulting file has 768 KB > instantly.
SFTP is a different thing than SSH-shell, so it's not easy to compare these. what was the exact command for listing the files in the shell? Since you ran tcpdump, where exactly were the 100 seconds happening? While waiting for data from the server or is it a slower transfer of bytes? > I understand that there is allways difference in the computing time, part of > it depends on the fact computing is done on server/client side. (Even though > the difference is huge). But where is the additional data traffic coming > from? A reason might be that you compare apples to pears. In case you entered ls subdir in the shell and you are listing the directory with /home/user/subdir in SFTP, the SFTP server will most likely return the filenames including their paths while the shell only returns the names. This would easily explain the increased amount of data. Also there is additional data per file containing the attributes (see next paragraph). With short filenames this easily becomes the majority of tranfered data. In case the time got lost while waiting for the server the reason might be that the file-listing in SFTP provides more information than the resulting file listing in a shell. For every file the FileAttributes are retrieved from the file system containing things like last access time, "extended attributes", etc. Some of them are part of the directory-entry itself that can be accessed quickly. Others are not that easy to retrieve (or at least need an extra file-system-access per file) and might be the reason why your listing takes exponentially longer for longer files. This is not a SFTP-specific problem, you can run into the same problem when using the file-command with search-criterias for last access time, etc. Cheers, Lothar ------------------------------------------------------------------------------ _______________________________________________ JSch-users mailing list JSch-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jsch-users