Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Loadrunner: 부하 시나리오작성및 다양한 언어를 통해 스크립트 작성이가능하며(유닛테스트를 꼼꼼하게 작성했다면 활용가능),가상네트워크 구축을 통해 분산테스팅 환경을 지원합니다.

  • OpenNMS(시스템모니터링툴): 부하테스트시 시스템의 부하측정은 중요한 부분입니다.

  • 프로파일러(dotTrace,dotMemory): 시스템 모니터링툴이 하지 못하는, 개발 프레임워크 내에서 조금더 디테일한 프로파일링(메모리,오브젝트량,쓰레드상태등)을 할수가 있습니다. 보통 10개의 분산 서비스라고 하면 프로파일러 자체가 성능에 영향을 끼치므로 노드 한개정도만 리모트로 걸어둡니다.

  • 커스텀 제작 테스트툴: 대부분의 부하테스트는 스크립트에서 작성가능하지만,상황에따라 커스텀한 테스트툴 작성

테스트 장비 설정및 전략

  • 테스트 사이트 설정시 서비스 장비와 동일한 개수가 이상적이나, 상황에 맞게 목표타켓을 맞춰줍니다.

  • 실 사용자 계정을 복사하여 테스트는 대부분의 사이트가 불가하며, 활성화 유져수에 해당하는 가상유져및 가상네트워크를 사용하는 전략을 세웁니다.

  • 결제와 같은 API는 테스트가 불가할수 있습니다. 그러면 결제 API와 유사한 반응속도와 작동을 하는 더미 API 개발이 필요할수 있습니다.

  • API를 통해 DB성능 테스트가 자연스레 포함되기때문에, 서비스 DB의 데이터량(테스트에 관여안하는 Log성 Data도 포함)과 똑같으면 이상적입니다. 대용량 테스트는 TestDB의 디스크풀을 나게할수 있음으로, DBA와 모니터링 협조합니다.

  • 성능테스트는 주로 프로젝트 마무리 기간에 수행이되며, 성능이슈로 코드수정시 기능검증된 QA를 다시해야되는 불편한 상황이 생길수 있습니다. 풀테스트를 다시진행하여 개발완료시간을 소모하는 일이 발생하지 않게, 변경 영향범위를 최소화하여 예측해야합니다.

성능 테스트 결과물

...

...

...

로드량 계획

Info

여기까지가 되면, 이제 로드테스트를 할수 있는 기반이된것입니다.

기존 사용자 유입량을 정확하게 로그기반으로 Type별로 측정하여, 작성중인 API의 예상 호출량을 예측하여야합니다.

아래표는 실제 해당 접속자수에 모든로그를 조사하여 API호출량을 예측한것입니다.

측정역시 오차가 있을수 있기때문에 +50% 더 버틸수 있게 테스트 시나리오를 작성합니다.

Panel


Lobby/Games API

Scenario 1: Display the Lobby

Concurrent players in the lobby at peak time:

Current

With +50% margin

  • Download Client: 8,600
  • Mobile: 1,400
  • Total: 10,000
  • Download Client: 12,900
  • Mobile: 3,100
  • Total: 15,000

Estimation for the repartition of players within the different tabs:

Tab

% estimation

Zone7%
Cash32%
Tournament (SnG + Scheduled)53%
Casino8%

Requests:

Action

Endpoint

Frequency

Estimation

With +50% margin

Refresh the sso tokenPUT /keepalive/{authToken}every 5 min

= 2,000 calls / min

= 34 TPS

50 TPS
Get the list of zone gamesGET /zone/games/{playMode}/{gameType}/{buyin}/{limit}/{seats}?authToken={authToken}every 50 sec

7% players on zone tab = 700 players

= 14 TPS 

21 TPS
Get the list of cash tablesGET /cash/tables/{playMode}/{gameType}/{buyin}/{limit}/{seats}?authToken={authToken}every 50 sec

32% players on cash tab = 3,200 players

= 64 TPS

96 TPS
Get the list of tournamentsGET/tournaments/games/{playMode}/{gameFormat}/{tournamentType}/{gameType}/{buyin}/{limit}/{seats}?authToken={authToken}1 time

990 logins / min

53 % of players going to a tournament tab

= 8.7 TPS

13 TPS

In addition, each player will have a WebSocket connection to the Lobby Websocket API.

