| 네트워크 성능 벤치 및 모니터링 툴 - 윈디하나의 솔라나라
 | 
windy@wl ~/src $ wget https://jaist.dl.sourceforge.net/project/iperf2/iperf-2.2.0.tar.gz
windy@wl ~/src $ tar xvfz iperf-2.2.0.tar.gz
windy@wl ~/src $ cd iperf-2.2.0
windy@wl ~/src/iperf-2.2.0 $ ./configure
windy@wl ~/src/iperf-2.2.0 $ vi src/Server.cpp
# 700 번째 라인 "(double)" 을 붙임
            diff_tolerance = ceil((double)mSettings->mInterval / 1000000);
windy@wl ~/src/iperf-2.2.0 $ make
windy@wl ~/src/iperf-2.2.0 $ sudo make install
1) Makefile.in에서, AM_CXXFLAGS와 AM_FLAGS의 -Wall을 -lrt로 변경한다. 솔라리스는 nanosleep(3RT)이 librt(3LIB)에 있다. -Wall은 GCC용 옵션이기 때문에 CC에서 컴파일시 삭제해야 한다.
iperf -s [-u] [-i n] [-p 포트번호] [-w n[KM]] [-D]
iperf -c 서버IP [-u] [-i] [-p 포트번호] [-w n[KM]] [-b n[KM]] [-t n] [-n n[KM]]
-u UDP를 사용. -b 옵션을 반드시 사용해야 한다. -i 출력 간격(초). -p 바인드할 포트 번호. 기본값은 [-p 5001]서버/클라이언트 옵션
-D 데몬으로 실행. -d 양방향 테스트 -b 대역폭. 기본값은 [-b 1M] -n 보낼 전송 회수. -t 대신 사용 -t 보낼 시간(초). 기본값은 [-t 10] -w 윈도 크기(버퍼크기).자세한 사항은
iperf -h 나 iperf(1)을 참조하자.
	windy@wl2 ~ $ iperf -s ------------------------------------------------------------ Server listening on TCP port 5001 TCP window size: 48.0 KByte (default) ------------------------------------------------------------ [ 4] local x.x.x.x port 5001 connected with x.x.x.x port 33019 [ ID] Interval Transfer Bandwidth [ 4] 0.0-10.0 sec 60.9 MBytes 50.9 Mbits/sec Ctrl+C클라이언트
windy@wl ~ $ iperf -c wl2 ------------------------------------------------------------ Client connecting to wl2, TCP port 5001 TCP window size: 48.0 KByte (default) ------------------------------------------------------------ [ 3] local x.x.x.x port 33019 connected with x.x.x.x port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.0 sec 60.9 MBytes 50.9 Mbits/sec
windy@wl2 ~ $ iperf -s -u ------------------------------------------------------------ Server listening on UDP port 5001 Receiving 1470 byte datagrams UDP buffer size: 56.0 KByte (default) ------------------------------------------------------------ [ 3] local x.x.x.x port 5001 connected with x.x.x.x port 2055 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [ 3] 0.0-10.0 sec 11.9 MBytes 10.0 Mbits/sec 0.264 ms 0/ 8505 (0%) Ctrl+C클라이언트
windy@wl ~ $ iperf -c wl2 -u -b 10M ------------------------------------------------------------ Client connecting to wl2, UDP port 5001 Sending 1470 byte datagrams UDP buffer size: 8.00 KByte (default) ------------------------------------------------------------ [1912] local x.x.x.x port 2055 connected with x.x.x.x port 5001 [ ID] Interval Transfer Bandwidth [1912] 0.0-10.0 sec 11.9 MBytes 9.99 Mbits/sec [1912] Server Report: [1912] 0.0-10.0 sec 11.9 MBytes 10.0 Mbits/sec 0.263 ms 0/ 8505 (0%) [1912] Sent 8505 datagramsIPerf 를 UDP 로 실행시키면, Jitter 와 Datagram Loss 를 측정한다. 이를 통해 회선 품질을 알 수 있다.
 
