LINUX.ORG.RU
ФорумAdmin

Почему не срабатывает htbinit???


0

0

Вообщем решил для опыта ограничить скорость на вмварю а именно на фейс vmnet8, через него идёт nat во фрю, стоящую на варе. Так вот, поставил htbinit (у мя джента, а потому ставил emerge htbinit). Сделал

/etc/init.d/htbinit recreate
/etc/init.d/htbinit reload

После этого в /etc/htbinit появились файлы для eth0 и eth1, удалил их для eth1 и переименовал для eth0 в vmnet8 (так же заменил vmnet8-2:30.www на vmnet8-2:30.ftp заменив внутри порт на 21). Далее запустил htbinit

/etc/init.d/htbinit start

на что он сказал ОК. Я подумал: "ОК", и решил проверить ограничитель для чего попытался скопировать файл с фтп с адреса 192.168.147.1 который есть хост машины для вари (т.е. джента), но файл стал копироваться на максимально возможной скорости и даже не ограничилась до положенных 61 кбит/сек. Вот конфиги:


/etc/htbinit # ls
vmnet8 vmnet8-2:10.minlatency vmnet8-2:30.ftp
vmnet8-2.root vmnet8-2:20.maxthroughput vmnet8-2:40.default
/etc/htbinit # cat vmnet8
DEFAULT=40
root@cyclon /etc/htbinit # cat vmnet8-2.root
RATE=244Kbit
BURST=2k
/etc/htbinit # cat vmnet8-2:10.minlatency
CEIL=244Kbit
RATE=12Kbit
BURST=2K
LEAF=sfq
PRIO=3
RULE=:22,
RULE=:21,
RULE=:23,
RULE=:6667,
RULE=:53,
RULE=:25,
RULE=:110,
RULE=:143,
/etc/htbinit # cat vmnet8-2:20.maxthroughput
CEIL=230Kbit
RATE=110Kbit
BURST=2K
LEAF=sfq
PRIO=5
RULE=:20,
/etc/htbinit # cat vmnet8-2:30.ftp
CEIL=244Kbit
RATE=61Kbit
BURST=2K
LEAF=sfq
PRIO=4
RULE=:21,
/etc/htbinit # cat vmnet8-2:40.default
CEIL=244Kbit
RATE=61Kbit
BURST=2k
LEAF=sfq
PRIO=6

Что делать и что не так?!

Заранее спасибо!!!!

★★★★★

Вот что ещё обнаружил, кажется эта шняга вообще не смотрит эти 
правила. А выяснилось просто, у мя стало тормозить всё от инета, до 
локальной сети. И я решил посмотреть что за.... вообщем то что я 
увидел меня ошарашило

# tc filter show dev eth0
filter parent 1: protocol ip pref 100 u32
filter parent 1: protocol ip pref 100 u32 fh 800: ht divisor 1
filter parent 1: protocol ip pref 100 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10
  match 00000016/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 800::801 order 2049 key ht 800 bkt 0 flowid 1:10
  match 00000015/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 800::802 order 2050 key ht 800 bkt 0 flowid 1:10
  match 00000017/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 800::803 order 2051 key ht 800 bkt 0 flowid 1:10
  match 00001a0b/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 800::804 order 2052 key ht 800 bkt 0 flowid 1:10
  match 00000035/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 800::805 order 2053 key ht 800 bkt 0 flowid 1:10
  match 00000019/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 800::806 order 2054 key ht 800 bkt 0 flowid 1:10
  match 0000006e/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 800::807 order 2055 key ht 800 bkt 0 flowid 1:10
  match 0000008f/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 800::808 order 2056 key ht 800 bkt 0 flowid 1:20
  match 00000014/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 800::809 order 2057 key ht 800 bkt 0 flowid 1:30
  match 00000050/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 800::80a order 2058 key ht 800 bkt 0 flowid 1:30
  match 000001bb/0000ffff at 20

тут можно видеть что изменения установилисть на eth0 а не на том что
 хотелось бы, т.е. не на vmnet8. И это ещё не всё, я решил вернуть 
правила для eth0, полагая что без них никак, и задал там скорость 
100Mbit но это не помогло, из указанного выше вывода видно, что 
скорость по прежнему 800 kbt и никаких 100Mbt. Вот так вот.

Вопрос старый - что делать?!

cyclon ★★★★★
() автор топика
Ответ на: комментарий от anonymous

Вот что имемм если compile:

root@cyclon / # htbinit compile
/sbin/tc qdisc del dev eth0 root
/sbin/tc qdisc add dev eth0 root handle 1 htb default 40

/sbin/tc class add dev eth0 parent 1: classid 1:2 htb rate 100Mbit burst 2k

/sbin/tc class add dev eth0 parent 1:2 classid 1:40 htb rate 100Mbit ceil 100Mbit burst 2k prio 0
/sbin/tc qdisc add dev eth0 parent 1:40 handle 40 sfq perturb 10

root@cyclon / # htbinit stats
### eth0: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 358023746 bytes 261459 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### vmnet1: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 1104 bytes 12 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### vmnet8: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 1134310253 bytes 2359086 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### bnep0: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 5651 bytes 51 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### ppp0: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 14475082 bytes 37557 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

