Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My file server on the internet runs OpenSSH, where users upload and download files using scp or WinSCP. At the same time, the server runs some web applications (http), which need higher priority.

Is there a way to give HTTP priority over SSH file transfer? If not, can I limit SSH bandwidth for incomming connections?

share|improve this question
4  
Danger Will Robinson! If you prioritize http over ssh, and your http server becomes saturated, you may not be able to login via ssh. There are settings that could mitigate this, such as letting a connection transfer a certain amount of data before throttling it...but that's getting even more complicated. –  teeks99 Jan 26 '11 at 14:01
add comment

2 Answers 2

up vote 2 down vote accepted

What you're looking for is called traffic shaping, which can be done (for instance) with wondershaper or trickle. Here is a nice article from linux.com summing up how to use trickle to achieve throttling on a single process or on services via trickled.

share|improve this answer
add comment

SCP/SSH packets normally have a bulk TOS. So i think you should raise the TOS of TCP packets from port 80 using iptables TOS target. Then the standard tc-pfifo-fast priomap will do the right thing.

Play around the following:

iptables -t mangle -A PREROUTING -p tcp --sport 80 -j TOS --set-tos Maximize-Throughput
iptables -t mangle -A PREROUTING -p tcp --dport 80 -j TOS --set-tos Maximize-Throughput

Or actually, may be you should try to tune the QOS on your router and not on your server: change the QOS where the bottleneck is.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.