Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Improving Adserver

Avatar for Buzzvil Buzzvil
April 21, 2021

Improving Adserver

By Claud

Avatar for Buzzvil

Buzzvil

April 21, 2021
Tweet

More Decks by Buzzvil

Other Decks in Programming

Transcript

  1. Drone migration • AS-IS ◦ Node / Python lint, Python

    test → Jenkins CI ◦ Python type check / formatting → Drone CI • TO-BE ◦ Only use Drone CI
  2. Problems • We have dependencies ◦ Do we need databases

    per worker? ◦ No we just need table/indices per worker table pytest gw1_table w1 gw2_table w2 gw3_table w3
  3. Problems • We have dependencies ◦ Do we need databases

    per worker? ◦ No we just need table/indices per worker
  4. Failing test cases • Unexpected external dependency ◦ 테스트 도중

    생성된 file log를 test case에서 사용하고 있음 ◦ Click log가 json file에 잘 남는지 확인하는 테스트
  5. Failing test cases • Fragile test cases ◦ Autoincrement id를

    특정 값으로 가정하여 테스트케이스를 작성한 경우 ◦ 존재하지 않는 데이터의 id만 사용하는 경우 ▪ e.g. 실제 unit 생성 없이 unit_id=1만 사용
  6. Problems • Flaky builds ◦ 같은 테스트라도 간헐적으로 실패하는 경우가

    발생함 ◦ Dependent service에 대한 요청 실패로 발생 • Performance degradation ◦ 갑자기 CI 수행시간이 매우 길어지거나 아예 동작하지 않는 경우가 발생함 ◦ 동시에 수행되고 있는 CI 워크로드가 많은 경우에 발생
  7. DynamoDB timeout • 간헐적으로 local dynamodb로 보내는 요청이 timeout되어 테스트가

    실패함 • 테스트 시 dynamodb 요청이 실패하면 retry하도록 하여 해결 ◦ pytest-xdist로 인해 ddb 서비스에 동시에 많은 요청이 들어오는 경우 throttle되는 이슈로 생각됨
  8. • Drone server ◦ Receive webhook from github ◦ Send

    status to github • Drone runner ◦ Poll server for pipelines to execute ◦ Execute workloads Drone CI Drone server Drone runner Webhook Status Result Poll Run workloads k8s-screen
  9. Drone kubernetes runner • Drone pipeline이 하나의 pod이 대응되고 step별로

    container가 생성됨 ◦ Note: A pod is the smallest execution unit in Kubernetes Pipeline step step step step Pod container container container container
  10. Kubernetes pod scheduling • 클러스터에서 pod이 필요로 하는 리소스가 충분한

    노드에 스케줄링됨 • Resource request/limit ◦ request: pod 생성 시 필요로 하는 리소스 ◦ limit: pod이 최대로 사용할 수있는 리소스. 넘어가면 throttle되거나 OOMKilled Node requests: memory: 1Gi / 4Gi Node requests: memory: 3.5Gi / 4Gi Pod requests: memory: 1Gi limits: memory: 2Gi
  11. Cluster autoscaler not working • Drone이 올라가 있는 클러스터의 autoscaler가

    동작하지 않았음 ◦ cluster autoscaling: 필요한 리소스에 따라 워커 노드의 수를 자동으로 조절함 • Drone job이 여러 개 도는 경우 리소스 부족으로 스케줄링 안됨
  12. Drone resource request • Step에 정의한 resource request 가 동작하지

    않는 것 확인 ◦ request가 항상 1로 생성됨 ◦ 일부 노드에 heavy한 job이 계속해서 스케줄링 되는 현상 발생