Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load-test #6

Merged
merged 2 commits into from
Feb 20, 2024
Merged

load-test #6

merged 2 commits into from
Feb 20, 2024

Conversation

INAUGURATE-Ryong
Copy link
Owner

  • compose.yml 수정하면서 오류 줄이기.

- [ ] compose.yml 수정하면서 오류 줄이기.
@INAUGURATE-Ryong
Copy link
Owner Author

Test

  • docker stats 와 htop , nginx를 참고하여 테스트 진행
### stats.sh 생성
$ cat docker-stats.sh
#!/bin/bash

now=$(date +'%d_%b_%Y_%H_%M')

while true; do
  printf "\n$(date +'%d_%b_%Y_%H_%M_%S'):\n" | tee --append stats_$now.txt
  sudo docker stats --no-stream | tee --append stats_$now.txt
  sleep 1
done

nginx 실행

$ pwd /home/jsmin630/app/ng/ngrinder-agent 
$ ./run_agent.sh

$ pwd /home/jsmin630/app/ng/controller 
$ java -jar ngrinder-controller-3.5.8.war

테스트 시나리오 설정

image

@Test
public void test() {
    HTTPResponse response = request.GET("http://aws.google.com:9889/", params)

    if (response.statusCode == 301 || response.statusCode == 302) {
        grinder.logger.warn("Warning. The response may not be correct. The response code was {}.", response.statusCode)
    } else {
        assertThat(response.statusCode, is(200))
    }
    
    grinder.sleep(1000)
}

@INAUGURATE-Ryong
Copy link
Owner Author

INAUGURATE-Ryong commented Feb 19, 2024

case1

  • 별다른 조건 변경 없이 TEST 진행 시 6분동안 부하로 인해 서버가 죽지 않고 TEST 완료
deploy: resources: (limits: cpus: '0.10' /memory: 50M)
        reservations: (cpus: '0.05' / memory: 20M)
limits: (cpus: '0.05' /memory: 50M)      
        reservations: (cpus: '0.01'/memory: 20M)

image

@INAUGURATE-Ryong
Copy link
Owner Author

INAUGURATE-Ryong commented Feb 19, 2024

case2

  • case1에서 TEST가 잘 통과되어 docker stats를 확인해보니 메모리가 40이상 까지 올라가는 것을 확인
  • 일부로 TEST실패를 하기 위해 limits memory를 40M로 다운
  • 성공적으로 TEST실패를 함.
  • limits memory를 40M를 유지한 채 TEST성공을 하기 위해 다른 값 조정 예정
deploy: resources: (limits: cpus: '0.10' /memory: 40M)
        reservations: (cpus: '0.05' / memory: 20M)
limits: (cpus: '0.05' /memory: 40M)      
        reservations: (cpus: '0.01'/memory: 20M)

image

@INAUGURATE-Ryong
Copy link
Owner Author

INAUGURATE-Ryong commented Feb 19, 2024

case3

  • limits memory를 40M 고정에 CPU 조정으로 부하TEST통과하기.
  • test를 버티지 못타고 서버가 다운.
deploy: resources: (limits: cpus: '0.25' /memory: 40M)
        reservations: (cpus: '0.25' / memory: 20M)
limits: (cpus: '0.10' /memory: 40M)      
        reservations: (cpus: '0.01'/memory: 20M)

image

@INAUGURATE-Ryong
Copy link
Owner Author

case4

  • 역으로 CPU를 낮춰서 TEST진행하려 했으나 자꾸 nginx가 떠서 TEST불가..
$ sudo docker compose -f compose.yml down
$ sudo docker compose -f compose.yml up -d --build --force-recreate
로 진행하면.  자꾸 nginx가 뜸....
deploy: resources: (limits: cpus: '0.05' /memory: 40M)
        reservations: (cpus: '0.01' / memory: 20M)
limits: (cpus: '0.02' /memory: 40M)      
        reservations: (cpus: '0.01'/memory: 20M)

@INAUGURATE-Ryong
Copy link
Owner Author

다시 nginx지옥에 빠져.. TEST는 더이상 진행 불가..

@INAUGURATE-Ryong INAUGURATE-Ryong added the bug Something isn't working label Feb 19, 2024
@INAUGURATE-Ryong INAUGURATE-Ryong self-assigned this Feb 19, 2024
@INAUGURATE-Ryong INAUGURATE-Ryong merged commit 8260191 into main Feb 20, 2024
@INAUGURATE-Ryong INAUGURATE-Ryong deleted the 240219.2/load-test branch February 20, 2024 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant