본문 바로가기

좋아하는 것_매직IT/96.IT 핫이슈

cloudflare가 nginx를 걷어내고 Rust로 HTTP Proxy(Pingora)를 만들어서 사용을 소개합니다 (blog.cloudflare.com)

반응형

cloudflare가 nginx를 걷어내고 Rust로 HTTP Proxy(Pingora)를 만들어서 사용을 소개합니다

웹페이지에서는 아래와 같이 소개하고 있군요..
Introduction
Today we are excited to talk about Pingora, a new HTTP proxy we’ve built in-house using Rust that serves over 1 trillion requests a day, boosts our performance, and enables many new features for Cloudflare customers, all while requiring only a third of the CPU and memory resources of our previous proxy infrastructure.

As Cloudflare has scaled we’ve outgrown NGINX. It was great for many years, but over time its limitations at our scale meant building something new made sense. We could no longer get the performance we needed nor did NGINX have the features we needed for our very complex environment.

Many Cloudflare customers and users use the Cloudflare global network as a proxy between HTTP clients (such as web browsers, apps, IoT devices and more) and servers. In the past, we’ve talked a lot about how browsers and other user agents connect to our network, and we’ve developed a lot of technology and implemented new protocols (see QUIC and optimizations for http2) to make this leg of the connection more efficient.

한마디로 정리하자면, cloudflare가 nginx를 걷어내고 Rust로 HTTP Proxy(Pingora)를 만들어서 사용한다는 내용이고요..

아래는 간단한 특징에 대해서 정리한 내용이고요..

nginx는 한계가 있었음

  • 매 요청에 대해 단일 worker만 사용하므로 cpu core 사용 불균형이 존재함
  • worker당 connection pool이 존재하기 때문에 TCP 및 TLS 커넥션 연결 재활용율이 나쁨 -> TTFB가 높아짐
  • 또한 nginx를 운영하는데 필요한 기능들을 자체 구현하고 있었는데 C로 설계된 nginx는 memory-safe하지 않아서 숙련된 엔지니어도 실수를 하곤 했음

Pingora

  • Cloudflare는 비 RFC 규격의 요청도 많이 받고 있는데 타사 라이브러리(hyper)는 RFC에 엄격한 상태로 구현되어있어서 확장하려면 추가 공수가 들어가기에 자체 구축
  • Rust는 성능 저하 없이 memory safe한 방식으로 C가 할 수 있는 일을 대체 가능해서 선택
  • 연결 풀을 쉽게 공유하기 위해 work-stealing 방식의 스케줄링 시스템을 도입했고, 재사용률이 증가함. 이전에 비해서 초당 1/3 수준의 커넥션을 맺음
  • 이전에 비해서 CPU는 70%, 메모리는 67% 적게 사용함
  • 추후 오픈소스로 공개 예정

자세한 내용은 아래 웹페이지 방문을 추천드립니다. 

오늘의 블로그는 여기까지고요..
항상믿고 봐주셔서 감사합니다. 

728x90
300x250