How Cloudflare Workers Achieve 0ms Cold Starts

Поделиться
HTML-код
  • Опубликовано: 24 янв 2025

Комментарии • 15

  • @h4ckedneko
    @h4ckedneko 10 месяцев назад +6

    When a worker (isolate) spins up it is actually not 0ms but in the range of 0.1 to 9ms depending on your worker and the server hardware it runs on. The true reason how they achieve 0ms is because your worker spins up during TLS handshake, instead of when HTTP request was received. The handshake will take some time and by the time it finishes, your worker is already started making it 0ms cold start.

  • @xiaohu8149
    @xiaohu8149 Год назад +2

    Hi Red, this one is good. Now I know which one to choose. Many thanks. By the way, is there any special settings to use isolate, or at the fundamental design Cloudflare has done all for us?

    • @RedhwanNacef
      @RedhwanNacef  Год назад

      Thanks. This is just the design that Cloudflare (and other providers) has, so no extra steps on your end.

  • @BrutalTurtle
    @BrutalTurtle 3 года назад +1

    Nice one Red!

  • @mikebradbury3997
    @mikebradbury3997 3 года назад

    Hi Red, just found your channel (via the Pulumi video). Thanks for making this content, i'm learning lots! Curious as to what desk mat you have?

    • @RedhwanNacef
      @RedhwanNacef  3 года назад +1

      Welcome! Glad you're enjoying some of the content :) It's the "TECKNET Extended Gaming Mouse Pad XXL", you can find it on amazon. Great value for the price.

  • @gabrielrezende9102
    @gabrielrezende9102 11 месяцев назад

    Thank you

  • @Tech_Advisor_to_CXOs
    @Tech_Advisor_to_CXOs Год назад

    Does Cloudflare spin up a new isolate for every request?

    • @RedhwanNacef
      @RedhwanNacef  Год назад +1

      Good question, although most of the time a new Isolate is created I don't think that is guaranteed. I think it is possible for an Isolate to be reused.

    • @Tech_Advisor_to_CXOs
      @Tech_Advisor_to_CXOs Год назад

      @@RedhwanNacef Thanks, the reason I asked is that this creates a problem of state from the previous invocation leaking through, creating more cognitive overhead for the engineer to take care. If isolates are so fast to create, perhaps Cloudflare should create a new one every time to simplify developers' lives.

    • @RedhwanNacef
      @RedhwanNacef  Год назад

      @@Tech_Advisor_to_CXOs I'm not sure of the specifics, but this sounds like something like the Cloudflare team would have figured out! I think from the engineer side its safe to make the assumption that every request is stateless, hopefully meaning no overhead.

    • @Tech_Advisor_to_CXOs
      @Tech_Advisor_to_CXOs Год назад

      @@RedhwanNacef This contradicts your earlier message - if the isolate is reused, engineers have to be careful that state in global variables doesn't leak.

  • @manmaaze
    @manmaaze Год назад +1

    This was COOL