아래와 같이 소스를 받아 설치할 수 있다.
windy@wl ~/src $ wget https://github.com/esnet/iperf/releases/download/3.17.1/iperf-3.17.1.tar.gz windy@wl ~/src $ tar xvfz iperf-3.17.1.tar.gz windy@wl ~/src $ cd iperf-3.17.1 windy@wl ~/src/iperf-3.17.1 $ CC=gcc ./configure --with-openssl=/usr/local/ssl CFLAGS="-m64 -lsendfile" LDFLAGS="-m64" windy@wl ~/src/iperf-3.17.1 $ make windy@wl ~/src/iperf-3.17.1 $ sudo make install
iperf3 -s [ options ]
iperf3 -c 서버IP [ options ]
     -p, --port n
          열거나 접속할 포트 번호 (기본값: 5201)
     -f, --format
          [kmgtKMGT] format to report: Kbits, Mbits, Gbits, Tbits
     -i, --interval n
          출력 간격 (초). 기본값은 1, 0인경우 비활성화
     -F, --file name
          클라이언트: 임의의 데이터 대신 파일에서 읽어와 전송
          서버: 네트워크에서 받은 데이터를 지정한 파일로 저장
     -B, --bind host
          지정한 인터페이스에 바인드
     -V, --verbose
          상세히 출력
     -J, --json
          JSON 형식으로 출력
     --logfile file
          출력을 로그 파일로 전송
     --forceflush
          force flushing output at every interval
     -d, --debug
          디버그 정보 출력
     -v, --version
          버전 정보 보임
     -h, --help
          도움말
	
     -s, --server
          서버로 실행
     -D, --daemon
          서버 데몬으로 실행
     -I, --pidfile file
          PID 파일 지정
     -1, --one-off
          한번의 클라이언트 접속만 허용한 후 종료
     --rsa-private-key-path    path to the RSA private key used to decrypt
                            authentication credentials
      --authorized-users-path   path to the configuration file containing user
                            credentials
	
     -c, --client host
          run in client mode, connecting to the specified server
     --sctp
          use SCTP rather than TCP (FreeBSD and Linux)
     -X, --xbind NAME        bind SCTP association to links
     --nstreams  no          number of SCTP streams
     -u, --udp
          use UDP rather than TCP
     --connect-timeout #       timeout for control connection setup (ms)
     -b, --bitrate #[KMG][/#]  target bitrate in bits/sec (0 for unlimited)
                            (default 1 Mbit/sec for UDP, unlimited for TCP)
                            (optional slash and packet count for burst mode)
     --pacing-timer #[KMG]     set the timing for pacing, in microseconds (default 1000)
     -t, --time n
          time in seconds to transmit for (default 10 secs)
     -n, --bytes n[KM]
          number of bytes to transmit (instead of -t)
     -k, --blockcount n[KM]
          number of blocks (packets) to transmit (instead  of  -t
          or -n)
     -l, --length n[KM]
          읽기/쓰기 버퍼 지정 (기본값: TCP인경우 128KB, UDP인경우 8KB)
     --cport port
          bind data streams to a specific client  port  (for  TCP
          and UDP only, default is to use an ephemeral port)
     -P, --parallel n
          number of parallel client streams to run
     -R, --reverse
          역 모드 (서버가 보내고 클라이언트가 받음)
     -w, --window n[KM]
          window size / socket buffer size (this gets sent to the
          server and used on that side too)
     -C, --congestion algo   set TCP congestion control algorithm (Linux and FreeBSD only)
     -M, --set-mss n
          TCP/SCTP 최대 세그먼트 크기 지정 (MTU - 40 bytes)
     -N, --no-delay
          TCP/SCTP 에 TCP_NODELAY 옵션 사용(Nagle 알고리즘 사용 하지 않음)
     -4, --version4
          IPv4 만 사용
     -6, --version6
          IPv6 만 사용
     -S, --tos n
          set the IP type of service
     --dscp N or --dscp val    set the IP dscp value, either 0-63 or symbolic.
                            Numeric values can be specified in decimal,
                            octal and hex (see --tos above).
     -Z, --zerocopy
          데이터 전송시 Zero Copy 방식을 사용. 예를 들어 write(2) 대신 sendfile(2)를 사용함
     -O, --omit n
          Omit the first n seconds of the test, to skip past  the
          TCP slow-start period.
     -T, --title str
          Prefix every output line with this string.
  --extra-data str          data string to include in client and server JSON
  --get-server-output       get results from server
  --udp-counters-64bit      use 64-bit counters in UDP test packets
  --repeating-payload       use repeating pattern in payload, instead of
                            randomized payload (like in iperf2)
  --username                username for authentication
  --rsa-public-key-path     path to the RSA public key used to encrypt
                            authentication credentials
	windy@wl ~ $ iperf3 -s ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- Accepted connection from ::1, port 51234 [ 5] local ::1 port 5201 connected to ::1 port 55954 [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-1.00 sec 136 KBytes 1.11 Mbits/sec 0.008 ms 0/17 (0%) [ 5] 1.00-2.00 sec 128 KBytes 1.05 Mbits/sec 0.016 ms 0/16 (0%) [ 5] 2.00-3.00 sec 128 KBytes 1.05 Mbits/sec 0.012 ms 0/16 (0%) [ 5] 3.00-4.00 sec 128 KBytes 1.05 Mbits/sec 0.012 ms 0/16 (0%) [ 5] 4.00-5.00 sec 128 KBytes 1.05 Mbits/sec 0.010 ms 0/16 (0%) [ 5] 5.00-6.00 sec 120 KBytes 982 Kbits/sec 0.016 ms 0/15 (0%) [ 5] 6.00-7.01 sec 128 KBytes 1.04 Mbits/sec 17.448 ms 0/16 (0%) [ 5] 7.01-8.00 sec 136 KBytes 1.12 Mbits/sec 5.830 ms 0/17 (0%) [ 5] 8.00-9.00 sec 128 KBytes 1.04 Mbits/sec 2.087 ms 0/16 (0%) [ 5] 9.00-10.00 sec 128 KBytes 1.05 Mbits/sec 0.751 ms 0/16 (0%) - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 5] 0.00-10.00 sec 1.26 MBytes 1.05 Mbits/sec 0.751 ms 0/161 (0%) receiver ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- Ctrl+Ciperf3: interrupt - the server has terminated클라이언트측 호스트에서 아래와 같이 실행한다.
