how to simple QOS

Just im looking to QOS my traffic i read the wiki but many time :cry:

i have 70 clients in my network just i need them all to browse the web in full speed
but if they start download or some flash video or streaming video and that action or season not finish in 3min the speed will be reduced to 40 Kbps until that season finish

so how to do that ?
thank you

Mangle (first and last bytes)

add action=mark-packet chain=prerouting comment=first_bytes connection-bytes=0-512000 disabled=no in-interface=wan
new-packet-mark=first_bytes passthrough=no protocol=tcp src-port=80
add action=mark-packet chain=postrouting comment=“” connection-bytes=0-512000 disabled=no dst-port=80
new-packet-mark=first_bytes_out out-interface=wan passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment=last_bytes connection-bytes=512001-4294967295 disabled=no
in-interface=wan new-packet-mark=last_bytes_in passthrough=no protocol=tcp src-port=80
add action=mark-packet chain=postrouting comment=“” connection-bytes=512001-4294967295 disabled=no dst-port=80
new-packet-mark=last_bytes_out out-interface=wan passthrough=no protocol=tcp


prior with htb (tree)

32 name=“www_firs_bytes_down” parent=download_wan1 packet-mark=first_bytes limit-at=0 queue=wireless-default
priority=2 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

33 name=“www_last_bytes_down” parent=download_wan1 packet-mark=last_bytes_in limit-at=0 queue=wireless-default
priority=6 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

34 name=“www_first_bytes_up” parent=upload_wan1 packet-mark=first_bytes_out limit-at=0 queue=wireless-default
priority=2 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

35 name=“www_last_bytes_out” parent=upload_wan1 packet-mark=last_bytes_up limit-at=0 queue=wireless-default
priority=6 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

if you want you can put a limit to “last-bytes”

regards