EC2 & ELB Networking SockPerf TEST (Zone/Public/Private)


Edit

제반 사항

(Note)
- 부하(Load)나, 외부상황은 배제한, EC2 Instance간의 Network Latency 테스트.
- 횟수가 많아야 신뢰도가 있는 자료가 나오겠으나, 시간상 1회/10초 수행.
- "Percentile 99.99" 와 "Average" 그래프화. 




EC2-Latency.xlsx



  • Region: Tokyo
  • 인스턴스(VM): 3EA
  • 인스턴스 OS: Ubuntu Server 12.04.2 LTS (64bit)
  • 인스턴스 스펙: M1 Small (m1.small, 1.7 GiB)
  • 테스트 상세
    • 도구: sockperf_2.5.193 (https://code.google.com/p/sockperf/downloads/list)
    • 모드: ping-pong (run sockperf client for latency test in ping pong mode)
    • 방식: RTT (Round Trip Time)
    • 시간: 10sec
    • Size: 16KB (16384 Byte)
    • 단위: usec (마이크로초)
    • Command
      • Server: ./sockperf server -p 5001 {--tcp}
      • Client: ./sockperf ping-pong -i {Server-IP} -p 5001 -m 16384 -t 10 --pps=max {--tcp}
  • 예상 Case
    • 동일 Zone에 존재하는 VM to VM
      • 공인 DNS (TCP/UDP)
      • 사설 DNS (TCP/UDP)
      • ELB 경유 (TCP/UDP)
    • 다른 Zone에 존재하는 VM to VM
      • 공인 DNS (TCP/UDP)
      • 사설 DNS (TCP/UDP)
      • ELB 경유 (TCP/UDP)
Edit

VM 구성

Edit

구성도



Edit

설정 내역

  • VM-A
    • Zone: ap-northeast-1a
    • Privat DNS: 10.152.173.96 (ip-10-152-173-96.ap-northeast-1.compute.internal)
    • Public DNS: 54.249.200.29 (ec2-54-249-200-29.ap-northeast-1.compute.amazonaws.com)
  • VM-B
    • Zone: ap-northeast-1a
    • Privat DNS: 10.162.15.46 (ip-10-162-15-46.ap-northeast-1.compute.internal)
    • Public DNS: 54.250.97.46 (ec2-54-250-97-46.ap-northeast-1.compute.amazonaws.com)
  • VM-C
    • Zone: ap-northeast-1c
    • Privat DNS: 10.121.6.240 (ip-10-121-6-240.ap-northeast-1.compute.internal)
    • Public DNS: 54.250.69.124 (ec2-54-250-69-124.ap-northeast-1.compute.amazonaws.com)
  • ELB-B 정보
    • Zone: ap-northeast-1a
    • LB Protocol: TCP
    • LB Port: 5001
    • Instance Protocol: TCP
    • Instance Port: 5001
    • DNS/IP
      • 176.32.93.150 / SockPerf-1694303445.ap-northeast-1.elb.amazonaws.com (A Record)
  • ELB-C 정보
    • Zone: ap-northeast-1c
    • LB Protocol: TCP
    • LB Port: 5001
    • Instance Protocol: TCP
    • Instance Port: 5001
    • DNS/IP
      • 54.248.124.224 / sockperf-c-1386190870.ap-northeast-1.elb.amazonaws.com (A Record)
Edit

결과

첨부 엑셀/그래프 참조

Edit

동일 Zone

    A->B: 공인 DNS
    • TCP
      root@ip-10-152-173-96:/usr/local/sockperf/bin# ./sockperf ping-pong -i 54.250.97.46 -p 5001 -m 16384 -t 10 --pps=max --tcp
      sockperf:  == version #2.5. == 
      sockperf[CLIENT] send on:sockperf: using recvfrom() to block on socket(s)
      
      [ 0] IP = 54.250.97.46    PORT =  5001 # TCP
      sockperf: Warmup stage (sending a few dummy messages)...
      sockperf: Starting test...
      sockperf: Test end (interrupted by timer)
      sockperf: Test ended
      sockperf: [Total Run] RunTime=10.099 sec; SentMessages=3455; ReceivedMessages=3454
      sockperf: ========= Printing statistics for Server No: 0
      sockperf: [Valid Duration] RunTime=9.998 sec; SentMessages=3417; ReceivedMessages=3417
      sockperf: ====> avg-lat=1462.875 (std-dev=1090.760)
      sockperf: # dropped messages = 0; # duplicated messages = 0; # out-of-order messages = 0
      sockperf: Summary: Latency is 1462.875 usec
      sockperf: Total 3417 observations; each percentile contains 34.17 observations
      sockperf: ---> <MAX> observation = 31958.137
      sockperf: ---> percentile  99.99 = 31958.137
      sockperf: ---> percentile  99.90 = 18919.201
      sockperf: ---> percentile  99.50 = 3809.342
      sockperf: ---> percentile  99.00 = 3328.685
      sockperf: ---> percentile  95.00 = 2655.743
      sockperf: ---> percentile  90.00 = 2176.901
      sockperf: ---> percentile  75.00 = 1718.117
      sockperf: ---> percentile  50.00 = 1237.302
      sockperf: ---> percentile  25.00 = 1022.388
      sockperf: ---> <MIN> observation =  721.464
    • UDP
      root@ip-10-152-173-96:/usr/local/sockperf/bin# ./sockperf ping-pong -i 54.250.97.46 -p 5001 -m 16384 -t 10 --pps=max
      sockperf:  == version #2.5. == 
      sockperf[CLIENT] send on:sockperf: using recvfrom() to block on socket(s)
      
      [ 0] IP = 54.250.97.46    PORT =  5001 # UDP
      sockperf: Warmup stage (sending a few dummy messages)...
      sockperf: Starting test...
      sockperf: Test end (interrupted by timer)
      sockperf: Test ended
      sockperf: [Total Run] RunTime=10.101 sec; SentMessages=1172; ReceivedMessages=1171
      sockperf: ========= Printing statistics for Server No: 0
      sockperf: [Valid Duration] RunTime=9.997 sec; SentMessages=1159; ReceivedMessages=1159
      sockperf: ====> avg-lat=4312.799 (std-dev=1570.727)
      sockperf: # dropped messages = 0; # duplicated messages = 0; # out-of-order messages = 0
      sockperf: Summary: Latency is 4312.799 usec
      sockperf: Total 1159 observations; each percentile contains 11.59 observations
      sockperf: ---> <MAX> observation = 34023.287
      sockperf: ---> percentile  99.99 = 34023.287
      sockperf: ---> percentile  99.90 = 32017.070
      sockperf: ---> percentile  99.50 = 8009.275
      sockperf: ---> percentile  99.00 = 8002.157
      sockperf: ---> percentile  95.00 = 6002.642
      sockperf: ---> percentile  90.00 = 5995.283
      sockperf: ---> percentile  75.00 = 4005.037
      sockperf: ---> percentile  50.00 = 4000.878
      sockperf: ---> percentile  25.00 = 3997.844
      sockperf: ---> <MIN> observation = 3441.178
      
  • A->B: 사설 DNS
    • TCP
      root@ip-10-152-173-96:/usr/local/sockperf/bin# ./sockperf ping-pong -i 10.162.15.46 -p 5001 -m 16384 -t 10 --pps=max --tcp
      sockperf:  == version #2.5. == 
      sockperf[CLIENT] send on:sockperf: using recvfrom() to block on socket(s)
      
      [ 0] IP = 10.162.15.46    PORT =  5001 # TCP
      sockperf: Warmup stage (sending a few dummy messages)...
      sockperf: Starting test...
      sockperf: Test end (interrupted by timer)
      sockperf: Test ended
      sockperf: [Total Run] RunTime=10.101 sec; SentMessages=3850; ReceivedMessages=3849
      sockperf: ========= Printing statistics for Server No: 0
      sockperf: [Valid Duration] RunTime=10.001 sec; SentMessages=3814; ReceivedMessages=3814
      sockperf: ====> avg-lat=1310.974 (std-dev=1300.552)
      sockperf: # dropped messages = 0; # duplicated messages = 0; # out-of-order messages = 0
      sockperf: Summary: Latency is 1310.974 usec
      sockperf: Total 3814 observations; each percentile contains 38.14 observations
      sockperf: ---> <MAX> observation = 31679.585
      sockperf: ---> percentile  99.99 = 31679.585
      sockperf: ---> percentile  99.90 = 18777.097
      sockperf: ---> percentile  99.50 = 5004.997
      sockperf: ---> percentile  99.00 = 4177.719
      sockperf: ---> percentile  95.00 = 2647.471
      sockperf: ---> percentile  90.00 = 2222.535
      sockperf: ---> percentile  75.00 = 1618.295
      sockperf: ---> percentile  50.00 = 1085.067
      sockperf: ---> percentile  25.00 =  714.380
      sockperf: ---> <MIN> observation =  347.386
      
    • UDP
      root@ip-10-152-173-96:/usr/local/sockperf/bin# ./sockperf ping-pong -i 10.162.15.46 -p 5001 -m 16384 -t 10 --pps=max
      sockperf:  == version #2.5. == 
      sockperf[CLIENT] send on:sockperf: using recvfrom() to block on socket(s)
      
      [ 0] IP = 10.162.15.46    PORT =  5001 # UDP
      sockperf: Warmup stage (sending a few dummy messages)...
      sockperf: Starting test...
      sockperf: Test end (interrupted by timer)
      sockperf: Test ended
      sockperf: [Total Run] RunTime=10.101 sec; SentMessages=1231; ReceivedMessages=1230
      sockperf: ========= Printing statistics for Server No: 0
      sockperf: [Valid Duration] RunTime=9.601 sec; SentMessages=1224; ReceivedMessages=1224
      sockperf: ====> avg-lat=3921.816 (std-dev=1746.140)
      sockperf: # dropped messages = 0; # duplicated messages = 0; # out-of-order messages = 0
      sockperf: Summary: Latency is 3921.816 usec
      sockperf: Total 1224 observations; each percentile contains 12.24 observations
      sockperf: ---> <MAX> observation = 34020.301
      sockperf: ---> percentile  99.99 = 34020.301
      sockperf: ---> percentile  99.90 = 32013.095
      sockperf: ---> percentile  99.50 = 8008.463
      sockperf: ---> percentile  99.00 = 7998.229
      sockperf: ---> percentile  95.00 = 5999.880
      sockperf: ---> percentile  90.00 = 4990.765
      sockperf: ---> percentile  75.00 = 4005.645
      sockperf: ---> percentile  50.00 = 3999.775
      sockperf: ---> percentile  25.00 = 3990.058
      sockperf: ---> <MIN> observation = 1941.773
      
  • A->B: ELB-B 경유
    • TCP
      root@ip-10-152-173-96:/usr/local/sockperf/bin# ./sockperf ping-pong -i 176.32.93.150 -p 5001 -m 16384 -t 10 --pps=max --tcp
      sockperf:  == version #2.5. == 
      sockperf[CLIENT] send on:sockperf: using recvfrom() to block on socket(s)
      
      [ 0] IP = 176.32.93.150   PORT =  5001 # TCP
      sockperf: Warmup stage (sending a few dummy messages)...
      sockperf: Starting test...
      sockperf: Test end (interrupted by timer)
      sockperf: Test ended
      sockperf: [Total Run] RunTime=10.100 sec; SentMessages=2628; ReceivedMessages=2627
      sockperf: ========= Printing statistics for Server No: 0
      sockperf: [Valid Duration] RunTime=9.955 sec; SentMessages=2605; ReceivedMessages=2605
      sockperf: ====> avg-lat=1910.550 (std-dev=948.343)
      sockperf: # dropped messages = 0; # duplicated messages = 0; # out-of-order messages = 0
      sockperf: Summary: Latency is 1910.550 usec
      sockperf: Total 2605 observations; each percentile contains 26.05 observations
      sockperf: ---> <MAX> observation = 31351.928
      sockperf: ---> percentile  99.99 = 31351.928
      sockperf: ---> percentile  99.90 = 13266.080
      sockperf: ---> percentile  99.50 = 4643.678
      sockperf: ---> percentile  99.00 = 4265.762
      sockperf: ---> percentile  95.00 = 3234.758
      sockperf: ---> percentile  90.00 = 2781.928
      sockperf: ---> percentile  75.00 = 2069.907
      sockperf: ---> percentile  50.00 = 1670.907
      sockperf: ---> percentile  25.00 = 1427.325
      sockperf: ---> <MIN> observation = 1145.673
      
    • UDP
      • ELB에서 UDP 미지원으로 테스트 불가
Edit

다른 Zone

  • A->C: 공인 DNS
    • TCP
      root@ip-10-152-173-96:/usr/local/sockperf/bin# ./sockperf ping-pong -i 54.250.69.124 -p 5001 -m 16384 -t 10 --pps=max --tcp
      sockperf:  == version #2.5. == 
      sockperf[CLIENT] send on:sockperf: using recvfrom() to block on socket(s)
      
      [ 0] IP = 54.250.69.124   PORT =  5001 # TCP
      sockperf: Warmup stage (sending a few dummy messages)...
      sockperf: Starting test...
      sockperf: Test end (interrupted by timer)
      sockperf: Test ended
      sockperf: [Total Run] RunTime=10.102 sec; SentMessages=1982; ReceivedMessages=1981
      sockperf: ========= Printing statistics for Server No: 0
      sockperf: [Valid Duration] RunTime=10.001 sec; SentMessages=1962; ReceivedMessages=1962
      sockperf: ====> avg-lat=2548.662 (std-dev=1832.228)
      sockperf: # dropped messages = 0; # duplicated messages = 0; # out-of-order messages = 0
      sockperf: Summary: Latency is 2548.662 usec
      sockperf: Total 1962 observations; each percentile contains 19.62 observations
      sockperf: ---> <MAX> observation = 46399.863
      sockperf: ---> percentile  99.99 = 46399.863
      sockperf: ---> percentile  99.90 = 26070.326
      sockperf: ---> percentile  99.50 = 12983.683
      sockperf: ---> percentile  99.00 = 4294.068
      sockperf: ---> percentile  95.00 = 4025.450
      sockperf: ---> percentile  90.00 = 3924.323
      sockperf: ---> percentile  75.00 = 2629.824
      sockperf: ---> percentile  50.00 = 2070.109
      sockperf: ---> percentile  25.00 = 1963.635
      sockperf: ---> <MIN> observation = 1606.874
      
    • UDP
      root@ip-10-152-173-96:/usr/local/sockperf/bin# ./sockperf ping-pong -i 54.250.69.124 -p 5001 -m 16384 -t 10 --pps=max
      sockperf:  == version #2.5. == 
      sockperf[CLIENT] send on:sockperf: using recvfrom() to block on socket(s)
      
      [ 0] IP = 54.250.69.124   PORT =  5001 # UDP
      sockperf: Warmup stage (sending a few dummy messages)...
      sockperf: Starting test...
      sockperf: Test end (interrupted by timer)
      sockperf: Test ended
      sockperf: [Total Run] RunTime=10.101 sec; SentMessages=1153; ReceivedMessages=1152
      sockperf: ========= Printing statistics for Server No: 0
      sockperf: [Valid Duration] RunTime=10.001 sec; SentMessages=1140; ReceivedMessages=1140
      sockperf: ====> avg-lat=4386.197 (std-dev=1533.904)
      sockperf: # dropped messages = 0; # duplicated messages = 0; # out-of-order messages = 0
      sockperf: Summary: Latency is 4386.197 usec
      sockperf: Total 1140 observations; each percentile contains 11.40 observations
      sockperf: ---> <MAX> observation = 28006.313
      sockperf: ---> percentile  99.99 = 28006.313
      sockperf: ---> percentile  99.90 = 26138.757
      sockperf: ---> percentile  99.50 = 12003.960
      sockperf: ---> percentile  99.00 = 10006.633
      sockperf: ---> percentile  95.00 = 6004.485
      sockperf: ---> percentile  90.00 = 5995.108
      sockperf: ---> percentile  75.00 = 4007.216
      sockperf: ---> percentile  50.00 = 4001.184
      sockperf: ---> percentile  25.00 = 3996.925
      sockperf: ---> <MIN> observation = 3253.957
      
  • A->C: 사설 DNS
    • TCP
      root@ip-10-152-173-96:/usr/local/sockperf/bin# ./sockperf ping-pong -i 10.121.6.240 -p 5001 -m 16384 -t 10 --pps=max --tcp
      sockperf:  == version #2.5. == 
      sockperf[CLIENT] send on:sockperf: using recvfrom() to block on socket(s)
      
      [ 0] IP = 10.121.6.240    PORT =  5001 # TCP
      sockperf: Warmup stage (sending a few dummy messages)...
      sockperf: Starting test...
      sockperf: Test end (interrupted by timer)
      sockperf: Test ended
      sockperf: [Total Run] RunTime=10.100 sec; SentMessages=2316; ReceivedMessages=2315
      sockperf: ========= Printing statistics for Server No: 0
      sockperf: [Valid Duration] RunTime=10.003 sec; SentMessages=2297; ReceivedMessages=2297
      sockperf: ====> avg-lat=2177.273 (std-dev=1583.329)
      sockperf: # dropped messages = 0; # duplicated messages = 0; # out-of-order messages = 0
      sockperf: Summary: Latency is 2177.273 usec
      sockperf: Total 2297 observations; each percentile contains 22.97 observations
      sockperf: ---> <MAX> observation = 26539.603
      sockperf: ---> percentile  99.99 = 26539.603
      sockperf: ---> percentile  99.90 = 24238.810
      sockperf: ---> percentile  99.50 = 12957.637
      sockperf: ---> percentile  99.00 = 11637.611
      sockperf: ---> percentile  95.00 = 2913.860
      sockperf: ---> percentile  90.00 = 2579.413
      sockperf: ---> percentile  75.00 = 2088.335
      sockperf: ---> percentile  50.00 = 1997.917
      sockperf: ---> percentile  25.00 = 1768.126
      sockperf: ---> <MIN> observation = 1274.989
      
    • UDP
      root@ip-10-152-173-96:/usr/local/sockperf/bin# ./sockperf ping-pong -i 10.121.6.240 -p 5001 -m 16384 -t 10 --pps=max
      sockperf:  == version #2.5. == 
      sockperf[CLIENT] send on:sockperf: using recvfrom() to block on socket(s)
      
      [ 0] IP = 10.121.6.240    PORT =  5001 # UDP
      sockperf: Warmup stage (sending a few dummy messages)...
      sockperf: Starting test...
      sockperf: Test end (interrupted by timer)
      sockperf: Test ended
      sockperf: [Total Run] RunTime=10.101 sec; SentMessages=934; ReceivedMessages=933
      sockperf: ========= Printing statistics for Server No: 0
      sockperf: [Valid Duration] RunTime=9.997 sec; SentMessages=924; ReceivedMessages=924
      sockperf: ====> avg-lat=5409.573 (std-dev=1625.872)
      sockperf: # dropped messages = 0; # duplicated messages = 0; # out-of-order messages = 0
      sockperf: Summary: Latency is 5409.573 usec
      sockperf: Total 924 observations; each percentile contains 9.24 observations
      sockperf: ---> <MAX> observation = 25542.427
      sockperf: ---> percentile  99.99 = 25542.427
      sockperf: ---> percentile  99.90 = 20010.379
      sockperf: ---> percentile  99.50 = 12113.971
      sockperf: ---> percentile  99.00 = 8020.686
      sockperf: ---> percentile  95.00 = 7988.814
      sockperf: ---> percentile  90.00 = 6012.314
      sockperf: ---> percentile  75.00 = 6003.931
      sockperf: ---> percentile  50.00 = 5994.757
      sockperf: ---> percentile  25.00 = 4001.799
      sockperf: ---> <MIN> observation = 1996.650
      
  • A->C: ELB-C 경유
    • TCP
      root@ip-10-152-173-96:/usr/local/sockperf/bin# ./sockperf ping-pong -i 54.248.124.224 -p 5001 -m 16384 -t 10 --pps=max --tcp
      sockperf:  == version #2.5. == 
      sockperf[CLIENT] send on:sockperf: using recvfrom() to block on socket(s)
      
      [ 0] IP = 54.248.124.224  PORT =  5001 # TCP
      sockperf: Warmup stage (sending a few dummy messages)...
      sockperf: Starting test...
      sockperf: Test end (interrupted by timer)
      sockperf: Test ended
      sockperf: [Total Run] RunTime=10.099 sec; SentMessages=1579; ReceivedMessages=1578
      sockperf: ========= Printing statistics for Server No: 0
      sockperf: [Valid Duration] RunTime=10.000 sec; SentMessages=1562; ReceivedMessages=1562
      sockperf: ====> avg-lat=3200.865 (std-dev=1955.397)
      sockperf: # dropped messages = 0; # duplicated messages = 0; # out-of-order messages = 0
      sockperf: Summary: Latency is 3200.865 usec
      sockperf: Total 1562 observations; each percentile contains 15.62 observations
      sockperf: ---> <MAX> observation = 25292.453
      sockperf: ---> percentile  99.99 = 25292.453
      sockperf: ---> percentile  99.90 = 24183.071
      sockperf: ---> percentile  99.50 = 19981.548
      sockperf: ---> percentile  99.00 = 14068.981
      sockperf: ---> percentile  95.00 = 4114.684
      sockperf: ---> percentile  90.00 = 4015.404
      sockperf: ---> percentile  75.00 = 3850.997
      sockperf: ---> percentile  50.00 = 2928.466
      sockperf: ---> percentile  25.00 = 2218.596
      sockperf: ---> <MIN> observation = 1889.028
      
    • UDP
      • ELB에서 UDP 미지원으로 테스트 불가


(그외 유사 구글 검색 자료): http://orensol.com/2009/05/24/network-latency-inside-and-across-amazon-ec2-availability-zones/


Posted by 사랑줍는거지
,


YCSB 사용할 일이 반복적으로 많아 질것 같아 Script 처리를 하면 좀 편해질까 싶어 막스크립트 작성중... 우선은 Cassandra가 직접적으로 관련이 있어 cassandra-10만 우선 지원.(cassnadra-7,8도 동일하게 가능할듯...)


기능은 단순하다.

- ycsb 명령 줄의 parameter들을 다이얼로그 형태로 지원하는 것일 뿐....

- 그일 첨 시작이라 테스트 해보고 써억~ 편의점이 없다면 과감히 휴지통으로 고고~


실행 예)



