I have ADSL internet, and when there is an application uploading to the Internet at full speed (e.g. Skype or Chrome during file uploads), the download bandwidth becomes very very slow. Meaning I cannot practically browse webpages during uploads and even pinging 8.8.8.8
takes 2-3 seconds; normally that would take under 0.06 seconds.
In Mac OS X Mavericks (10.9) and earlier I used throttled to limit the outgoing traffic, so the internet was usable during uploads.
Throttled uses ipfw for throttling, which has been removed from Yosemite (10.10). The recommended alternative is pf
, but the Mac OS X kernel does not have ALTQ support, which would enable the traffic shaping (so as I tried, all altq commands are simply ignored).
I also tried the Network Link Conditioner app, but that does not throttle the outgoing packages correctly, so the Internet is still unusable during uploads. The average outgoing bandwidth is limited, but it is waving/oscillating with a few seconds period.
So how can I limit the outgoing bandwidth? Or how can I raise the HTTP traffic priority at least? Can I install ipfw
somehow? Any other idea?
Update: The configuration which works for me the best so far is to make HTTP/HTTPS/SSH unlimited and limit upload speed for everything else. This makes the internet usable when both the cloud backup and torrent uploading at the same time. Here is the script:
#!/bin/bash
# Reset dummynet to default config
dnctl -f flush
pfctl -F all
# Compose an addendum to the default config; creates a new anchor
(cat /etc/pf.conf &&
echo 'dummynet-anchor "my_anchor"' &&
echo 'anchor "my_anchor"') | pfctl -q -f -
# Configure the new anchor
cat <<EOF | pfctl -q -a my_anchor -f -
no dummynet quick on lo0 all
dummynet out all pipe 1
dummynet out proto icmp all pipe 2
dummynet out proto tcp to any port 443 pipe 2
dummynet out proto tcp to any port 80 pipe 2
dummynet out proto tcp to any port 22 pipe 2
EOF
# Create the dummynet queue
dnctl pipe 1 config bw 30Kbyte/s queue 50
dnctl pipe 2 config queue 50
# Activate PF
pfctl -E
To check that dnctl is properly configured run sudo dnctl list
. You should see the 2 queues, the first one is limited, the second one is unlimited:
$ sudo dnctl list
00001: 240.000 Kbit/s 0 ms 50 sl. 1 queues (1 buckets) droptail
mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
0 udp 192.168.1.XX/XXX XX.XX.XX.XX/XXX 1372 1517617 6 8010 96
00002: unlimited 0 ms 50 sl. 1 queues (1 buckets) droptail
mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
0 tcp 192.168.1.XX/XXX XX.XX.XX.XX/XXX 27 4557 0 0 0
IceFloor runs on OS X 10.10 Yosemite with limited functionalities. Bandwidth management is not supported.