https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • k

    kian

    02/21/2023, 10:00 PM
    There is a startup time limit so I guess so - but I have no idea on the exacts
  • k

    kian

    02/21/2023, 10:00 PM
    I don’t think that’d be apart of billing personally
  • t

    Tom Sherman

    02/21/2023, 10:24 PM
    Ah, of course
  • s

    silentdevnull

    02/22/2023, 12:33 AM
    I have worked with a custom dns name in cloudflare. I need setup that name on a interial dns server. Can I just use CNAME as I do with pages or do I need to it a different way.
  • k

    killerlearner

    02/22/2023, 4:13 AM
    Hi everyone, anyone know how can I write anyemail in cloudflare email workers like when recieving email from any@email do the given thing
  • u

    Unsmart | Tech debt

    02/22/2023, 4:24 AM
    I'm not sure what you mean 🤔
  • b

    botato

    02/22/2023, 4:40 AM
    do you mean forwarding emails?
  • b

    botato

    02/22/2023, 4:40 AM
    oop this discussion is happening in #930503753583435836
  • i

    ID4933

    02/22/2023, 7:34 AM
    Hello
  • s

    sathoro

    02/22/2023, 10:31 AM
    I am getting some surprising latency with KV and DO. I've got an API route that uses KV to get a cached result and then DO to lookup a value based on that key. a single KV get and DO fetch (which is just getting a few values from storage and converting to JSON) is adding 200-800ms of latency and sometimes over a second when it is the first request to the KV key. does this sound right? when I make a request to the worker for a blank response the latency is only about 40ms so it is the KV and DO adding the latency. I'm in Asia - maybe the KV and/or DO data is just not stored nearby?
  • h

    HardAtWork

    02/22/2023, 10:36 AM
    KV Core is NorthAmerica/Europe, so yeah, that might be it.
  • s

    sathoro

    02/22/2023, 10:36 AM
    after the first read it should be cached somewhere closer by though right? or is that only if it is a really high traffic key?
  • h

    HardAtWork

    02/22/2023, 10:37 AM
    It should be cached within the datacenter, at least for a few seconds.
  • s

    sathoro

    02/22/2023, 10:38 AM
    hmm even after reading right after another read the latency is still higher than I was expecting
  • s

    sathoro

    02/22/2023, 10:39 AM
    a single DO fetch seems to be adding around 150ms latency at a minimum
  • h

    HardAtWork

    02/22/2023, 10:39 AM
    Try using a
    console.log(Date.now())
    before and after the DO call. The DO might just be extremely far away
  • s

    sathoro

    02/22/2023, 10:39 AM
    this doesn't work on Workers does it?
  • h

    HardAtWork

    02/22/2023, 10:39 AM
    Also try checking where the DO is
  • s

    sathoro

    02/22/2023, 10:39 AM
    oh how to do that?
  • h

    HardAtWork

    02/22/2023, 10:39 AM
    It does update when you run I/O(i.e. calling a DO).
  • s

    sathoro

    02/22/2023, 10:39 AM
    ahhh yes forgot that detail
  • h

    HardAtWork

    02/22/2023, 10:40 AM
    Here's an example:
    Copy code
    js
    export class DO {
      async fetch() {
        return new Response(
          ((
            await (await fetch("https://www.cloudflare.com/cdn-cgi/trace")).text()
          ).match(/^colo=(.+)/m) as string[])[1],
        );
      }
    }
    - https://github.com/helloimalastair/where-durableobjects-live/blob/main/src/DO.ts
  • s

    sathoro

    02/22/2023, 10:43 AM
    Copy code
    {
      "message": [
        "BEFORE KV",
        1677062581532
      ],
      "level": "log",
      "timestamp": 1677062581532
    },
    {
      "message": [
        "AFTER KV",
        1677062582899
      ],
      "level": "log",
      "timestamp": 1677062582899
    },
    {
      "message": [
        "BEFORE DO",
        1677062582915
      ],
      "level": "log",
      "timestamp": 1677062582915
    },
    {
      "message": [
        "AFTER DO",
        1677062582927
      ],
      "level": "log",
      "timestamp": 1677062582927
    }
  • s

    sathoro

    02/22/2023, 10:44 AM
    KV latency wtf
  • s

    sathoro

    02/22/2023, 10:47 AM
    I think I will just convert this to a DO. I thought this would be a good use case for KV since it is super simple
  • s

    sathoro

    02/22/2023, 10:47 AM
    looking at the logs the DO latency seems fine
  • s

    sathoro

    02/22/2023, 10:48 AM
    the KV latency is anywhere from 20ms to 2 seconds
  • s

    sathoro

    02/22/2023, 10:48 AM
    for the same key
  • u

    0xblackbird

    02/22/2023, 10:53 AM
    Hi, quick question, has anyone tried to run a kubernetes client (like
    @kubernetes/client-node
    ) on workers? I seem to get a lot of polyfill errors with webpack 🤔
  • k

    kian

    02/22/2023, 10:56 AM
    I don't think that package will work until (at a minimum) it uses Fetch - which they haven't done yet (https://github.com/kubernetes-client/javascript/blob/HEAD/FETCH_MIGRATION.md)
1...229622972298...2509Latest