# ./ycsb_runner.workloads.20130108.sh 


 === 'Green' is supported ===


 [a] basic

 [b] cassandra-10

 [c] cassandra-7

 [d] cassandra-8

 [e] gemfire

 [f] hbase

 [g] infinispan

 [h] jdbc

 [i] mapkeeper

 [j] mongodb

 [k] nosqldb

 [l] redis

 [m] voldemort


 -> Select Database: b



 -> Title(Name): test


===============================================


 -> hosts (Not Null, ex:192.168.1.52,192.168.1.53): 172.21.81.139,172.21.81.127


 -> cassandra.username (Default: Null): 


 -> cassandra.password (Default: Null): 


 -> cassandra.connectionretries (Default: 300): 


 -> cassandra.operationretries (Default: 300): 


 -> cassandra.columnfamily (Default: data): 


 -> fieldcount (Default: 10): 


 -> fieldlength (Default: 200): 


 -> cassandra.readconsistencylevel (Default: ONE): 


 -> cassandra.writeconsistencylevel (Default: ONE): 


 -> cassandra.scanconsistencylevel (Default: ONE): 


 -> cassandra.deleteconsistencylevel (Default: ONE): 


 -> threads - Number of client threads (Default: 1):


ycsb_runner.sh

#!/bin/bash



