0 votes
by (150 points)

Hi,

how can I throttle / limit the up/download speed per server or per user in Rebex (SFTP) file server.

Best regards,
Kai

Applies to: File Server

1 Answer

0 votes
by (147k points)

Unfortunately, Rebex File Server does not support transfer speed throttling yet. We have been considering adding this feature, but it won't appear in the near term.

At the moment, the only way to achieve per-user or per-session bandwidth throttling is to implement a custom virtual file system provider (possibly based on the DriveFileSystemProvider class from our sample app) that adds Stream-based data throughput throttling. However, this would be much more complex than simply tweaking a per-user setting.

by (150 points)
I will happily go the path of custom virtual file system provider.
I found this for starters
https://gist.github.com/passy/637319
by (147k points)
That looks like a good class to get started, although it would only allow per-stream throttling (instead of per-session or per-user). If the client opens multiple SFTP sessions, or transfers multiple files per session (rare but possible in SFTP protocol), they might get around the bandwidth limit. But perhaps this is not an issue in your scenario.

To give this a try, download Rebex File Server and check out the DriveFileSystemProvider class in FileServerCustomFS_CS sample app. Find the GetContent method, and wrap readWriteStream in ThrottledStream before passing it to NodeContent.CreateImmediateWriteContent method. That should enable per-transfer speed throttling.
...