I have use case where I need to move some payload from one server to the other. Both servers are placed within the same data center (even in the same Amazon's availability zone).
I have service / endpoint, that needs to trigger a file transfer whenever called through HTTP/HTTPS. I need to speed up the transfer, as it currently can even take 15+ seconds. Making it asynchronous (eg. handled with task queue like Celery) not necessarily solves my problem (transfer still needs to be performed quickly - does not matter much, whether during the request that triggered it, or outside of it).
The files are generally like 100KB-500KB in size and I have the following options:
- SSH transfer,
- other secure transfers between file systems (SSHFS?,
rsync
through SSH?), - HTTP/HTTPS request with file as a body,
- something else?
The files are always new (so sending a diff between previous version and newer one is not applicable). They are text files, so compression could possibly speed up the transfer.
Does anyone have thoughts on the fastest way to do that (quickly and securely transfer file between servers)? Servers are separate instances and most likely will stay this way. Also security plays significant role. But outside of these restrictions, I am able to install stuff on the servers or mount directories.