https://discord.cloudflare.com logo
Join Discord
Powered by
# durable-objects
  • e

    Erwin

    08/13/2021, 5:46 AM
    What do you mean work with Workers Sites?
  • b

    berkant

    08/13/2021, 6:42 AM
    Is there a way to know the latency between the edge PoP serving user requests and the DO colo?
  • e

    Erwin

    08/13/2021, 7:27 AM
    Sort of roughly yes, you can do a
    Copy code
    const start = Date.now()
    const response = await stub.fetch(request)
    const durationMs = Date.now() - start
  • e

    Erwin

    08/13/2021, 7:28 AM
    It isn't perfect, because the Date.now() isn't measured from that point, but the last time there was any IO.. so it won't be accurate to the millisecond, but it should give you an order of magnitude measurement.
  • e

    Erwin

    08/13/2021, 7:29 AM
    Also note that that latency is very sensitive to where the user Worker is. Right now the DO coverage is less than ideal in places like South America and Australia
  • f

    Fuglen

    08/13/2021, 8:24 AM
    Lucky for me I'm not a big streamer, there would be around 10 people in chat so that shouldnt be any issue 😄 Also, thanks for telling me what you know!
  • g

    Greg Brimble | Cloudflare Pages

    08/13/2021, 10:14 AM
    Not quite yet, I don't think. @User maybe knows a bit more, but this issue (https://github.com/cloudflare/kv-asset-handler/issues/174) and open PR (https://github.com/cloudflare/kv-asset-handler/pull/200) suggest that Workers Sites aren't yet possible (at least without some hacks) with the ES Modules format (which is required for Durable Objects). (Sorry for all the parenthesis)
  • g

    Greg Brimble | Cloudflare Pages

    08/13/2021, 10:14 AM
    cc. @User
  • e

    Erwin

    08/13/2021, 10:22 AM
    Ah cheers @User.. There is also little priority to put a lot of work into Worker sites (pun intended).. as Pages is the way forward for those..
  • v

    vladone

    08/13/2021, 10:43 AM
    Does anyone have an issue using DOs + WS where the WS is not connecting for a while?
  • v

    vladone

    08/13/2021, 10:44 AM
    Im experiencing this and it's very random... Having many objects and some of them are connecting and others don't. In my case the objects are some "live rankings" for different games
  • i

    ItsWendell

    08/13/2021, 10:57 AM
    How do you have it setup?
  • v

    vladone

    08/13/2021, 11:09 AM
    It's basically a fork of this https://github.com/cloudflare/workers-chat-demo so the structure is somewhat similar.
  • v

    vladone

    08/13/2021, 11:10 AM
    It creates different 'rooms' (tournaments in our case), stores real-time scores and send back the leaderboard to the users.
  • v

    vladone

    08/13/2021, 11:13 AM
    But sometimes, on some tournaments the WS it's not connecting for a while. As you can see here https://d.pr/v/OxquK6 (took ~2 minutes to connect then it gets back to normal, connecting immediately). I was thinking that maybe we hit a limit or something, but idk
  • i

    ItsWendell

    08/13/2021, 12:38 PM
    You could try setting up some kind of ping system from your DO to the client where you ping the sockets every x seconds, I personally haven't experienced this I am also building a similar project that's a little bit more advanced than workers chat demo.
  • j

    James

    08/13/2021, 1:31 PM
    Yeah, it’s a bit confusing right now. I personally think the best idea is to wait for ESM and DO to leave beta, and then release a new version of kv-asset-handler with breaking changes, and a new API for ESM. Maybe a version with support for both in the interim, but either way https://github.com/cloudflare/wrangler/issues/1938 will need to be resolved first.
  • j

    James

    08/13/2021, 1:33 PM
    I love Pages, but there’s definitely still a valid use case for Sites imo, and anyone doing anything complex with workers and assets.
  • e

    Erwin

    08/13/2021, 1:48 PM
    Oh .. I completely agree that that is currently still the case @User. But it is certainly in our vision to allow integration of workers and Pages..
  • j

    James

    08/13/2021, 1:49 PM
    For sure 🙂 I’d love to see Pages support the same kind of customisability of Sites eventually!
  • j

    john.spurlock

    08/13/2021, 2:55 PM
    I keep looking at the cloudflare analytics graphql endpoint to see if any DO-related datasets show up - it would be great to surface billable DO units (read/write/delete/total storage) in one or more new datasets (available to all account levels like the other workers* datasets)
  • t

    Till

    08/13/2021, 3:06 PM
    What’s the difference between Pages and Sites?
  • h

    HardAtWork

    08/13/2021, 3:11 PM
    Both are built on Workers, but Sites allows you to access the Worker itself, while Pages uses a custom Worker that makes it simpler and easier to just deploy and go.
  • f

    figgyc

    08/13/2021, 3:20 PM
    the main difference from a usage perspective is the pricing 😛
  • t

    Till

    08/13/2021, 3:24 PM
    I’m probably using Sites then, not Pages.
  • t

    Till

    08/13/2021, 3:24 PM
    Is there a repo for the Pages worker?
  • t

    Till

    08/13/2021, 3:24 PM
    Thanks for these!
  • h

    HardAtWork

    08/13/2021, 3:41 PM
    The Pages worker is internal, and thus we don't have access to it.
  • k

    kenton

    08/13/2021, 4:39 PM
    Cloudflare Pages is really about the github integration and turnkey workflow. Workers Sites is more like a DIY kit that you can customize, but you need to set up the workflow yourself.
  • i

    ItsWendell

    08/13/2021, 4:54 PM
    Can you share more about these internal performance tests?
1...150151152...567Latest