### by call518@gmail.com (Jung-In.Jung)


### ChangeLog

#* 2013-01-03 : created, support and tested cassandra-10




# [YCSB]

# Usage: ./bin/ycsb command database [options]

# Commands:

#     load          Execute the load phase

#     run           Execute the transaction phase

#     shell         Interactive mode

# Databases:

#     basic         https://github.com/brianfrankcooper/YCSB/tree/master/basic

#     cassandra-10  https://github.com/brianfrankcooper/YCSB/tree/master/cassandra

#     cassandra-7   https://github.com/brianfrankcooper/YCSB/tree/master/cassandra

#     cassandra-8   https://github.com/brianfrankcooper/YCSB/tree/master/cassandra

#     gemfire       https://github.com/brianfrankcooper/YCSB/tree/master/gemfire

#     hbase         https://github.com/brianfrankcooper/YCSB/tree/master/hbase

#     infinispan    https://github.com/brianfrankcooper/YCSB/tree/master/infinispan

#     jdbc          https://github.com/brianfrankcooper/YCSB/tree/master/jdbc

#     mapkeeper     https://github.com/brianfrankcooper/YCSB/tree/master/mapkeeper

#     mongodb       https://github.com/brianfrankcooper/YCSB/tree/master/mongodb

#     nosqldb       https://github.com/brianfrankcooper/YCSB/tree/master/nosqldb

