리눅스 txqueuelen 변경

txqueuelen 설정
리눅스 txqueuelen 변경
송신 큐 길이(transmit queue length)

1 개요[ | ]

  • 송신 큐 길이의 기본값은 1000이다. 10000으로 바꾸어보자.
  • tx 큐가 가득 차면 패킷 손실이 일어날 수 있다. → 커야 한다.
  • tx 큐가 크면 메모리를 많이 필요로 한다. → 작아야 한다.[1]
  • ifconfig 명령어를 이용하여 즉시 변경할 수 있다.
  • 재부팅시에 초기화 된다.

2 방법 1: 하나씩 변경하기 (임시)[ | ]

변경 전
[root@zetawiki ~]# ifconfig eth9 | grep txqueuelen
          collisions:0 txqueuelen:1000
[root@zetawiki ~]# ifconfig eth11 | grep txqueuelen
          collisions:0 txqueuelen:1000
[root@zetawiki ~]# ifconfig bond1 | grep txqueuelen
          collisions:0 txqueuelen:0
변경
[root@zetawiki ~]# ifconfig eth9 txqueuelen 10000
[root@zetawiki ~]# ifconfig eth11 txqueuelen 10000
[root@zetawiki ~]# ifconfig bond1 txqueuelen 10000
변경 후
[root@zetawiki ~]# ifconfig eth9 | grep txqueuelen
          collisions:0 txqueuelen:10000
[root@zetawiki ~]# ifconfig eth11 | grep txqueuelen
          collisions:0 txqueuelen:10000
[root@zetawiki ~]# ifconfig bond1 | grep txqueuelen
          collisions:0 txqueuelen:10000

3 방법 2: 한방에 적용하기 (임시)[ | ]

명령어
ifconfig | grep ^eth | awk '{print $1}' | xargs -i{} ifconfig {} txqueuelen 원하는값
실행예시
[root@zetawiki ~]# ifconfig | grep txqueuelen
          collisions:0 txqueuelen:1000 
          collisions:0 txqueuelen:1000 
          collisions:0 txqueuelen:0
[root@zetawiki ~]# ifconfig | grep ^eth | awk '{print $1}' | xargs -i{} ifconfig {} txqueuelen 10000
[root@zetawiki ~]# ifconfig | grep txqueuelen
          collisions:0 txqueuelen:10000 
          collisions:0 txqueuelen:10000 
          collisions:0 txqueuelen:0
→ txqueuelen이 1000에서 10000으로 변경되었다.
→ 마지막 행의 txqueuelen이 0인 이유는 lo(루프백 어댑터)라서 그렇다.

4 방법 3: 영구적용[ | ]

  • 재부팅되면 초기화되므로, 영구적용하기 위해서는 /etc/rc.local에 아래 내용과 같이 추가하는 방법으로 설정해둔다.
/sbin/ifconfig eth0 txqueuelen 10000
/sbin/ifconfig eth1 txqueuelen 10000

5 같이 보기[ | ]

6 주석[ | ]

  1. 트레이드오프. → 패킷 손실 현상이 있고 메모리에 여유가 있다면 txqueuelen 값을 좀더 높게 해보자.

7 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}