Operating System - HP-UX
1836388 Members
3115 Online
110100 Solutions
New Discussion

Re: scp is slower then ftp

 
gb karki
Frequent Advisor

scp is slower then ftp

Hi,

We are working in HP-UX 11i.v3 and using scp for coping file to remote location. It's very much slow, you can see below mention logs.

how can we improve the speed.

Here is the sample output of SCP and FTP file transfers



scp ESRSPATCH.rar.filepart 10.108.129.12:/tmp

918395

ESRSPATCH.rar.filepart 100% 897KB 24.2KB/s 00:37

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ftp> put ESRSPATCH.rar.filepart

200 PORT command successful.

150 Opening BINARY mode data connection for ESRSPATCH.rar.filepart.

######################################################################################

######################################################################################

######################################################################################

######################################################################################

######################################################################################

######################################################################################

######################################################################################

######################################################################################

######################################################################################

######################################################################################

####################################

226 Transfer complete.

918395 bytes sent in 1.87 seconds (480.08 Kbytes/s)



Regards
Karki

5 REPLIES 5
H.Merijn Brand (procura
Honored Contributor

Re: scp is slower then ftp

That is logical for two reasons

1. sftp/scp uses encryption where ftp does not. This will use more CPU (on both ends) and increase bandwith usage
2. sftp/scp probably uses compression, which causes increased CPU usage (on both ends) but /might/ decrease the bandwidth usage.

If compression is enabled and you transfer gzip/bzip2/lzma files, the size of the data sent will most likely be bigger than without compression, as compressing already compressed data will in most cases lead to a size increase instread of a size decrease

You can disable compression to specific machines in your ~/.ssh/config, somewhat like

--8<---
Host hostname
Compression no
-->8---

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
gb karki
Frequent Advisor

Re: scp is slower then ftp

Hi,

I 'm coping from root and have put the entry in vi /.ssh/config

Compression no

after that i copied 3 mb file but still very slow.

# scp -p PHSS_38527 10.108.129.33:/tmp/
Password:
PHSS_38527 7% 272KB 0.0KB/s - stalled -

Regards
Karki
H.Merijn Brand (procura
Honored Contributor

Re: scp is slower then ftp

Do both systems use /dev/random for encryption?

The default encryption method is 3des. If either end needs to go through big trouble to use that (HP-UX 11.00 and older do not have /dev/random support built in the kernel by default, so you need to install new modules to use that)

If the encryption is causing the slowdown, you have to look at your options. If the network you trandsfer over is really safe, just use rcp or ftp, otherwise you'll have to live with the encryption slowdown or experiment with setting different encryption algorithms for the slow machine. See 'man ssh_config'

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
UVK
Trusted Contributor

Re: scp is slower then ftp

Not sure if you have observed this while using winscp there is a threshold for the rate of transfer with a max value of 200kbps which i think is the max rate at which scp can tranfer data.
-------------------------------------------
Like it or worked !! Click kudos !!
Bill Hassell
Honored Contributor

Re: scp is slower then ftp

You will find ftp is the fastest method to transfer files that is commonly available on multiple servers. ftp changes block size to better match the throughput of the link. It also allows for overlapping acknowledgments to keep more data flowing in the pipe. This is especially important for wide area networks where there is a very large ping time. scp is a simple record transfer, like rcp and therefore, inefficient for good network performance. Each time scp waits for a reply, it must wait for the reply. The best you can do is to compress the data using the -C option for scp. And like all network transfers, actual performance depends on both computers as well as the slowest link in the network.


Bill Hassell, sysadmin