#     redis         https://github.com/brianfrankcooper/YCSB/tree/master/redis

#     voldemort     https://github.com/brianfrankcooper/YCSB/tree/master/voldemort

# Options:

#     -P file       Specify workload file

#     -p key=value  Override workload property

#     -s            Print status to stderr

#     -target n     Target ops/sec (default: unthrottled)

#     -threads n    Number of client threads (default: 1)

# Workload Files:

#     There are various predefined workloads under workloads/ directory.

#     See https://github.com/brianfrankcooper/YCSB/wiki/Core-Properties

#     for the list of workload properties.


trap "rm -f $tmp_file; reset_color; echo; exit 99" 2


now_time() {

date +"%Y-%m-%d__%H-%M-%S"

}


reset_color() {

tput sgr0

}


color_green="\033[1;32m"

color_red="\033[1;31m"

color_blue="\033[1;34m"

color_yellow="\033[1;33m"

color_cyan="\033[1;36m"


tmp_file="/dev/shm/$RANDOM.tmp"


CASSANDRA_CLI="/usr/local/cassandra/bin/cassandra-cli"


YCSB_BIN="/usr/local/src/ycsb-0.1.4/bin/ycsb"

WORKLOAD_DIR="/usr/local/src/ycsb-0.1.4/workloads"