А вот что если через /etc/init.d/htbinit start:

root@cyclon / # /etc/init.d/htbinit start
 * Starting htbinit ...                                                                             [ ok ]
root@cyclon / # htbinit stats
### eth0: queueing disciplines

qdisc htb 1: r2q 10 default 40 direct_packets_stat 4
 Sent 157304 bytes 176 pkt (dropped 0, overlimits 216 requeues 0)
 rate 0bit 0pps backlog 0b 88p requeues 0
qdisc sfq 10: parent 1:10 limit 128p quantum 1514b perturb 10sec
 Sent 160 bytes 2 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 20: parent 1:20 limit 128p quantum 1514b perturb 10sec
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 30: parent 1:30 limit 128p quantum 1514b perturb 10sec
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 40: parent 1:40 limit 128p quantum 1514b perturb 10sec
 Sent 153155 bytes 168 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 88p requeues 0

### eth0: traffic classes

class htb 1:10 parent 1:2 leaf 10: prio 3 rate 6000bit ceil 122000bit burst 2Kb cburst 1614b
 Sent 160 bytes 2 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 lended: 2 borrowed: 0 giants: 0
 tokens: 2668085 ctokens: 103016

class htb 1:2 root rate 122000bit ceil 122000bit burst 2Kb cburst 1614b
 Sent 70728 bytes 84 pkt (dropped 0, overlimits 0 requeues 0)
 rate 7992bit 1pps backlog 0b 0p requeues 0
 lended: 63 borrowed: 0 giants: 0
 tokens: -179025 ctokens: -208972

class htb 1:20 parent 1:2 leaf 20: prio 5 rate 55000bit ceil 115000bit burst 2Kb cburst 1613b
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 lended: 0 borrowed: 0 giants: 0
 tokens: 314180 ctokens: 118418

class htb 1:30 parent 1:2 leaf 30: prio 4 rate 31000bit ceil 122000bit burst 2Kb cburst 1614b
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 lended: 0 borrowed: 0 giants: 0
 tokens: 557419 ctokens: 111692

class htb 1:40 parent 1:2 leaf 40: prio 6 rate 30000bit ceil 122000bit burst 2Kb cburst 1614b
 Sent 153873 bytes 170 pkt (dropped 0, overlimits 0 requeues 0)
 rate 16088bit 2pps backlog 0b 88p requeues 0
 lended: 19 borrowed: 63 giants: 0
 tokens: -668883 ctokens: -198462


### eth0: filtering rules

filter parent 1: protocol ip pref 100 u32
filter parent 1: protocol ip pref 100 u32 fh 800: ht divisor 1
filter parent 1: protocol ip pref 100 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10  (rule hit 176 success 0)
  match 00000016/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::801 order 2049 key ht 800 bkt 0 flowid 1:10  (rule hit 176 success 0)
  match 00000015/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::802 order 2050 key ht 800 bkt 0 flowid 1:10  (rule hit 176 success 0)
  match 00000017/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::803 order 2051 key ht 800 bkt 0 flowid 1:10  (rule hit 176 success 2)
  match 00001a0b/0000ffff at 20 (success 2 )
filter parent 1: protocol ip pref 100 u32 fh 800::804 order 2052 key ht 800 bkt 0 flowid 1:10  (rule hit 174 success 0)
  match 00000035/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::805 order 2053 key ht 800 bkt 0 flowid 1:10  (rule hit 174 success 0)
  match 00000019/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::806 order 2054 key ht 800 bkt 0 flowid 1:10  (rule hit 174 success 0)
  match 0000006e/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::807 order 2055 key ht 800 bkt 0 flowid 1:10  (rule hit 173 success 0)
  match 0000008f/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::808 order 2056 key ht 800 bkt 0 flowid 1:20  (rule hit 173 success 0)
  match 00000014/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::809 order 2057 key ht 800 bkt 0 flowid 1:30  (rule hit 171 success 0)
  match 00000050/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::80a order 2058 key ht 800 bkt 0 flowid 1:30  (rule hit 171 success 0)
  match 000001bb/0000ffff at 20 (success 0 )

### vmnet1: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 1104 bytes 12 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### vmnet8: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 1134331991 bytes 2359415 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### bnep0: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 5651 bytes 51 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### ppp0: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 14654880 bytes 38284 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

Фигня какая то.

cyclon ★★★★★
() автор топика
Ответ на: комментарий от cyclon

Вот ещё вывод:

root@cyclon / # htbinit stats
### eth0: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 53441156 bytes 40398 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### vmnet1: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 1104 bytes 12 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### vmnet8: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 1134442835 bytes 2361097 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### bnep0: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 5651 bytes 51 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### ppp0: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 16664618 bytes 43754 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

root@cyclon / # htbinit compile
/sbin/tc qdisc del dev eth0 root
/sbin/tc qdisc add dev eth0 root handle 1 htb default 40

/sbin/tc qdisc del dev vmnet8 root
/sbin/tc qdisc add dev vmnet8 root handle 1 htb default 40

