Seafile Server - Limit upload/download speed of files

Does someone have an easy solution/guide to limiting the raw upload/download bandwidth of files to the seafile server on port 8082. This is because some of our libraries are shared with 10+ people. Recently I saw that my server was receiving 32 megabits in, whilst outputting 320 megabits which appeared to be maxing out our AWS instance’s bandwidth ( a t2 medium). The result being that other people using the web interface (Seahub on port 8000) were having a hard time and thought there was something wrong with the server. Ideally I would like to limit the traffic on port 8082 to a value, possibly 250 megabit, so that people browsing the web interface will not be affected when others are uploading to popular libraries that are shared with many people.

It would be really nice if it was possible to just configure this through the web interface, but I’m guessing this is unlikely. I can only see options to limit bandwidth on the client.

You’d like need to do this via front end web server proxy. For example if you had Apache in front of seafile server, you could use mod_ratelimit (there are other Apache modules that do similar things as well). Other web servers/proxies most likely have similar features (nginx has limit_rate and other settings).

I was kind of hoping for a solution around using a tool like wonder shaper or trickle, but can’t find any info about limiting a specific port, rather than the entire eth0 ineterface.

Latency to the nearest server:

  • No other network traffic: 52ms
  • Uplink totally saturated: 2324ms
  • Uplink totally saturated, with Smart Queue Management: 58ms