RUN_PATH=`pwd`

LOG_DIR="$RUN_PATH/logs"


mkdir -p $LOG_DIR


if [ -z $YCSB_BIN ]; then

YCSB_BIN=`which ycsb`

if [ -z $YCSB_BIN ]; then

echo

echo -e "$color_red Not found ycsb command!!!"

reset_color

echo

echo -n " -> Input YCSB Command Path: "

read YCSB_BIN

if [ ! -f $YCSB_BIN ] || [ -z $YCSB_BIN ]; then

echo

echo -e "$color_red Invalid path or not found. retry!!"

echo

reset_color

exit 101

fi

fi

fi


if [ ! -d $WORKLOAD_DIR ]; then

echo -e "$color_red Not found workloads directory command!!!"

reset_color

exit 101

fi


###############################################################

basic() {

echo -e "$color_green TBD"

echo

}


cassandra_10() {

echo -n "

 -> Title(Name): "

read title

if [ -z $title ]; then

echo -e "$color_red title is Invalid of Null. retry!!"

echo

reset_color

exit 101

fi


#echo -n "

# [a] load

# [b] run

#

# -> Select Command: "

#

#read command

#case $command in

# a|A)

# command="load"

# ;;

# b|B)

# command="run"

# ;;

#esac

command="run"


echo

echo "==============================================="


echo -n -e "$color_red

 -> hosts (Not Null, ex:192.168.1.52,192.168.1.53): "

reset_color

read hosts

if [ -z $hosts ];then

echo

echo -e "$color_red Hosts is Null !!! retry!!!"

echo

reset_color

exit 105

fi


echo -n "

 -> cassandra.username (Default: Null): "

read cassandra_username


echo -n "

 -> cassandra.password (Default: Null): "

read cassandra_password


echo -n "

 -> cassandra.connectionretries (Default: 300): "

read cassandra_connectionretries

if [ -z $cassandra_connectionretries ]; then cassandra_connectionretries="300"; fi


echo -n "

 -> cassandra.operationretries (Default: 300): "

read cassandra_operationretries

if [ -z $cassandra_operationretries ]; then cassandra_operationretries="300"; fi


echo -n "

 -> cassandra.columnfamily (Default: data): "

read cassandra_columnfamily

if [ -z $cassandra_columnfamily ]; then cassandra_columnfamily="data"; fi


echo -n "

 -> fieldcount (Default: 10): "

read fieldcount

if [ -z $fieldcount ]; then fieldcount="10"; fi


echo -n "

 -> fieldlength (Default: 200): "

read fieldlength

if [ -z $fieldlength ]; then fieldlength="200"; fi


echo -n "

 -> cassandra.readconsistencylevel (Default: ONE): "

read cassandra_readconsistencylevel


echo -n "

 -> cassandra.writeconsistencylevel (Default: ONE): "

read cassandra_writeconsistencylevel

if [ -z $ ]; then =""; fi


echo -n "

 -> cassandra.scanconsistencylevel (Default: ONE): "

read cassandra_scanconsistencylevel


echo -n "

 -> cassandra.deleteconsistencylevel (Default: ONE): "

read cassandra_deleteconsistencylevel


echo -n "

 -> threads - Number of client threads (Default: 1): "

read threads


echo -n "

 -> target - Target ops/sec (Default: unthrottled): "

read target


args="a b c d e f"


TIMESTAMP=`now_time`

for arg in $args

do

host_one=`echo $hosts | awk -F',' '{print $1}'`

echo "create keyspace usertable;

use usertable;

drop column family $cassandra_columnfamily;

create column family $cassandra_columnfamily;" > $tmp_file

$CASSANDRA_CLI -h $host_one -p 9160 < $tmp_file > /dev/null

rm -f $tmp_file


CMD="$YCSB_BIN $command $db -s -P workloads/workload$arg -p hosts=$hosts"


if [ ! -z $cassandra_username ]; then CMD="$CMD -p cassandra.username=$cassandra_username"; fi

if [ ! -z $cassandra_password ]; then CMD="$CMD -p cassandra.password=$cassandra_password"; fi

if [ ! -z $cassandra_connectionretries ]; then CMD="$CMD -p cassandra.connectionretries=$cassandra_connectionretries"; fi

if [ ! -z $cassandra_operationretries ]; then CMD="$CMD -p cassandra.operationretries=$cassandra_operationretries"; fi

if [ ! -z $cassandra_columnfamily ]; then CMD="$CMD -p cassandra.columnfamily=$cassandra_columnfamily"; fi

if [ ! -z $fieldlength ]; then CMD="$CMD -p fieldlength=$fieldlength"; fi

if [ ! -z $fieldcount ]; then CMD="$CMD -p fieldcount=$fieldcount"; fi

if [ ! -z $cassandra_readconsistencylevel ]; then CMD="$CMD -p cassandra.readconsistencylevel=$cassandra_readconsistencylevel"; fi

if [ ! -z $cassandra_writeconsistencylevel ]; then CMD="$CMD -p cassandra.writeconsistencylevel=$cassandra_writeconsistencylevel"; fi

if [ ! -z $cassandra_scanconsistencylevel ]; then CMD="$CMD -p cassandra.scanconsistencylevel=$cassandra_scanconsistencylevel"; fi

if [ ! -z $cassandra_deleteconsistencylevel ]; then CMD="$CMD -p cassandra.deleteconsistencylevel=$cassandra_deleteconsistencylevel"; fi

if [ ! -z $threads ]; then

CMD="$CMD -threads $threads"

fi

if [ ! -z $target ]; then

CMD="$CMD -target $target"

fi

echo -e "$color_cyan"

echo "=== [ YCSB Benchamrk Command ] ==="

echo

echo "# $CMD"

#echo -n "$color_blue

#Press any key to continue..... "

#read tmp

LOG_FILE="$LOG_DIR/$title--workload$arg---$TIMESTAMP.log"


echo "[Start]: `now_time`" > $LOG_FILE

echo >> $LOG_FILE

echo "[Running] # $CMD" >> $LOG_FILE

echo >> $LOG_FILE

$CMD 2>&1 | tee -a $LOG_FILE

echo >> $LOG_FILE

echo "[END]: `now_time`" >> $LOG_FILE

done

reset_color


echo

}


