Jump to content
Калькуляторы

производительность mpd+freebsd9.1

Всем привет,проблем следующая, есть два сервера доступа, почти идентичные на зеонах 56XX

в общем в час НН проседают скорости, + пинги через них вырастают

один с ем карточками

$ top -aSCHIP
last pid: 90712;  load averages:  4.01,  4.63,  4.83                                      up 132+11:48:30 21:45:25
157 processes: 14 running, 118 sleeping, 25 waiting
CPU 0:  2.0% user,  0.0% nice, 24.4% system,  1.5% interrupt, 72.2% idle
CPU 1:  1.0% user,  0.0% nice, 38.5% system,  0.0% interrupt, 60.5% idle
CPU 2:  2.0% user,  0.0% nice, 48.8% system,  0.0% interrupt, 49.3% idle
CPU 3:  4.4% user,  0.0% nice, 43.9% system,  0.5% interrupt, 51.2% idle
CPU 4:  4.9% user,  0.0% nice, 44.9% system,  0.0% interrupt, 50.2% idle
CPU 5:  2.4% user,  0.0% nice, 62.0% system,  0.0% interrupt, 35.6% idle
CPU 6:  2.0% user,  0.0% nice, 36.1% system,  0.5% interrupt, 61.5% idle
CPU 7:  1.5% user,  0.0% nice, 53.7% system,  0.0% interrupt, 44.9% idle
Mem: 146M Active, 1393M Inact, 1672M Wired, 2465M Buf, 20G Free
Swap: 24G Total, 24G Free

 PID USERNAME   PRI NICE   SIZE    RES STATE   C   TIME    CPU COMMAND
  13 root       -16    -     0K   128K CPU3    3 339.9H 98.78% [ng_queue{ng_queue7}]
  12 root       -60    -     0K   400K WAIT    0 138.3H 96.09% [intr{swi4: clock}]
   0 root       -92    0     0K   288K CPU4    5 1313.5 65.48% [kernel{em0 que}]
  11 root       155 ki31     0K   128K RUN     6 2643.6 58.89% [idle{idle: cpu6}]
  11 root       155 ki31     0K   128K RUN     4 2646.2 56.98% [idle{idle: cpu4}]
   0 root       -92    0     0K   288K CPU6    7 730.5H 51.66% [kernel{em2 que}]
  11 root       155 ki31     0K   128K RUN     3 2603.6 50.59% [idle{idle: cpu3}]
  11 root       155 ki31     0K   128K CPU1    1 2605.6 50.39% [idle{idle: cpu1}]
  11 root       155 ki31     0K   128K RUN     2 2604.8 48.78% [idle{idle: cpu2}]
  11 root       155 ki31     0K   128K CPU7    7 2366.9 48.78% [idle{idle: cpu7}]
  11 root       155 ki31     0K   128K RUN     5 1846.3 38.28% [idle{idle: cpu5}]
  13 root       -16    -     0K   128K sleep   7 336.3H 16.99% [ng_queue{ng_queue5}]
  13 root       -16    -     0K   128K CPU1    1 334.5H 15.19% [ng_queue{ng_queue1}]
  13 root       -16    -     0K   128K RUN     0 337.8H 15.09% [ng_queue{ng_queue2}]
  13 root       -16    -     0K   128K sleep   2 334.9H 14.79% [ng_queue{ng_queue0}]
  13 root       -16    -     0K   128K sleep   0 335.4H 14.60% [ng_queue{ng_queue3}]
  13 root       -16    -     0K   128K sleep   0 337.2H 14.26% [ng_queue{ng_queue4}]
  13 root       -16    -     0K   128K sleep   7 333.1H 13.48% [ng_queue{ng_queue6}]
24044 root        27    0   254M   101M select  6  28.2H 11.08% /usr/local/sbin/mpd5 -p /var/run/mpd5.pid -b{mpd5}
1603 root        25    0 31364K  6800K select  7 160.8H  6.69% /usr/local/sbin/zebra -d
  11 root       155 ki31     0K   128K CPU0    0 2631.1  6.59% [idle{idle: cpu0}]
