Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Cheap CDN with long origin timeout (180-200 seconds)
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Cheap CDN with long origin timeout (180-200 seconds)

bulbasaurbulbasaur Member
edited June 2021 in General

For a product that I'm working on, customers expect to make a single HTTP request and wait for as long as it would take for the result to be produced (typically ~160-180 seconds).

Since this product is hosted on one of the "big three" clouds, I'm hoping to reduce outbound data costs by caching repeated requests on a CDN. Of course, this CDN would need to support a timeout of 180 seconds or more.

My search only turned up CloudFront, which is hell of a expensive service ($0.0085/GB at the cheapest tier), and Cloudflare, which requires that I spend a four figure sum with them for this feature.

If this were a VPS I'd look into nginx caching, but I'm trying to save money and thus, caching it on the server instances of the "big three" would end up costing me the same data transfer pricing for every request.

Are there any alternatives to what I'm looking for?

Comments

  • Bunny CDN (Bunny.net)

  • What kind of request need 180-200 secs?

    I doubt most CDN provider would allow. Max timeout for most will be within 30-60 secs.

  • deankdeank Member, Troll

    That's an insane request. 170 sec time out count?

  • cloudflare is free.

  • @Hotmarer said: Bunny CDN (Bunny.net)

    Thanks, do they allow for 180-200 seconds timeout? I couldn't find anything on their public documentation.

    @mrclown said: What kind of request need 180-200 secs?
    @deank said: That's an insane request. 170 sec time out count?

    I'd love to ask the customers to use a polling or event driven architecture, but I can't. They expect to keep a HTTP request open to the service and wait until the data is ready to be served.

    @saosangmo said: cloudflare is free.

    Cloudflare is free and allows upto 100 seconds, anything beyond that and you need to pay up for the four figure amount, which I don't have.

  • I think hosting it on a VPS besides the big three are the only option.. Much more flexibility & customization.. Have you considered this?

  • skorupionskorupion Member, Host Rep

    @stevewatson301 said: Thanks, do they allow for 180-200 seconds timeout? I couldn't find anything on their public documentation.

    @BunnySpeed

  • visualwebtechnologiesvisualwebtechnologies Member, Host Rep

    Bunny CDN or cloudflare

  • Daniel15Daniel15 Veteran
    edited June 2021

    What about using a push CDN rather than a pull CDN? Your origin can take as long as it wants then, as it pushes the data to the CDN rather than the CDN pulling it. Doesn't work in all scenarios, but it's worth considering.

    @saosangmo said:
    cloudflare is free.

    Cloudflare's maximum timeout on free accounts is 100 seconds for the entire request, and 15 seconds for the HTTP handshake. Paid accounts can increase it to 600 seconds, so a paid Cloudflare account might be an option here.

  • bulbasaurbulbasaur Member
    edited June 2021

    @Daniel15 said: What about using a push CDN rather than a pull CDN?

    These requests are dynamic (imagine something like being asked to fetch a large data source and process it immediately), so push can't help. I'd really love if the customers were accommodating, but you know how customers are :/

    @Daniel15 said: Paid accounts can increase it to 600 seconds, so a paid Cloudflare account might be an option here.

    Is it any paid account? $20 for their business plan doesn't seem so bad, and Google cloud has some discounted rates if I transfer data to Cloudflare POPs, so that would be nice.

  • Daniel15Daniel15 Veteran
    edited June 2021

    @stevewatson301 said: Is it any paid account?

    Not sure, as I've only dealt with complimentary enterprise accounts (for popular open-source projects) where we have access to some (but not all) enterprise features for free.

    The docs at https://support.cloudflare.com/hc/en-us/articles/115003011431#524error say "Enterprise customers can increase the 524 timeout up to 600 seconds" so unfortunately you might be out of luck on their non-enterprise plans.

    IMO give their sales team a call (or use their live chat) and see if they can do a custom paid plan that's essentially just the free or plus plan with an increased timeout.

  • I use Bunny, and it times out at 60 sec. I guess you'll have to use the site without CDN.

  • omelasomelas Member
    edited June 2021

    how about put a reverse proxy server in front of client it and reply 307 redirect when proxy found it has cached responses in cdn?

  • hzrhzr Member

    @stevewatson301 said: These requests are dynamic (imagine something like being asked to fetch a large data source and process it immediately), so push can't help. I'd really love if the customers were accommodating, but you know how customers are :/

    do they chunk? can you send bytes slowly at a time?

  • @hzr said: do they chunk? can you send bytes slowly at a time?

    I've used that trick in another project of mine. In this case, I can't, since the data is highly interdependent.

    @nanankcornering said: I think hosting it on a VPS besides the big three are the only option.. Much more flexibility & customization.. Have you considered this?

    Yeah, since I'm looking for an unicorn, that's probably the route I'm going to go down.

  • hzrhzr Member

    @stevewatson301 said: I've used that trick in another project of mine. In this case, I can't, since the data is highly interdependent.

    was thinking continually send newlines or null bytes until your data finished processing

  • @Daniel15 said: Cloudflare's maximum timeout on free accounts is 100 seconds for the entire request, and 15 seconds for the HTTP handshake. Paid accounts can increase it to 600 seconds, so a paid Cloudflare account might be an option here.

    I guess 100 seconds is the maximum time until the response headers are sent out - or at least, Cloudflare doesn't seem to have a set timeout for the response body transferred in chunked encoding. I have a hobby project on a free Cloudflare account that utilizes server-sent events, and the longest request last week survived 24.5 hours.

    However, their manual says in https://support.cloudflare.com/hc/en-us/articles/115003011431-Troubleshooting-Cloudflare-5XX-errors:

    If you regularly run HTTP requests that take over 100 seconds to complete (for example large data exports), move those processes behind a subdomain not proxied (grey clouded) in the Cloudflare DNS app.

    So I guess it's not something you can rely on.

  • yoursunnyyoursunny Member, IPv6 Advocate

    @udonworld said:
    I guess 100 seconds is the maximum time until the response headers are sent out - or at least, Cloudflare doesn't seem to have a set timeout for the response body transferred in chunked encoding. I have a hobby project on a free Cloudflare account that utilizes server-sent events, and the longest request last week survived 24.5 hours.

    For a REST service, you can't send headers before the API call completes, because you can't know whether the call would succeed or fail, and thus can't predict the HTTP status code that is part of the headers.


    @omelas said:
    how about put a reverse proxy server in front of client it and reply 307 redirect when proxy found it has cached responses in cdn?

    This is an interesting idea, but the reverse proxy server isn't really necessary.

    • The API server is not on CDN.
    • Whenever an API call completes successfully, the API server writes the result to a file (could be ramdisk), and then redirects to a CDN domain.
      This includes the first time that response is sent.

    • The CDN domain points to a file server that sends those files.

Sign In or Register to comment.