cassandra_7() {

echo -e "$color_green TBD"

echo

}


cassandra_8() {

echo -e "$color_green TBD"

echo

}


gemfire() {

echo -e "$color_green TBD"

echo

}


hbase() {

echo -e "$color_green TBD"

echo

}


infinispan() {

echo -e "$color_green TBD"

echo

}


jdbc() {

echo -e "$color_green TBD"

echo

}


mapkeeper() {

echo -e "$color_green TBD"

echo

}


mongodb() {

echo -e "$color_green TBD"

echo

}


nosqldb() {

echo -e "$color_green TBD"

echo

}


redis() {

echo -e "$color_green TBD"

echo

}


voldemort() {

echo -e "$color_green TBD"

echo

}

###############################################################


clear


echo

echo -e "$color_green === 'Green' is supported ==="; reset_color

echo

echo " [a] basic"; reset_color

echo -e "$color_green [b] cassandra-10"; reset_color

echo " [c] cassandra-7"; reset_color

echo " [d] cassandra-8"; reset_color

echo " [e] gemfire"; reset_color

echo " [f] hbase"; reset_color

echo " [g] infinispan"; reset_color

echo " [h] jdbc"; reset_color

echo " [i] mapkeeper"; reset_color

echo " [j] mongodb"; reset_color

echo " [k] nosqldb"; reset_color

echo " [l] redis"; reset_color

echo " [m] voldemort"; reset_color

echo

echo -n " -> Select Database: "


read db

echo


case $db in

a|A)

db="basic"

basic

;;

b|B)

db="cassandra-10"

cassandra_10

;;

c|C)

db="cassandra-7"

cassandra_7

;;

d|D)

db="cassandra-8"

cassandra_8

;;

e|E)

db=gemfire

gemfire

;;

f|F)

db="hbase"

hbase

;;

g|G)

db="infinispan"

infinispan

;;

h|H)

db="jdbc"

jdbc

;;

i|I)

db="mapkeeper"

mapkeeper

;;

j|J)

db="mongodb"

mongodb

;;

k|K)

db="nosqldb"

nosqldb

;;

l|L)

db="redis"

redis

;;

m|M)

db="voldemort"

voldemort

;;

*)

echo

echo -e "$color_red Invalid Selection. Retry!!"

echo

reset_color

exit 100

;;

esac


reset_color


Posted by 사랑줍는거지
,

Myth or truth: One should always use Apache httpd in front of Apache Tomcat to improve performance?


http://www.tomcatexpert.com/blog/2010/03/24/myth-or-truth-one-should-always-use-apache-httpd-front-apache-tomcat-improve-perform


원문은 : 위 링크

Apache-Tomcat과 httpd의 핵심 개발자들이 직접 작성한 내용입니다. 오늘 옆팀에서 Apache만 붙이면 성능이 떨어진다고 해서 좀 봐주다가 찾은 자료네요. PHP를 서비스 하거나, 기타 Apahce의 특정 모듈기능을 필요하지 않는다면, 다시 말해 단순 정적인 웹서비스에서는 굳이 httpd서버를 Tomcat앞단에 둘필요는 없을듯 합니다. 흔히들 대부분의 개발자들이 기본적인 HTTP요청은 Apache가 처리하고 Tomcat내에서 처리될 자바 어플리케이션만 Tocmat으로 보내 처리되도록 하는게 가장 성능이 좋을것이라 믿어 왔지만. 구조상으로 봐도, 더 좋을리는........ Tomcat의 Apache Native Module성능이 httpd에 비교해 전혀 차이가 없는데..........(PHP등을 사용한다면, Apache가 앞단에 있어야 하니, 그런 부분은 논외 처리. 번거로움없이 일반유저로 80포트를 사용하고 싶다거나, Tomcat에러페이지를 관리 하고 싶다거나, 등등 나름대로 Apache를 앞단에 두어야 할 이유도 충분히 있다. 이글의 요점은 Apache를 앞단에 두어서는 안된다~가 아니니 오해 없기를~)
 

Myth or truth: One should always use Apache httpd in front of Apache Tomcat to improve performance?

 posted by mthomas on April 14, 2010 11:14 PM

The short answer is that this is a myth. The longer answer is that back in the days of Tomcat 3 there was some truth to this depending on circumstances. However, for the versions of Tomcat in use today (5.5.x and 6.0.x) then there is no need to use httpd for purely performance reasons. Tomcat now supports the native/APR connector which uses the same native library (the Apache Portable Runtime—APR) as httpd for the low-level I/O and therefore can achieve similar performance to httpd. When serving static content there is ever so slightly more overhead when using Tomcat compared to httpd but the differences are so small they are unlikely to be noticeable in production systems.

