WHEREIS

구글에서 HTTP/3 테스트 하는 방법을 찾아보다가

여러 사이트의 방법대로 하였으나 잘 되지 않았다 ㅜㅜ

 

그러다 우연히!! 발견하였는데

언제 생긴 사이트인지 모르겠으나, nginx 에서 자체적으로 테스트 방법을 제공하고 있었다.

상용X(테스트용도)

 

quic.nginx.org/readme.html

 

컴파일 방법은 위 사이트에도 있으나, 연동되는 다른 lib 설치가 필요하다.

* 모든 설치 파일은 /tmp 아래에 받아 놓고 진행 함

# 사전 설치(중간에 빌드 시 필요로 함)
yum install libunwind* openssl-devel


# 아래 nginx repo 에서 받아오기 위해 설치
yum install hg-git

# cmake 상위 버전 설치 (yum repo 에 3.3 이상 버전이 없을 경우)
wget https://github.com/Kitware/CMake/releases/download/v3.19.1/cmake-3.19.1.tar.gz
tar -xzvf cmake-3.19.1.tar.gz
cd cmake-3.19.1
./configure --prefix=/app/cmake
make
make install

# 아래 boringssl 설치 시 필요함
wget https://golang.org/dl/go1.15.5.linux-amd64.tar.gz
tar -xzvf  go1.15.5.linux-amd64.tar.gz
export PATH=$PATH:/tmp/go/bin


# boringssl (cmake 상위 버전을 필요로 함)
git clone https://boringssl.googlesource.com/boringssl
cd boringssl
mkdir build
cd build
/app/cmake/bin/cmake ..
make



# nginx 설치
hg clone -b quic https://hg.nginx.org/nginx-quic --insecure
cd nginx-quic
./auto/configure --prefix=/app/nginx-quic --with-debug --with-http_v3_module       \
                       --with-cc-opt="-I../boringssl/include"   \
                       --with-ld-opt="-L../boringssl/build/ssl  \
                                      -L../boringssl/build/crypto"

make && make install


# nginx 설정
vi /app/nginx-quic/conf/nginx.conf

