If you are using OS traffic shaping, the "Use IP Type of Service (TOS)" is useful. Uploads use "maximum throughput", Downloads use "low-delay" and other traffic is normal service. This can be used to classify the gnutella traffic, with the iptables MANGLE table and mark.
The wondershaper and myshaper scripts provide a good base to start controlling your bandwidth. The main idea is to use the heiarchical token bucket (htb) queuing discipline. This ensures that all traffic classes get a minimum amount of bandwidth, but they can also borrow bandwidth if another class isn't using it.
NOTE: Most Linux distributions do not provide a kernel with traffic shaping built-in. You may be required to re-compile your kernel in order to use system wide bandwidth control.