Version 1.004.0 of SFTP Gateway supports configurable multi-threading for uploading files to S3 in parallel.
In previous versions of SFTP Gateway, it was recommended that the server configuration disable the multi-threading capabilities to avoid overloading the system’s memory. In the new version, we recommend enabling the multi-threading capabilities and setting a fixed number of worker threads to alleviate the load on the system’s memory .
The number of workers is set to 5 by default, which functions well on instances as small as a 1GB t2.micro instance. On larger instances, the number of workers can be increased, around 5 slots per every 2 GB of memory is a good rule of thumb for setting the number of workers.
To configure SFTP Gateway to use multi-threading:
- Modify the
/home/ec2-user/.sftpgateway/sftpgateway.propertiesfile to set
- Set the desired number of workers by running the command:
ts -S nwhere n is the number of workers.
- Edit the
/usr/local/bin/movetos3.shto ensure the configured number of workers is preserved through reboots.
Large sets of files
In version 1.004.0, SFTP Gateway can handle more files uploaded to the server at one time. The number of files the server can handle, now depends on the memory size of the instance. To calculate the number of files your instance can handle at one time, take the memory size in KB and divide it by 256. For example, a 1GB instance can handle about 3,900 files uploaded to it at a time.