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

    kian

    03/03/2023, 9:43 AM
    Either way, that'd get a 522 error rather than a 404 iirc
  • d

    dale

    03/03/2023, 9:45 AM
    Custom routes. Ok good to know
  • d

    dale

    03/03/2023, 9:46 AM
    I will look for a solution elsewere then
  • s

    Skye

    03/03/2023, 9:46 AM
    There is not, this server isn't for job postings, sorry
  • h

    hazcod

    03/03/2023, 9:48 AM
    Too bad, all the right people are here.
  • h

    HardAtWork

    03/03/2023, 11:11 AM
    Could the service you are `fetch`ing be region-locked? The Cron Worker might run in a different datacenter than where your regular HTTP-triggered Workers requests run.
  • k

    Kavatch

    03/03/2023, 11:33 AM
    How do workers perform when it comes to CPU heavy tasks? Like I want to encode a GIF which takes around 10 sec on my local PC, but when I run it on a Server with quite a good CPU it get it down to ~2 seconds. If I now ran it inside a worker, would I rather see an increase in time for encoding, or a drop-off in time required?
  • s

    Skye

    03/03/2023, 11:34 AM
    I wouldn't expect you to see better performance in a worker for a task like that
  • s

    Skye

    03/03/2023, 11:35 AM
    Mostly just because I doubt there's a JavaScript library which performs remotely near native performance
  • k

    Kavatch

    03/03/2023, 11:35 AM
    I am using Rust, if that makes any difference
  • h

    HardAtWork

    03/03/2023, 11:43 AM
    WebAssembly takes a heavy initial hit, because you have to translate your JS objects into ArrayBuffers to pass in. Should perform fine though.
  • k

    Kavatch

    03/03/2023, 11:48 AM
    My main concern is just that I might hit the 30 sec timeout limit (for HTTP requests) if the encoding is slower on workers than on my PC, for example. And since I am unable to find any concrete numbers on the CPU performance on the website, my best bet was that maybe here someone knows if how they perform on that type of task or even has some experiences with that kind of workers.
  • j

    Jadugar_Jaggu

    03/03/2023, 11:50 AM
    Use cron triggers (hourly setting) to increase time limit
  • h

    HardAtWork

    03/03/2023, 11:50 AM
    As an example of what Workers+WASM can do, you can check out https://og-playground.vercel.app/. In general, CF won't provide direct CF metrics, but I would say, for light/moderate loads, go with Workers+WASM, for heavy+ loads, go with something like https://fly.io
  • j

    Jadugar_Jaggu

    03/03/2023, 11:52 AM
    I use a task that takes 10 to 12 minutes using a worker. I just do it once an hour using cron triggers and KV
  • h

    HardAtWork

    03/03/2023, 11:54 AM
    The issue is the CPU Time. AFAIK, you still only get 30 seconds of CPU with Cron Triggers.
  • h

    HardAtWork

    03/03/2023, 11:55 AM
    NVM
  • k

    Kavatch

    03/03/2023, 11:55 AM
    I will have a look at these sites , thank you!
  • h

    HardAtWork

    03/03/2023, 11:55 AM
    I read the wrong section
  • j

    Jadugar_Jaggu

    03/03/2023, 11:55 AM
    he is asking for http request timeout
  • j

    Jadugar_Jaggu

    03/03/2023, 11:55 AM
    not cpu
  • h

    HardAtWork

    03/03/2023, 11:55 AM
    Yeah, misread, sorry!
  • k

    Kavatch

    03/03/2023, 11:57 AM
    In general a good Idea however since I want to encode "on demand" I probably can't use cron jobs since I want to do it every time a user calls an endpoint. Thanks though!
  • j

    Jadugar_Jaggu

    03/03/2023, 12:01 PM
    If you want to do it on demand you can give a try to Queue. Cause in it consumer worker also support waitUntil() like cron I am not that sure but you can try it
  • j

    Jadugar_Jaggu

    03/03/2023, 12:03 PM
    Just need to set the value of Message batch size to 1
  • n

    Nicolaas

    03/03/2023, 12:42 PM
    Hi guys, is there any way to use a worker to make sure that requests going to our api's come from cloudflare only? We basically want to validate all incoming requests and make sure that Cloudflare was not bypassed. Was thinking of adding a secret header. Potentially encrypt a value in the worker and decrypt and validate using middleware on our api's.
  • h

    HardAtWork

    03/03/2023, 12:44 PM
    You can use a CF Tunnel for that? Then you don't need to open any ports either.
  • h

    HardAtWork

    03/03/2023, 12:44 PM
    For extra security, you can verify an Access JWT too.
  • d

    Dani Foldi

    03/03/2023, 1:10 PM
    You can also check out the new mTLS binding?
  • n

    Nicolaas

    03/03/2023, 1:12 PM
    Thanks guys. I will investigate these options
1...231523162317...2509Latest