Scenario 2: Play a Game

Concurrent players playing a game at peak time:

Current

With +50% margin

Unique: 6,000

Total: 10,000

Unique: 9,000

Total: 15,000

Estimation for the repartition of players within the different game types:

Tab

% estimation

Zone8%
Cash32%
Tournament (SnG + Scheduled)60%

Requests:

Action

Endpoint

Frequency

Current peak / estimation

With +50% margin

Get buyin info for a zone gameGET /zone/buyin/{gameId}/{authToken}1 time

30 / min

= 0.5 TPS

0.75 TPS
Buyin to a zone gamePOST /zone/buyin/{gameId}/{authToken}1 time

30 / min

= 0.5 TPS

0.75 TPS
Get buyin info for a tournamentGET /tournaments/{tournamentId}/register/{authToken}1 time

153 / min

= 2.6 TPS

4 TPS
Buyin to a tournamentPOST /tournaments/{tournamentId}/register/{authToken}1 time

153 / min

= 2.6 TPS

4 TPS
Launch a gamePOST /launchGame/{gameFormat}/{gameId}/{authToken}1 time

224 / min

= 3.7 TPS

5.5 TPS
Get tournament informationGET /tournaments/{tournamentId}/info1 time

153 / min

= 2.6 TPS

4 TPS
Get tournament stateGET /tournaments/{tournamentId}/stateevery 30 sec

60% players in tournaments = 6,000

= 200 TPS

300 TPS
Get tournament table listGET /tournaments/{tournamentId}/tablesevery 10 sec

60% players in tournaments = 6,000

= 600 TPS

900 TPS
Get tournament leaderboardGET /tournaments/{tournamentId}/leaderboardevery 10 sec

60% players in tournaments = 6,000

= 600 TPS

900 TPS
Get my rank

GET /tournaments/{tournamentId}/rank/{authToken}

1 time

153 / min

= 2.6 TPS

4 TPS

In addition, each player will have a WebSocket connection to the Games API.

Other actions

Requests:

Action

Endpoint

Frequency

Current peak

With +50% margin

Unregister from a tournamentPOST /tournaments/{tournamentId}/unregister/{authToken}1 time

10 / min

= 0.16 TPS

0.25 TPS

Account API

Action

Endpoint

Frequency

Current peak / estimation

With +50% margin

Get account informationGET /account/{authToken}

1 time (launch DL)

Mobile: 87/min

DL: 224/min

= 5 TPS

7.5 TPS
Request play moneyPUT /account/playMoney/{authToken}1 time

Mobile: 8/min

DL: 52/min

= 1 TPS

1.5 TPS
Get preferencesGET /preferences/{preferenceType}/{authToken}1 time (launch DL)

1,632/min

= 27 TPS

41 TPS
Set preferencesPUT /preferences/{preferenceType}/{authToken}1 time

389/min

= 6.5 TPS

9.75 TPS
Get system wide messageGET/message/{messageType}/{messageId}/{clientType}/{authToken}1 time

10,000/min

= 166 TPS

250 TPS
Set fingerprintPUT /fingerprint/{authToken}1 time (launch DL)

Mobile: 87/min

DL: 990/min

= 18 TPS

27 TPS
Check profile statusPUT /checkProfile/{authToken}1 time (launch DL)

DL: 990/min

= 16.5 TPS

24.75 TPS
Get banned wordsGET /bannedWords1 time (launch DL)

Mobile: 58/min

DL: 1,100/min

= 19 TPS

29 TPS
Get server settingsGET /settings1 time (launch DL)

Mobile: 45/min

DL: 1,100/min

= 19 TPS

29 TPS
Get operator profileGET /operatorProfile1 time (launch DL)

DL: 1,100/min

= 18 TPS

27.5 TPS
Get tournament custom typeGET /tournamentCustomType1 time (launch DL)

DL: 8,600/min

= 143 TPS

215 TPS
Get banners infoGET /banners1 time (launch DL)

DL: 4,090/min

= 68 TPS

102 TPS
Get bonus feature statusGET /bonus/feature1 time

Mobile: 116/min

= 2 TPS

3 TPS
Get bonus indicatorGET /bonus/indicator/{authToken}every 5 min in DL client

DL: 2,000/min

= 33 TPS

50 TPS
Get active bonus informationGET /bonus/active/{authToken}1 time