98110 bind        20    0   231M   177M kqread  7  44:33  0.10% /usr/sbin/named -u bind -4 -t /var/named -u bind{n

 

другой с игб:

$ top -aSCHIP
last pid: 72412;  load averages:  3.95,  4.04,  4.16                                                                                        up 350+05:12:55 21:55:39
183 processes: 14 running, 126 sleeping, 43 waiting
CPU 0:  2.0% user,  0.0% nice, 31.7% system,  8.0% interrupt, 58.2% idle
CPU 1:  2.8% user,  0.0% nice, 34.5% system,  5.2% interrupt, 57.4% idle
CPU 2:  2.0% user,  0.0% nice, 26.1% system, 10.0% interrupt, 61.8% idle
CPU 3:  4.4% user,  0.0% nice, 31.3% system,  5.6% interrupt, 58.6% idle
CPU 4:  2.4% user,  0.0% nice, 30.9% system,  6.4% interrupt, 60.2% idle
CPU 5:  1.2% user,  0.0% nice, 33.3% system, 11.6% interrupt, 53.8% idle
CPU 6:  0.0% user,  0.0% nice, 38.6% system,  9.2% interrupt, 52.2% idle
CPU 7:  4.8% user,  0.0% nice, 33.3% system,  6.8% interrupt, 55.0% idle
Mem: 138M Active, 1466M Inact, 1666M Wired, 2465M Buf, 20G Free
Swap: 16G Total, 16G Free

 PID USERNAME   PRI NICE   SIZE    RES STATE   C   TIME    CPU COMMAND
  13 root       -16    -     0K   128K CPU6    6 736.8H 92.87% [ng_queue{ng_queue5}]
  11 root       155 ki31     0K   128K CPU2    2 6968.9 67.87% [idle{idle: cpu2}]
  11 root       155 ki31     0K   128K RUN     3 6959.2 62.99% [idle{idle: cpu3}]
  11 root       155 ki31     0K   128K RUN     1 6977.5 61.96% [idle{idle: cpu1}]
  11 root       155 ki31     0K   128K RUN     0 6994.7 60.89% [idle{idle: cpu0}]
  11 root       155 ki31     0K   128K RUN     4 6932.5 60.60% [idle{idle: cpu4}]
  11 root       155 ki31     0K   128K RUN     7 6918.4 60.16% [idle{idle: cpu7}]
  11 root       155 ki31     0K   128K RUN     6 6310.7 58.15% [idle{idle: cpu6}]
  11 root       155 ki31     0K   128K RUN     5 6342.0 54.69% [idle{idle: cpu5}]
   0 root       -92    0     0K   480K CPU4    5 1454.0 29.88% [kernel{em0 que}]
   0 root       -92    0     0K   480K -       6 1456.4 28.96% [kernel{em1 que}]
  13 root       -16    -     0K   128K CPU2    2 728.1H 13.28% [ng_queue{ng_queue4}]
  13 root       -16    -     0K   128K sleep   3 735.5H 13.09% [ng_queue{ng_queue2}]
  13 root       -16    -     0K   128K CPU0    0 722.9H 13.09% [ng_queue{ng_queue6}]
  13 root       -16    -     0K   128K sleep   4 734.3H 12.99% [ng_queue{ng_queue7}]
  13 root       -16    -     0K   128K sleep   1 732.5H 12.99% [ng_queue{ng_queue1}]
  13 root       -16    -     0K   128K sleep   2 730.3H 12.89% [ng_queue{ng_queue3}]
  13 root       -16    -     0K   128K sleep   5 729.7H 12.50% [ng_queue{ng_queue0}]
1617 root        27    0   387M   251M select  0 809.2H 11.28% /usr/local/sbin/mpd5 -p /var/run/mpd5.pid -b{mpd5}
17998 root        24    0 31420K  7756K select  0 347.5H  6.49% /usr/local/sbin/zebra -d
  12 root       -92    -     0K   704K WAIT    6 154.7H  5.27% [intr{irq275: igb1:que}]
  12 root       -92    -     0K   704K WAIT    3 133.7H  4.88% [intr{irq263: igb0:que}]
  12 root       -92    -     0K   704K WAIT    1 152.6H  4.69% [intr{irq270: igb1:que}]
  12 root       -92    -     0K   704K WAIT    2 152.8H  4.59% [intr{irq271: igb1:que}]
  12 root       -92    -     0K   704K WAIT    2 138.1H  4.49% [intr{irq262: igb0:que}]
  12 root       -92    -     0K   704K WAIT    5 131.5H  4.49% [intr{irq265: igb0:que}]
  12 root       -92    -     0K   704K WAIT    4 145.3H  3.66% [intr{irq264: igb0:que}]
  12 root       -92    -     0K   704K WAIT    0 121.6H  3.37% [intr{irq269: igb1:que}]
  12 root       -92    -     0K   704K WAIT    6 137.7H  3.27% [intr{irq266: igb0:que}]
  12 root       -92    -     0K   704K WAIT    5 121.1H  3.17% [intr{irq274: igb1:que}]
  12 root       -92    -     0K   704K WAIT    7 145.2H  2.69% [intr{irq267: igb0:que}]

упирается ng_queue, есть варианты улучшить ситуацию?

спасибо

Share this post


Link to post
Share on other sites

Покажите на обоих

netstat -m
netstat -s -p ip
cat /boot/loader.conf
cat /etc/sysctl.conf

Share this post


Link to post
Share on other sites

Покажите на обоих

netstat -m
netstat -s -p ip
cat /boot/loader.conf
cat /etc/sysctl.conf

 

с ем вчерашнее:

$ netstat -m
7705/25970/33675 mbufs in use (current/cache/total)
7501/18741/26242/262144 mbuf clusters in use (current/cache/total/max)
7501/18355 mbuf+clusters out of packet secondary zone in use (current/cache)
0/231/231/131072 4k (page size) jumbo clusters in use (current/cache/total/max)
0/0/0/65536 9k jumbo clusters in use (current/cache/total/max)
0/0/0/32768 16k jumbo clusters in use (current/cache/total/max)
17020K/44898K/61919K bytes allocated to network (current/cache/total)
0/0/0 requests for mbufs denied (mbufs/clusters/mbuf+clusters)
0/0/0 requests for jumbo clusters denied (4k/9k/16k)
0/0/0 sfbufs in use (current/peak/max)
0 requests for sfbufs denied
0 requests for sfbufs delayed
0 requests for I/O initiated by sendfile
0 calls to protocol drain routines

 

/boot/loader.conf уже поменял, сервер перегрузил

kern.ipc.nmbclusters=262144
kern.ipc.maxsockets=262144
net.graph.maxalloc=4096
kern.maxusers=2048
# maximize if ngctl not enough space) (amd64)
kern.ipc.maxpipekva=536870912

kern.maxfiles=204800
kern.maxfilesperproc=200000
kern.ipc.maxsockbuf=524288

#NetGraph
net.graph.maxdata=65536
net.graph.maxalloc=65536

#intel driver
hw.em.rxd=4096
hw.em.txd=4096
hw.em.rx_int_delay=600
hw.em.tx_int_delay=600
hw.em.rx_abs_int_delay=1000
hw.em.tx_abs_int_delay=1000

 

root@nas25:/root # cat /etc/sysctl.conf
# $FreeBSD: release/9.1.0/etc/sysctl.conf 112200 2003-03-13 18:43:50Z mux $
#
#  This file is read when going to multi-user and its contents piped thru
#  ``sysctl'' to adjust kernel values.  ``man 5 sysctl.conf'' for details.
#

# Uncomment this to prevent users from seeing information about processes that
# are being run under another UID.
#security.bsd.see_other_uids=0

net.graph.maxdgram=128000
net.graph.recvspace=128000

#net.inet.ip.redirect=0
#net.inet.icmp.drop_redirect=1

net.inet.ip.forwarding=1
net.inet.ip.fastforwarding=1
net.inet.tcp.blackhole=2
net.inet.udp.blackhole=0
net.inet.icmp.drop_redirect=1
net.inet.icmp.log_redirect=0
net.inet.ip.redirect=0
net.inet.ip.sourceroute=0
net.inet.ip.accept_sourceroute=0
net.inet.icmp.bmcastecho=0
net.inet.icmp.maskrepl=0
net.link.ether.inet.max_age=30
net.inet.ip.ttl=226
net.inet.tcp.drop_synfin=1
net.inet.tcp.syncookies=1
kern.ipc.somaxconn=32768
kern.maxfiles=204800
kern.maxfilesperproc=200000
kern.ipc.nmbclusters=524288
kern.ipc.maxsockbuf=2097152
kern.random.sys.harvest.ethernet=0
kern.random.sys.harvest.interrupt=0
net.inet.ip.dummynet.io_fast=1
net.inet.ip.dummynet.max_chain_len=2048
net.inet.ip.dummynet.hash_size=65535
net.inet.ip.dummynet.pipe_slot_limit=2048
net.inet.carp.preempt=1
net.inet.carp.log=2
kern.ipc.shmmax=67108864
net.inet.ip.intr_queue_maxlen=8192
net.inet.ip.fw.one_pass=0

dev.em.0.enable_lro=0
dev.em.2.enable_lro=0
dev.em.0.enable_aim=0
dev.em.2.enable_aim=0
dev.em.0.rx_processing_limit=2048
dev.em.0.flow_control=0
dev.em.2.rx_processing_limit=2048
dev.em.2.flow_control=0

dev.em.1.enable_lro=0
dev.em.3.enable_lro=0
dev.em.1.enable_aim=0
dev.em.3.enable_aim=0
dev.em.1.rx_processing_limit=2048
dev.em.1.flow_control=0
dev.em.3.rx_processing_limit=2048
dev.em.3.flow_control=0

 

netstat -s -p ip

вечером посмотрю на нем

 

сервер с igb:

$ netstat -m
24095/18025/42120 mbufs in use (current/cache/total)
24038/12700/36738/262144 mbuf clusters in use (current/cache/total/max)
24038/12570 mbuf+clusters out of packet secondary zone in use (current/cache)
0/247/247/131072 4k (page size) jumbo clusters in use (current/cache/total/max)
0/0/0/65536 9k jumbo clusters in use (current/cache/total/max)
0/0/0/32768 16k jumbo clusters in use (current/cache/total/max)
54194K/30894K/85088K bytes allocated to network (current/cache/total)
0/0/0 requests for mbufs denied (mbufs/clusters/mbuf+clusters)
0/0/0 requests for jumbo clusters denied (4k/9k/16k)
0/0/0 sfbufs in use (current/peak/max)
0 requests for sfbufs denied
0 requests for sfbufs delayed
0 requests for I/O initiated by sendfile
0 calls to protocol drain routines

не перегружал, настройки не менялись

root@nas26:/root # cat /boot/loader.conf
kern.ipc.nmbclusters=262144
kern.ipc.maxsockets=262144
net.graph.maxalloc=4096
kern.maxusers=2048
# maximize if ngctl not enough space) (amd64)
kern.ipc.maxpipekva=536870912

kern.maxfiles=204800
kern.maxfilesperproc=200000
kern.ipc.maxsockbuf=524288

#NetGraph
net.graph.maxdata=65536
net.graph.maxalloc=65536

 

# $FreeBSD: release/9.1.0/etc/sysctl.conf 112200 2003-03-13 18:43:50Z mux $
#
#  This file is read when going to multi-user and its contents piped thru
#  ``sysctl'' to adjust kernel values.  ``man 5 sysctl.conf'' for details.
#

# Uncomment this to prevent users from seeing information about processes that
# are being run under another UID.
#security.bsd.see_other_uids=0

net.graph.maxdgram=128000
net.graph.recvspace=128000

net.inet.ip.redirect=0
#net.inet6.ip6.redirect=0
net.inet.icmp.drop_redirect=1

 

root@nas26:/root # netstat -s -p ip
ip:
       2986705152143 total packets received
       49499 bad header checksums
       62008 with size smaller than minimum
       196617 with data size < data length
       0 with ip length > max ip packet size
       0 with header length < data size
       0 with data length < header length
       75 with bad options
       0 with incorrect version number
       2742541553 fragments received
       64707 fragments dropped (dup or out of space)
       4734243 fragments dropped after timeout
       1368899472 packets reassembled ok
       1012258485473 packets for this host
       284424434 packets for unknown/unsupported protocol
       1971760924836 packets forwarded (0 packets fast forwarded)
       54287496 packets not forwardable
       3 packets received for unknown multicast group
       0 redirects sent
       1041943874790 packets sent from this host
       120695916 packets sent with fabricated ip header
       0 output packets dropped due to no bufs, etc.
       0 output packets discarded due to no route
       24767827591 output datagrams fragmented
       49535717747 fragments created
       61764946 datagrams that can't be fragmented
       0 tunneling packets that can't find gif
       471998 datagrams with bad address in header

Share this post


Link to post
Share on other sites

упирается ng_queue, есть варианты улучшить ситуацию?

спасибо

 

 

http://forum.nag.ru/forum/index.php?showtopic=82168&view=findpost&p=805512&hl=ng_queue&fromsearch=1

Такое пробовали ?

спасибо, посмотрю

PS нетфлоу сегодня утром кстати выключил из мпд, вечером посмотрю эффект

Edited by ichthyandr

Share this post


Link to post
Share on other sites

root@nas26:/root # netstat -s -p ip
ip:
       ...
       1971760924836 packets forwarded (0 packets fast forwarded)
       54287496 packets not forwardable
       ...

 

Включите пока net.inet.ip.fastforwarding

Share this post


Link to post
Share on other sites

root@nas26:/root # netstat -s -p ip
ip:
       ...
       1971760924836 packets forwarded (0 packets fast forwarded)
       54287496 packets not forwardable
       ...

 

Включите пока net.inet.ip.fastforwarding

спасибо, попробую

Share this post


Link to post
Share on other sites

отключение нетфлоу в мпд помогло, будем разбираться с производительностью дальше

Share this post


Link to post
Share on other sites

Если не ошибаюсь, у вас включен isr.

Попробуйте отдать прерывания самим картам. По одной очереди для начала на порт, очереди прибить по одной к ядру.

Если шейп через дамминет - его лучше к нулевому и без прерываний порта на 0-м.

Share this post


Link to post
Share on other sites

Если не ошибаюсь, у вас включен isr.

Попробуйте отдать прерывания самим картам. По одной очереди для начала на порт, очереди прибить по одной к ядру.

Если шейп через дамминет - его лучше к нулевому и без прерываний порта на 0-м.

Спасибо, попробую. Шейпим через ng_car

Share this post


Link to post
Share on other sites

Лучше вынести в думминет.

 

Нагрузка примерно 50% на одно ядро при 1.5Г входящего и 750М исходящего.

Шепы раздельные на вход и выход. через таблицы IPFW.

Share this post


Link to post
Share on other sites

Если не ошибаюсь, у вас включен isr.

Попробуйте отдать прерывания самим картам. По одной очереди для начала на порт, очереди прибить по одной к ядру.

Если шейп через дамминет - его лучше к нулевому и без прерываний порта на 0-м.

разбираюсь с нагрузкой дальше ...

 

пиковая нагрузка на ядро ~60-67% ( по ядрам разброс ~ 20% )

трафик до ~ 600мбит

 

# sysctl -a | grep -i net.isr
net.isr.numthreads: 1
net.isr.maxprot: 16
net.isr.defaultqlimit: 256
net.isr.maxqlimit: 10240
net.isr.bindthreads: 0
net.isr.maxthreads: 1
net.isr.direct: 0
net.isr.direct_force: 0
net.isr.dispatch: direct

 

для em карточек (чип 82571EB) приколачивал треды по ядрам

   0 100046 kernel           em0 que            6    8 sleep   -
   0 100047 kernel           em0 txq            0    8 sleep   -
   0 100048 kernel           em1 que            7    8 sleep   -
   0 100049 kernel           em1 txq            0    8 sleep   -
   0 100050 kernel           em2 que            4    8 sleep   -
   0 100051 kernel           em2 txq            0    8 sleep   -
   0 100052 kernel           em3 que            5    8 sleep   -
   0 100053 kernel           em3 txq            0    8 sleep   -

почему то tx не разносится, хотя скриптом выполняю команды

cpuset -l 6 -t 100046
cpuset -l 6 -t 100047
cpuset -l 7 -t 100048
cpuset -l 7 -t 100049
cpuset -l 4 -t 100050
cpuset -l 4 -t 100051
cpuset -l 5 -t 100052
cpuset -l 5 -t 100053

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this