Locust 성능테스트 (feat. K8S)

IT/EKS 2023. 5. 24. 16:33
반응형

기본적으로 부하테스트의 기본 카테고리는 성능테스트로 진입한댜

 

성능테스트 하위 단위로는 다음과 같댜

> LoadTest : 물량. 점진적인 것이고, 스케일링 테스트에 주로 사용

>StressTest : 스파이크 테스트. 일시적으로 한순간에 대량의 트래픽을 순간 쏟아넣음.

>EnduranceTest : 고가용성 테스트. 이것저것 중간에 한두대 빼고 죽이고 다운시키고 드르드르등등등

 

로커스트를 주력으로 사용하는데, 옵션 찾기가 힘들어서 헤매다가 다음과 같은 옵션을 찾았댜

 

- 유저 하나가, 1초에 몇 RPS까지 줄것인갸? (로커스트 단어로, task 데코레이터를 1초에 몇번 실행할 것인가)

> constant_throughput

class MyUser(User):
    wait_time = constant_throughput(0.1)
    @task
    def my_task(self):
        time.sleep(random.random())

.. 1초에 0.1번 태스크를 수행. 즉, 10초에 1번 수행

- 유저 하나가, 몇 초당 1 RPS를 줄 것인갸?

> constant_pacing

class MyUser(User):
    wait_time = constant_pacing(10)
    @task
    def my_task(self):
        time.sleep(random.random())

.. 10초에 한번 수행

 

자세한건 로커스트 스크립트 API 공식문서 참조하셈.

다음에는 성능테스트 관련 정리 글좀 올리겠음

https://docs.locust.io/en/stable/api.html

 

API — Locust 2.15.1 documentation

Response class This class actually resides in the python-requests library, since that’s what Locust is using to make HTTP requests, but it’s included in the API docs for locust since it’s so central when writing locust load tests. You can also look a

docs.locust.io

 

 

반응형

'IT > EKS' 카테고리의 다른 글

쿠버네티스 nginx 인그레스 http 바디 크기  (0) 2023.06.07
AWS 오픈서치 관련 내역 정리  (0) 2023.05.31
로커스트 후기  (0) 2022.12.27
아르고CD AD연동 과정  (0) 2022.11.24
EKS /var/log/containers 로그포맷  (0) 2022.11.08

설정

트랙백

댓글