If you research the httpd vs Tomcat performance issue, you will find a variety of load and performance benchmarks that show a range of results. An often quoted result shows that Tomcat's pure Java connector is consistently faster than httpd.

This particular result is the opposite of what is expected. httpd should be significantly faster than Tomcat's pure Java connector. This result is probably caused by the size of the file used. Tomcat caches small static files in memory by default and this will provide a significant performance improvement. httpd does not cache files in memory by default. This demonstrates quite nicely how the definition of the benchmark can have a significant impact on the results.

The performance testing performed by Christopher Schultz, a regular on the Tomcat users mailing list, used a wider range of file sizes and provides – in my view – better results. The results of his tests are shown in the graph below.

Click to see larger image

These results are much more in line with what is expected, although there are a few interesting points to note:

  • Apache httpd and Coyote APR/native show similar performance levels.
  • Coyote NIO isn't too far behind httpd and Coyote APR/native.
  • There appears to be a limit on the usefulness of sendfile. This may be a hardware limitation but is worthy of further attention. I've added this to my todo list.
  • For small file sizes (less than ~10KiB) the static file caching in Tomcat provides a significant performance boost.

The detailed results for any performance test will vary with a number of factors such as the hardware used, the number of concurrent requests, the use of keep-alive and the use of caching. These factors can change the results of a particular test but the broad performance results will remain the same:

  • httpd and Coyote APR/native typically have similar performance.
  • Coyote NIO is typically just behind Coyote APR/native (further behind for SSL).
  • Coyote BIO will typically offer the lowest performance.

The settings to achieve the best performance will vary from application to application. The best settings for an application will depend significantly on the size of the resources, the ratio of static to dynamic content, the number of concurrent users, the usage patterns of those users and so on. Generally, performance can be improved by increasing the cacheMaxSize for the context, increasing the number of connector threads (using maxThreads [4]) available to process requests and enabling keep-alive (using maxKeepAliveRequests) but all of these come at the cost of increased resource usage. There is a trade-off to make here between performance and resource usage that will be different for each application.

It should also be noted that there is no magic "make it run faster" option in Tomcat. If your application takes 15s to generate a request, there is nothing that Tomcat can do to improve that. You'll need to profile your application to understand why requests are taking that long and then tune your application code appropriately.

While raw performance for static content may not be a good reason to use httpd, there are a number of good reasons why you might want to use httpd with Tomcat. The most frequent reason is to provide load-balancing to two or more Tomcat instances. httpd isn't the only option to so this - hardware load balancers or other reverse proxies can be used - but it is a popular choice amongst system administrators as many of them are already familiar with httpd. I'll write more on using httpd as a load-balancer in a future article.

httpd is also used with Tomcat when there is a requirement to support technologies other than Java. While Tomcat can support PHP or Perl, the support for these is better in httpd. Therefore, for sites that need a mix of technologies httpd can be used as the front-end web server, directing requests to mod_php, mod_fastcgi, mod_proxy_http (for Tomcat) or any other module as appropriate.

httpd's support for integrated Windows authentication is also a reason for using httpd in front of Tomcat. There are Tomcat based solutions for integrated windows authentication and, as these gain acceptance through wider use, this particular reason for using httpd may become less important. However, at the moment, it remains one of the more frequently cited reasons for using httpd with Tomcat.

In summary, there are good reasons for using httpd with Tomcat but raw performance for static content isn't one of them. If you are using httpd solely to improve static content performance then I recommend taking a look at the Coyote APR/native connector for Apache Tomcat.

Mark Thomas is a Senior Software Engineer for the SpringSource Division of VMware, Inc. (NYSE: VMW). Mark has been using and developing Tomcat for over six years. He first got involved in the development of Tomcat when he needed better control over the SSL configuration than was available at the time. After fixing that first bug, he started working his way through the remaining Tomcat bugs and is still going. Along the way Mark has become a Tomcat committer and PMC member, volunteered to be the Tomcat 4 & 7 release manager, created the Tomcat security pages, become a member of the ASF and joined the Apache Security Committee. He also helps maintain the ASF's Bugzilla instances. Mark has a MEng in Electronic and Electrical Engineering from the University of Birmingham, United Kingdom.

Comments

Configuring Response Headers

We're currently using Apache Httpd to handle such things as expires by type and gzip configuration. I wonder if these things can be set up in tomcat, thereby eliminating the httpd layer for us.

CDN & Throughput

I think that it is useful to use the httpd when you are configuring the Content Delivery Network.

IMHO if you use both the httpd and tomcat on different machines, each can fully concentrate only on its work. Tomcat's threads can compute your application's logic and use the whole memory for speed up the application. Whilst httpd's threads can serve the content from the disk. This can improve the throughput.

-- tom

Different Myth(?)

While this post answers the myth question of native HTTP vs Tomcat HTTP, if you are using a native HTTP to do (perhaps) other services, I'm curious about whether it's myth or truth that one should go with AJP or HTTP for the native<->Tomcat communication. The tomcat documentation mostly seems to suggest that this should be AJP rather than HTTP - is this still just a myth?


Posted by 사랑줍는거지
,