ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • pgBouncer와 pgPool-II 성능 측정
    PostgreSQL 2019. 10. 11. 14:02

    성능비교

    CPU 수에 따라 클라이언트 수를 증가시키면서 테스트를 한다.

    CPU 수 확인은 다음 명령어로 확인한다.

    --접속
    $ ssh agens@192.168.0.69
     
    --CPU 확인
    --물리 CPU 수 확인
    [agens@bitnine26 ~]$ grep "physical id" /proc/cpuinfo | sort -u | wc -l
    2
    --CPU당 물리 코어 수
    [agens@bitnine26 ~]$ grep "cpu cores" /proc/cpuinfo | tail -1
    cpu cores   : 10
    --전체 가상 코어 수
    [agens@bitnine26 ~]$ grep -c processor /proc/cpuinfo
    40
     
     
    --작업 공간
    [agens@bitnine26 pool-test]$ pwd
    /home/agens/pool-test

    물리 CPU 수: 2

    CPU당 물리 코어 수: 10

    전체 물리 코어 수: 20

    전체 가상 코어 수: 40

    위와 같은 결과에 따라 클라이언트 수는 2, 10, 20, 40, 80 순으로 성능을 측정한다.

     

    성능측정은 pgbench를 사용한다. 실행 결과는 다음과 같다.

    • pgbouncer가 성능이 제일 좋은 것으로 나타난다.
    • latency average는 평균 대기시간이다.
     

    클라이언트 2

    클라이언트 10

    클라이언트 20

    클라이언트 40

    클라이언트80

    pgbouncer

    starting vacuum...end.
    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 2
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 114293
    latency average = 1.050 ms
    tps = 1904.855722 (including connections establishing)
    tps = 2145.651361 (excluding connections establishing)

    starting vacuum...end.
    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 10
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 245260
    latency average = 2.446 ms
    tps = 4087.575689 (including connections establishing)
    tps = 4342.981160 (excluding connections establishing)

    starting vacuum...end.
    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 20
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 265460
    latency average = 4.521 ms
    tps = 4424.159926 (including connections establishing)
    tps = 4589.153763 (excluding connections establishing)

    starting vacuum...end.
    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 40
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 255840
    latency average = 9.382 ms
    tps = 4263.579705 (including connections establishing)
    tps = 4341.421430 (excluding connections establishing)

    starting vacuum...end.
    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 80
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 253618
    latency average = 18.930 ms
    tps = 4226.085357 (including connections establishing)
    tps = 4263.264761 (excluding connections establishing)

    pgpool-II

    starting vacuum...end.

    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 2
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 69931
    latency average = 1.716 ms
    tps = 1165.495993 (including connections establishing)
    tps = 1448.509083 (excluding connections establishing)

    starting vacuum...end.

    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 10
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 147685
    latency average = 4.063 ms
    tps = 2461.361129 (including connections establishing)
    tps = 2654.108830 (excluding connections establishing)

    starting vacuum...end.

    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 20
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 165247
    latency average = 7.262 ms
    tps = 2754.033327 (including connections establishing)
    tps = 2866.799172 (excluding connections establishing)

    starting vacuum...end.

    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 40
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 177730
    latency average = 13.504 ms
    tps = 2962.018262 (including connections establishing)
    tps = 3021.568624 (excluding connections establishing)

    starting vacuum...end.

    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 80
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 189997
    latency average = 25.266 ms
    tps = 3166.265834 (including connections establishing)
    tps = 3196.337278 (excluding connections establishing)

    postgres

    starting vacuum...end.

    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 2
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 22133
    latency average = 5.422 ms
    tps = 368.861546 (including connections establishing)
    tps = 545.835301 (excluding connections establishing)

    starting vacuum...end.

    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 10
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 29518
    latency average = 20.327 ms
    tps = 491.945784 (including connections establishing)
    tps = 541.877696 (excluding connections establishing)

    starting vacuum...end.

    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 20
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 29655
    latency average = 40.468 ms
    tps = 494.216472 (including connections establishing)
    tps = 518.814072 (excluding connections establishing)

    starting vacuum...end.

    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 40
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 29087
    latency average = 82.522 ms
    tps = 484.719700 (including connections establishing)
    tps = 496.548135 (excluding connections establishing)

    starting vacuum...end.

    transaction type: <builtin: TPC-B (sort of)>
    scaling factor: 10
    query mode: simple
    number of clients: 80
    number of threads: 1
    duration: 60 s
    number of transactions actually processed: 28827
    latency average = 166.546 ms
    tps = 480.348895 (including connections establishing)
    tps = 486.122614 (excluding connections establishing)

    'PostgreSQL' 카테고리의 다른 글

    pgpool-II session failover  (0) 2019.10.11
    pgbouncer session failover  (0) 2019.10.11
    pgBouncer 소스 수정량 확인  (0) 2019.10.11
    pgPool-II 설치  (0) 2019.10.11
    pgBouncer 설치  (0) 2019.10.11
Designed by Tistory.