windy@wl ~ $ iperf3 -c localhost -u -Z Connecting to host localhost, port 5201 [ 6] local ::1 port 55954 connected to ::1 port 5201 [ ID] Interval Transfer Bitrate Total Datagrams [ 6] 0.00-1.00 sec 136 KBytes 1.11 Mbits/sec 17 [ 6] 1.00-2.00 sec 128 KBytes 1.05 Mbits/sec 16 [ 6] 2.00-3.00 sec 128 KBytes 1.05 Mbits/sec 16 [ 6] 3.00-4.00 sec 128 KBytes 1.05 Mbits/sec 16 [ 6] 4.00-5.00 sec 128 KBytes 1.05 Mbits/sec 16 [ 6] 5.00-6.01 sec 120 KBytes 971 Kbits/sec 15 [ 6] 6.01-7.02 sec 128 KBytes 1.04 Mbits/sec 16 [ 6] 7.02-8.00 sec 136 KBytes 1.13 Mbits/sec 17 [ 6] 8.00-9.01 sec 128 KBytes 1.04 Mbits/sec 16 [ 6] 9.01-10.00 sec 128 KBytes 1.06 Mbits/sec 16 - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams [ 6] 0.00-10.00 sec 1.26 MBytes 1.05 Mbits/sec 0.000 ms 0/161 (0%) sender [ 6] 0.00-10.00 sec 1.26 MBytes 1.05 Mbits/sec 0.751 ms 0/161 (0%) receiver iperf Done.
windy@wl ~/src $ wget https://www.gropp.org/bwm-ng/bwm-ng-0.6.3.tar.gz windy@wl ~/src $ tar xvfz bwm-ng-0.6.3.tar.gz windy@wl ~/src $ cd bwm-ng-0.6.3 windy@wl ~/src/bwm-ng-0.6.3 $ ./autogen.sh windy@wl ~/src/bwm-ng-0.6.3 $ CC=gcc ./configure windy@wl ~/src/bwm-ng-0.6.3 $ make windy@wl ~/src/bwm-ng-0.6.3 $ sudo make install
windy@wl ~ $ bwm-ng
  bwm-ng v0.6.3 (probing every 0.500s), press 'h' for help
  input: kstat type: rate
  -         iface                   Rx                   Tx                Total
  ==============================================================================
             phys:           0.12 KB/s            0.39 KB/s            0.50 KB/s
             net0:           0.12 KB/s            0.39 KB/s            0.50 KB/s
  ------------------------------------------------------------------------------
            total:           0.23 KB/s            0.77 KB/s            1.01 KB/s