Mobile: 80/min

= 1.5 TPS

2 TPS
Get available bonus listGET /bonus/available/{authToken}1 time

Mobile: 11/min

= 0.2 TPS

0.3 TPS
Get bonus detailsGET /bonus/{bonusId}/details/{authToken}1 time

Mobile: 9/min

= 0.15 TPS

0.23 TPS
Activate bonusPUT /bonus/{bonusId}/{action}/{authToken}1 time

Mobile: 1/min

= 0.01 TPS

0.02 TPS
Reorder bonusPUT /bonus/{bonusId}/move/{direction}/{authToken}1 time

Mobile: 1/min

= 0.01 TPS

0.02 TPS
Get HH listGET /hh/{gameFormat}/{authToken}1 time

Mobile: 9/min

DL: 154/min

= 2.7 TPS

4 TPS
Get HH detailsGET /hh/{gameFormat}/{handId}/{authToken}1 time

Mobile: 32/min

DL: 154/min

= 3 TPS

5 TPS
Send error log to serverPOST /logging/client/{logType}/{authToken}1 time

DL: 1,882/min

= 31 TPS

47 TPS

Calculation API

Action

Endpoint

Frequency

Current peak / estimation

With +50% margin

Get all-in percentages

POST /all-in-percentages

80% holdem

20% omaha


33% 5 board cards

33% 4 board cards

23% 3 board cards

11% no board cards


1000/min

= 16.5 TPS

25 TPS




가상시나리오 Time라인/EndPoint별 성공률
사용자 시나리오가 반영된 Endpoint/시간별 성공그래프
네트워크량 변화 측정
API 지속력 측정


사용자 유입시나리오를 반영한 로드테스트

Panel

9000 accounts + websocket

9000 account + websocket
Transaction Name 

Total

Count 

Failed

Count 

Error

ratio 

TPS

Total

Count 

Failed

Count

Error

ratio

TPS

Total

Count 

Failed

Count

Error

ratio

TPS
 Target

MaxLoad

OverallTarget MaxLoadOverallTarget MaxLoadOverall

Avg

Avg
AvgAvg
AvgAvg
Login9000




9000










KeepAlive2918720487.0250
18.847299991000.3350
20.763





getTournamentsByFilter163202281.4013
9.24821890740.3413
12.538





getTournamentsInfo490570.144
2.8156790004
3.902





getTournamentsState37003273311.98300
208.449511021419598.21300
269.576





getTournamentsTables1111262210641.90900
626.551153176066690.44900
876.489





getTournamentsLeaderboard10882369360.09900
624.885152504300900
876.461





getTournamentsRank4850120.254
2.8806740004
3.874





getTournamentsBuyinInfo48970
4
2.8146790004
3.902





tournamentsBuyin48960
4
2.8146788004
3.901





unRegister2330
0.25
0.14433620.600.25
0.214





Overall error rate











Image file

Image Added

Image Added

Image Added

Image Added

Image Added


Max Clients9,000900015,000
Ramp up15min15min15min
Time to run10min10min70min
Ramp down5min5min5min
Remarks
  • Errors of Get Tournaments state were increased sharply when right after finishing ramp-up. 

다음날 서버상태.

Image Added




로드테크트 깨알팁

...

부하테스트 스크립트를 최초에 작성시에는, 특정한 스텝을 잘못수행하여 API Error를 유발할수 있습니다. (돈이 없는데 결제를 계속 한다던지? / 중복로그인을 계속한던지? 등등 )

...

  • 테스트 스크립트 안정화에 많은 시간을 소요하게됩니다.

  • 구축완료후 검증단계에서 실서비스 부하문제를 찾지못함(시나리오 실패)

  • 관련 개발 리소스가 생각보다 많이 투입됨

  • QA프로세스가 안잡힌 상태에서 먼저 수행하기 어려움이 있음

  • 모니터링툴이 구축이 선행됨

로드테스트는 개발보다 더많은 개발공정및 QA공정이 들어갈수 있으며 생각보다 고되고 당장 효과가 나는 만만한 작업이 아닙니다.

여러가지 리스크가 있음에도 ,한번 구축이되면 재사용되어 운영 사이트 안정화에 도움이되는것을 기대할수 있으며, 그 과정에서 운영안정화로 바로 이어지지 않더라도,

...