http {
...
include /app/nginx-quic/conf.d/*.conf;

log_format quic '$remote_addr - $remote_user [$time_local] '
                '"$request" $status $body_bytes_sent '
                '"$http_referer" "$http_user_agent" "$quic" "$http3"';

access_log logs/access.log quic;

...
}

mkdir /app/nginx-quic/conf.d
vi ssl.conf

server {
        # for better compatibility it's recommended
        # to use the same port for quic and https
        listen 443 http3 reuseport;
        listen 443 ssl;

        ssl_certificate     /app/nginx-quic/ssl/인증서.crt;
        ssl_certificate_key /app/nginx-quic/ssl/인증서.key;
        ssl_protocols       TLSv1.3;

        location / {
            # required for browsers to direct them into quic port
            add_header Alt-Svc '$http3=":443"; ma=86400';
       }
}



# 클라이언트에서 접속하기 위한 방법(현재 브라우저에서 기본으로 지원하지 않다 보니 설정이 필요)
C:\Program Files (x86)\Google\Chrome\Application>chrome.exe --enable-quic --quic
-version=h3-29 --origin-to-force-quic-on=<도메인>:443

 

설치가 다 끝나고 서버에서 열린 포트를 확인해 보면

udp 포트로 443 이 열린 것을 알 수 있다.

 

 

위의 클라이언트에서 chrome 을 개별로 열어서

접속을 해보면!

 

프로토콜에 h3-29 라고 뜨는 것이 확인된다.

 

기존 이미지가 cache 를 읽어서 다시 수정 함.

 

 

테스트로 대충 이미지 10000개 정도를 불러 올 때

HTTP3 의 경우 25 초 , HTTP1.1 경우 38초가 소요되었다. (동일 브라우저, 동일 클라이언트)

단순히 1명의 사용자 기준으로 봤을 때 이고, 여러 명이 접속한다고 하면 

성능 차이가 더 발생할 것으로 보인다.

 

반면 문제점은 최근에 다시 설치하여 조금 더 큰 이미지 size 파일을 올렸더니 불안정한 모습을 보였다.

 

다음과 같이 일부 이미지는 통신에러로 불러오지 못했으며, TCP 통신(HTTP/1.1 의 경우)의 경우는 느리더라도

모든 이미지를 완벽하게 불러왔다. (udp의 한계?)

 

 

 

# HTTP/1.1 호출 시 (tcpdump)

[root@xcentos7-xen-20190905 /app/nginx-quic/logs]#(reverse-i-search)`tcpdu': tcpdump src 192.168.230.222
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
13:05:43.735194 IP wtest-ap02.49668 > xcentos7-xen-20190905.ies-lm: Flags [S], seq 3663230572, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
13:05:43.735325 IP wtest-ap02.49669 > xcentos7-xen-20190905.ies-lm: Flags [S], seq 3637083836, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
13:05:43.735549 IP wtest-ap02.49668 > xcentos7-xen-20190905.ies-lm: Flags [.], ack 3930460429, win 256, length 0
13:05:43.735591 IP wtest-ap02.49669 > xcentos7-xen-20190905.ies-lm: Flags [.], ack 1122634403, win 256, length 0
13:05:43.736149 IP wtest-ap02.49668 > xcentos7-xen-20190905.ies-lm: Flags [P.], seq 0:517, ack 1, win 256, length 517
13:05:43.736309 IP wtest-ap02.49669 > xcentos7-xen-20190905.ies-lm: Flags [P.], seq 0:517, ack 1, win 256, length 517
13:05:43.738291 IP wtest-ap02.49668 > xcentos7-xen-20190905.ies-lm: Flags [.], ack 4240, win 256, length 0
13:05:43.738426 IP wtest-ap02.49669 > xcentos7-xen-20190905.ies-lm: Flags [.], ack 4240, win 256, length 0
13:05:43.739377 IP wtest-ap02.49668 > xcentos7-xen-20190905.ies-lm: Flags [P.], seq 517:581, ack 4240, win 256, length 64
13:05:43.740473 IP wtest-ap02.49669 > xcentos7-xen-20190905.ies-lm: Flags [P.], seq 517:581, ack 4240, win 256, length 64
13:05:43.740741 IP wtest-ap02.49668 > xcentos7-xen-20190905.ies-lm: Flags [P.], seq 581:1543, ack 4240, win 256, length 962
13:05:43.741228 IP wtest-ap02.49668 > xcentos7-xen-20190905.ies-lm: Flags [.], ack 6573, win 256, length 0
13:05:43.788546 IP wtest-ap02.49668 > xcentos7-xen-20190905.ies-lm: Flags [P.], seq 1543:2443, ack 6573, win 256, length 900
13:05:43.984128 IP wtest-ap02.49668 > xcentos7-xen-20190905.ies-lm: Flags [.], ack 7305, win 253, length 0
13:05:45.863597 IP wtest-ap02.49669 > xcentos7-xen-20190905.ies-lm: Flags [F.], seq 581, ack 4240, win 256, length 0
13:05:45.863677 IP wtest-ap02.49668 > xcentos7-xen-20190905.ies-lm: Flags [F.], seq 2443, ack 7305, win 253, length 0
13:05:45.864007 IP wtest-ap02.49669 > xcentos7-xen-20190905.ies-lm: Flags [.], ack 4241, win 256, length 0
13:05:45.864040 IP wtest-ap02.49668 > xcentos7-xen-20190905.ies-lm: Flags [.], ack 7306, win 253, length 0


# HTTP/3 호출 시 (tcpdump)
[root@xcentos7-xen-20190905 /app/nginx-quic/logs]# tcpdump src 192.168.230.222
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
13:07:04.210574 IP wtest-ap02.62637 > xcentos7-xen-20190905.https: UDP, length 224
13:07:04.211607 IP wtest-ap02.62637 > xcentos7-xen-20190905.https: UDP, length 45
13:07:04.237034 IP wtest-ap02.62637 > xcentos7-xen-20190905.https: UDP, length 45
13:07:04.245296 IP wtest-ap02.62637 > xcentos7-xen-20190905.https: UDP, length 59
13:07:04.271018 IP wtest-ap02.62637 > xcentos7-xen-20190905.https: UDP, length 45

 

향후에 HTTP3 가 상용화 되어도 트랜잭션이 오래 걸리는 것은 효과가 없을 것 같긴 하지만

static 한 파일의 경우 확실히 처리가 빠를 것이라 생각한다 ! (안정성만 확보 된다면..)

 

 

 

 

참고사이트 :

quic.nginx.org/readme.html

boringssl.googlesource.com/boringssl/

cmake.org/download/

golang.org/doc/install

 

이 글을 공유합시다

facebook twitter kakaoTalk kakaostory naver band
loading