/sbin/tc class add dev eth0 parent 1: classid 1:2 htb rate 100Mbit burst 2k

/sbin/tc class add dev eth0 parent 1:2 classid 1:40 htb rate 100Mbit ceil 100Mbit burst 2k prio 0
/sbin/tc qdisc add dev eth0 parent 1:40 handle 40 sfq perturb 10

/sbin/tc class add dev vmnet8 parent 1: classid 1:2 htb rate 244Kbit burst 2k

/sbin/tc class add dev vmnet8 parent 1:2 classid 1:30 htb rate 61Kbit ceil 244Kbit burst 2K prio 4
/sbin/tc qdisc add dev vmnet8 parent 1:30 handle 30 sfq perturb 10
/sbin/tc filter add dev vmnet8 parent 1:0 protocol ip prio 100 u32 match ip sport 21 0xffff classid 1:30

/sbin/tc class add dev vmnet8 parent 1:2 classid 1:40 htb rate 61Kbit ceil 244Kbit burst 2k prio 6
/sbin/tc qdisc add dev vmnet8 parent 1:40 handle 40 sfq perturb 10

root@cyclon / # htbinit start
root@cyclon / # htbinit stats
### eth0: queueing disciplines

qdisc htb 1: r2q 10 default 40 direct_packets_stat 6
 Sent 100686 bytes 83 pkt (dropped 0, overlimits 91 requeues 0)
 rate 0bit 0pps backlog 0b 44p requeues 0
qdisc sfq 10: parent 1:10 limit 128p quantum 1514b perturb 10sec
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 20: parent 1:20 limit 128p quantum 1514b perturb 10sec
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 30: parent 1:30 limit 128p quantum 1514b perturb 10sec
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 40: parent 1:40 limit 128p quantum 1514b perturb 10sec
 Sent 92835 bytes 76 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 44p requeues 0

### eth0: traffic classes

class htb 1:10 parent 1:2 leaf 10: prio 3 rate 6000bit ceil 122000bit burst 2Kb cburst 1614b
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 lended: 0 borrowed: 0 giants: 0
 tokens: 2879999 ctokens: 111692

class htb 1:2 root rate 122000bit ceil 122000bit burst 2Kb cburst 1614b
 Sent 37628 bytes 33 pkt (dropped 0, overlimits 0 requeues 0)
 rate 8008bit 0pps backlog 0b 0p requeues 0
 lended: 25 borrowed: 0 giants: 0
 tokens: -178250 ctokens: -208197

class htb 1:20 parent 1:2 leaf 20: prio 5 rate 55000bit ceil 115000bit burst 2Kb cburst 1613b
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 lended: 0 borrowed: 0 giants: 0
 tokens: 314180 ctokens: 118418

class htb 1:30 parent 1:2 leaf 30: prio 4 rate 31000bit ceil 122000bit burst 2Kb cburst 1614b
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 lended: 0 borrowed: 0 giants: 0
 tokens: 557419 ctokens: 111692

class htb 1:40 parent 1:2 leaf 40: prio 6 rate 30000bit ceil 122000bit burst 2Kb cburst 1614b
 Sent 94349 bytes 77 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 44p requeues 0
 lended: 8 borrowed: 25 giants: 0
 tokens: -137589 ctokens: -208197


### eth0: filtering rules

filter parent 1: protocol ip pref 100 u32
filter parent 1: protocol ip pref 100 u32 fh 800: ht divisor 1
filter parent 1: protocol ip pref 100 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10  (rule hit 82 success 0)
  match 00000016/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::801 order 2049 key ht 800 bkt 0 flowid 1:10  (rule hit 82 success 0)
  match 00000015/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::802 order 2050 key ht 800 bkt 0 flowid 1:10  (rule hit 82 success 0)
  match 00000017/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::803 order 2051 key ht 800 bkt 0 flowid 1:10  (rule hit 82 success 0)
  match 00001a0b/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::804 order 2052 key ht 800 bkt 0 flowid 1:10  (rule hit 82 success 0)
  match 00000035/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::805 order 2053 key ht 800 bkt 0 flowid 1:10  (rule hit 82 success 0)
  match 00000019/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::806 order 2054 key ht 800 bkt 0 flowid 1:10  (rule hit 80 success 0)
  match 0000006e/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::807 order 2055 key ht 800 bkt 0 flowid 1:10  (rule hit 79 success 0)
  match 0000008f/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::808 order 2056 key ht 800 bkt 0 flowid 1:20  (rule hit 77 success 0)
  match 00000014/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::809 order 2057 key ht 800 bkt 0 flowid 1:30  (rule hit 77 success 0)
  match 00000050/0000ffff at 20 (success 0 )
filter parent 1: protocol ip pref 100 u32 fh 800::80a order 2058 key ht 800 bkt 0 flowid 1:30  (rule hit 77 success 0)
  match 000001bb/0000ffff at 20 (success 0 )

### vmnet1: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 1104 bytes 12 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### vmnet8: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 1149047271 bytes 2371126 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### bnep0: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 5651 bytes 51 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

### ppp0: queueing disciplines

qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 16838245 bytes 44101 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

cyclon ★★★★★
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.