Я на выделенном сервере (proxmox-ve-2.6.32: 3.4-165 (работающее ядро: 2.6.32-42-pve)) с правилом 95-го процентиля и хочу убедиться, что он не нарушен. У меня есть ссылка на 1 Гбит, и мой контракт предлагает мне 95-й процентиль на 100 Мбит. Поэтому я бы хотел ограничить свою полосу пропускания до 100 мбит.

Я попытался использовать Wondershaper без какого-либо успеха и мне нужна помощь:

#ifconfig
eth0      Link encap:Ethernet  HWaddr xxx
      inet6 addr: xxx/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:273688 errors:0 dropped:0 overruns:0 frame:0
      TX packets:33946 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:409128994 (390.1 MiB)  TX bytes:4016030 (3.8 MiB)
      Interrupt:20 Memory:f7f00000-f7f20000

lo        Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:313 errors:0 dropped:0 overruns:0 frame:0
      TX packets:313 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:49781 (48.6 KiB)  TX bytes:49781 (48.6 KiB)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
      inet6 addr: fe80::1/128 Scope:Link
      UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
      RX packets:351 errors:0 dropped:0 overruns:0 frame:0
      TX packets:338 errors:0 dropped:5 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:180727 (176.4 KiB)  TX bytes:109667 (107.0 KiB)

vmbr0     Link encap:Ethernet  HWaddr xxx
      inet addr:xxx  Bcast:xxx  Mask:255.255.255.248
      inet6 addr: xxx/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:35361 errors:0 dropped:0 overruns:0 frame:0
      TX packets:33722 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:392904370 (374.7 MiB)  TX bytes:4002892 (3.8 MiB)

Без чудес:

wget -O /dev/null http://speedtest.dal01.softlayer.com/downloads/test100.zip
--2015-10-15 10:12:35--  http://speedtest.dal01.softlayer.com/downloads/test100.zip
Resolving speedtest.dal01.softlayer.com (speedtest.dal01.softlayer.com)... 74.86.116.210, 2607:f0d0:1003:31::2
Connecting to speedtest.dal01.softlayer.com (speedtest.dal01.softlayer.com)|74.86.116.210|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104874307 (100M) [application/zip]
Saving to: `/dev/null'

39% [============================================================================>                                                                                                                       ] 41,468,482  27.3M/s              ^C

Я настраиваю Wondershaper:

# wondershaper vmbr0 1000000 1000000

Результат...:

wget -O /dev/null http://speedtest.dal01.softlayer.com/downloads/test100.zip
--2015-10-15 10:12:56--  http://speedtest.dal01.softlayer.com/downloads/test100.zip
Resolving speedtest.dal01.softlayer.com (speedtest.dal01.softlayer.com)... 74.86.116.210, 2607:f0d0:1003:31::2
Connecting to speedtest.dal01.softlayer.com (speedtest.dal01.softlayer.com)|74.86.116.210|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104874307 (100M) [application/zip]
Saving to: `/dev/null'

 0% [                                                                                                                                                                                                    ] 61,970      18.4K/s  eta 87m 39s ^C

(Между 6 кОм / с и 18 кОм / с ...)

Конфиг на Wondershaper после этого теста:

#wondershaper vmbr0
qdisc cbq 1: root refcnt 2 rate 10000Kbit (bounded,isolated) prio no-transmit
 Sent 546883 bytes 776 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
  borrowed 0 overactions 0 avgidle 12500 undertime 0
qdisc sfq 10: parent 1:10 limit 127p quantum 1514b divisor 1024 perturb 10sec
 Sent 15781 bytes 123 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 20: parent 1:20 limit 127p quantum 1514b divisor 1024 perturb 10sec
 Sent 530850 bytes 647 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 30: parent 1:30 limit 127p quantum 1514b divisor 1024 perturb 10sec
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
qdisc ingress ffff: parent ffff:fff1 ----------------
 Sent 695844 bytes 1291 pkt (dropped 20, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
class cbq 1: root rate 10000Kbit (bounded,isolated) prio no-transmit
 Sent 252 bytes 6 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
  borrowed 0 overactions 0 avgidle 12500 undertime 0
class cbq 1:1 parent 1: rate 1000Mbit (bounded,isolated) prio 5
 Sent 547619 bytes 772 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
  borrowed 0 overactions 0 avgidle 12500 undertime 0
class cbq 1:10 parent 1:1 leaf 10: rate 1000Mbit prio 1
 Sent 16769 bytes 125 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
  borrowed 0 overactions 0 avgidle 12500 undertime 0
class cbq 1:20 parent 1:1 leaf 20: rate 900000Kbit prio 2
 Sent 530850 bytes 647 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
  borrowed 0 overactions 0 avgidle 12500 undertime 0
class cbq 1:30 parent 1:1 leaf 30: rate 800000Kbit prio 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
  borrowed 0 overactions 0 avgidle 12500 undertime 0

Есть идеи?

1 ответ1

0

Я не нашел способа исправить эту проблему с Wondershaper, но нашел другой способ сделать то же самое с помощью Ethtool:

ethtool -s eth0 speed 100 duplex full

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .