upa / mscp

mscp: transfer files over multiple SSH (SFTP) connections
GNU General Public License v3.0
128 stars 13 forks source link

unable to transfer file between RHEL 7 and ubuntu using mscp #11

Closed jitendraacharya30 closed 7 months ago

jitendraacharya30 commented 7 months ago

I am trying to transfer file between RHEL 7.9 and Ubuntu 22.04. I am able to transfer file using scp. But when I am using mscp I am getting error message as below Copy failed: sftp_async_write: sftp_async_write: Out of memory or Permission denied

Please let me know what are the steps required to fix it.

jitendraacharya30 commented 7 months ago

Here is the version of LIbSSH On Redhat Linux and Ubuntu,

Version of Libssh on Ubuntu 22.04 i.e. 0.9.6-2ubuntu0.22.04.3 Version of LIbssh on Redhat 7.9 i.e. libssh2-1.8.0-4.el7_9.1.x86_64

upa commented 7 months ago

Copy failed: sftp_async_write: sftp_async_write: Out of memory or Permission denied indicates that out of memory or permission denied happens at the local side. Please check the memory utilization on the local machine while executing mscp command, and check and show the permissions of copy source files/directories.

In addition,

  1. please show the output of run mscp to confirm the mscp version in the help string.
  2. please show the mscp command line and output with -vvv option.

If it is a bug on mscp, I need to reproduce the problem on my env.

jitendraacharya30 commented 7 months ago

$ mscp mscp v0.1.4: copy files over multiple SSH connections

Usage: mscp [-46vqDpHdNh] [-n nr_conns] [-m coremask] [-u max_startups] [-I interval] [-s min_chunk_sz] [-S max_chunk_sz] [-a nr_ahead] [-b buf_sz] [-l login_name] [-P port] [-F ssh_config] [-i identity_file] [-c cipher_spec] [-M hmac_spec] [-C compress] [-g congestion] source ... target

$ mscp -vvv /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 xxxx@y.y.y.y:/tmp start to walk source path(s) file: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 -> /tmp/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 walk source path(s) done thread[0]: connecting to 10.193.24.132 thread[1]: connecting to 10.193.24.132 thread[2]: connecting to 10.193.24.132 thread[3]: connecting to 10.193.24.132 thread[4]: connecting to 10.193.24.132 thread[5]: connecting to 10.193.24.132 copy start: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 copy chunk start: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 0x1276e000-0x24edc000 copy chunk start: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 0x0-0x1276e000 copy chunk done: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 0x0-0x1276e000 copy chunk done: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 0x1276e000-0x24edc000 copy chunk start: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 0x3764a000-0x49db8000 copy chunk start: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 0x49db8000-0x5c526000 copy chunk start: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 0x5c526000-0x6ec94000 copy chunk start: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 0x24edc000-0x3764a000 copy chunk done: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 0x3764a000-0x49db8000 copy chunk done: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 0x49db8000-0x5c526000 copy chunk done: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 0x5c526000-0x6ec94000 copy chunk done: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 0x24edc000-0x3764a000 thread[2]: copy failed: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 -> /tmp/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1, 0x003764a000-0x0049db8000, [path.c:427:copy_chunk_l2r] sftp_async_write: sftp_async_write: Out of memory or Permission denied thread[4]: copy failed: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 -> /tmp/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1, 0x001276e000-0x0024edc000, [path.c:427:copy_chunk_l2r] sftp_async_write: sftp_async_write: Out of memory or Permission denied thread[5]: copy failed: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 -> /tmp/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1, 0x0049db8000-0x005c526000, [path.c:427:copy_chunk_l2r] sftp_async_write: sftp_async_write: Out of memory or Permission denied thread[0]: copy failed: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 -> /tmp/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1, 0x0024edc000-0x003764a000, [path.c:427:copy_chunk_l2r] sftp_async_write: sftp_async_write: Out of memory or Permission denied thread[3]: copy failed: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 -> /tmp/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1, 0x0000000000-0x001276e000, [path.c:427:copy_chunk_l2r] sftp_async_write: sftp_async_write: Out of memory or Permission denied thread[1]: copy failed: /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 -> /tmp/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1, 0x005c526000-0x006ec94000, [path.c:427:copy_chunk_l2r] sftp_async_write: sftp_async_write: Out of memory or Permission denied 0/1858699264 bytes copied for 0/1 files [ ] 0% 0.0B /1.7GB 0.0B/s --:-- ETA

upa commented 7 months ago

It seems that mscp successfully open(2)ed the source file /backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1, but read(2) it failed due to permission denied.

Please check the permission of the source file, including SELinux or any other security mechanisms. In addition, try to copy the file from the opposite side: mscp xxxx@z.z.z.z:/backup/FSDMP/backup/full_FSDMP_BF_PT_UPG_26July2023_db_1143149991_88p1 /tmp/

jitendraacharya30 commented 7 months ago

Hello Ryo,

I am able to resolve the copy issue. I think my issue was due to the number of CPU and Memory on the target host. I think to work with mscp we need higher configuration on the target machine.

Secondly, when I transfer a file using scp it is faster than mscp. Could, you please help me to tweak the data transfer performance. Any switch or recommendation do you have here.

upa commented 7 months ago

Secondly, when I transfer a file using scp it is faster than mscp. Could, you please help me to tweak the data transfer performance. Any switch or recommendation do you have here.

It depends on your configuration including machine specification and network setups.

Please see the examples section https://github.com/upa/mscp/blob/main/doc/mscp.rst. Generally, mscp with more connections (-n) will increase throughput until run out of cpu/memory/network resources. Increasing -a value might increase throughput when latency is dominant, and using aes128-gcm@openssh.com cipher would do so if your cpu supports AES-NI.

In addition, if your openssh is very old version (I don't know what openssh version is in RHEL7.9 uses), the scp command uses the obsolete scp protocol (https://lwn.net/Articles/835962/), not sftp, and it might be faster than mscp depending on configurations.