windy@wl ~ $ bwm-ng -i kstatdisk
  bwm-ng v0.6.3 (probing every 0.500s), press 'h' for help
  input: kstatdisk type: rate
  |         iface                   Rx                   Tx                Total
  ==============================================================================
            cmdk0:           0.00 KB/s            8.00 KB/s            8.00 KB/s
       uhci0,ctrl:           0.00 KB/s            0.00 KB/s            0.00 KB/s
       uhci0,intr:           0.00 KB/s            0.00 KB/s            0.00 KB/s
  ------------------------------------------------------------------------------
            total:           0.00 KB/s            8.00 KB/s            8.00 KB/s
h 키를 누르면 도움말이 표시된다.
lqbwm-ng v0.6.3 - Keybindings:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x x x 'h' show this help x x 'q' exit x x '+' increases timeout by 100ms x x '-' decreases timeout by 100ms x x 'd' switch KB and auto assign Byte/KB/MB/GB x x 'a' cycle: show all interfaces, only those which are up, x x only up and not hidden x x 's' sum hidden ifaces to total aswell or not x x 'n' cycle: input methods x x 'u' cycle: bytes,bits,packets,errors x x 't' cycle: current rate, max, sum since start, average for last 30s x x x mq press any key to continue... qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
windy@wl ~/src $ wget https://github.com/libstatgrab/libstatgrab/releases/download/LIBSTATGRAB_0_92_1/libstatgrab-0.92.1.tar.gz windy@wl ~/src $ tar xvfz libstatgrab-0.92.1.tar.gz windy@wl ~/src $ cd libstatgrab-0.92.1 windy@wl ~/src/libstatgrab-0.92.1 $ ./configure windy@wl ~/src/libstatgrab-0.92.1 $ make windy@wl ~/src/libstatgrab-0.92.1 $ sudo make install
saidar [-d delay] [-v] [-h]
-d: 업데이트 주기(초)-h: 도움말-v: 버전
windy@wl ~ $ saidar
Hostname  : wl             Uptime : 37d 06:45:55      Date : 2024-08-10 10:00:00
Load 1    :   0.38   CPU Idle  :  99.63%  Running   :     0   Zombie    :     1
Load 5    :   0.30   CPU System:   0.25%  Sleeping  :   100   Total     :   102
Load 15   :   0.24   CPU User  :   0.12%  Stopped   :     1   No. Users :     1
Mem Total :   7933M  Swap Total:   2048M  Mem Used  : 67.68%  Paging in :     0
Mem Used  :   5369M  Swap Used :    439M  Swap Used : 21.47%  Paging out:     0
Mem Free  :   2563M  Swap Free :   1608M  Total Used: 58.20%
Disk Name      Read         Write         Network Interface        rx        tx
c2d0s0           0B            0B         phys                   150B      815B
                                          net0                   150B      815B
Total            0B            0B
                                          Mount Point            Free      Used
                                          /                    55946M     26.77%
...
	KEY = VALUE 형태로 출력해주기 때문에 grep(1), awk(1) 등과 조합해 쉽게 데이터를 파싱할 수 있다.
windy@wl ~ $ statgrab windy@wl ~/src/libstatgrab-0.92.1 $ statgrab | more const.0 = 0 cpu.ctxsw = 3370989103 cpu.idle = 1250963819 cpu.intrs = 3664164504 ...
| RSS ATOM XHTML 5 CSS3 | Copyright © 2004-2025 Jo HoSeok. All rights reserved. |