피드로 돌아가기
Why your scraper plateaus at 5-6 concurrent Chrome instances (and the shared-cookie trap nobody names)
Dev.toDev.to
Infrastructure

Profile Isolation을 통한 CF Challenge 우회 및 처리량 8배 향상

Why your scraper plateaus at 5-6 concurrent Chrome instances (and the shared-cookie trap nobody names)

Double CHEN2026년 4월 23일4intermediate

Context

단일 Chrome 인스턴스 내 Multi-tab 방식 사용 시 document.visibilityState 체크와 cf_clearance Cookie 경쟁으로 인한 Turnstile 로드 실패 발생. 이로 인해 1 Browser per Page 구조를 강제하게 되며, Proof-of-Work 연산으로 인한 CPU Bound 병목으로 동시 실행 수가 5-6개로 제한되는 한계 직면.

Technical Solution

  • Profile Isolation 설계를 통한 Browser Profile별 독립적인 Cookie 및 Storage 저장소 분리
  • Pre-warming 전략을 도입하여 20개의 Profile에 대해 CF Challenge를 사전 해결하고 cf_clearance Cookie를 캐싱
  • 요청 시 만료되지 않은 유효 Cookie를 보유한 Profile을 매칭하여 10초 내외의 Proof-of-Work 연산 과정 제거
  • Background Re-warming 프로세스를 구축하여 만료된 Profile의 Clearance를 비동기적으로 갱신
  • Bottleneck을 CPU 연산 중심에서 Network Latency 중심으로 전이시켜 동시 요청 처리 가능 수 확대

- Multi-tab 환경에서 Shared Cookie로 인한 Race Condition 발생 여부 확인 - CPU Bound 병목 발생 시 각 프로세스의 런타임 프로파일링을 통해 실제 연산 비용 유발 지점 식별 - 인증 토큰이나 Clearance Cookie의 유효 기간을 활용한 Pre-warm Pool 설계 검토 - 단일 머신 임계치 초과 시 IP-bound 특성을 고려한 분산 인스턴스 확장 전략 수립

원문 읽기