Re: [google-appengine] Can't I set a specific request timeout ? 24 hours for running an HTTP requets seems crazy.

2020-01-31 Thread Larry Schiefer
App Engine's request handlers put a hard limit on how quickly the code must
respond and if that is exceeded it internally throws an exception. This
will result in a 500 error to the http caller and this can't be caught by
your GAE code and it cannot be overridden.  This is one of the tradeoffs
when using a PaaS.  If more control is desired/needed so your software is
on a more general web server, you'll need to use something like Kubernetes
or Compute Engine.

Task queues / cron / cloud tasks can take substantially longer and are
dependent on the type of GAE instance.  In some cases the max time is 10
minutes, in other cases I believe it can go 24 hours. Regardless, if the
work can be broken up in the task/cron so it detects when it is nearing
some limit, it can save some info about where it was and re-schedule itself
to run again.

-Larry


On Fri, Jan 31, 2020 at 7:59 AM Patrice B 
wrote:

> Thank you for your time.   I do understand that task queues and cron jobs
> may need a longer timeout value.
>
> My question really is this : is there no way to configure an instance in
> such a way that HTTP requests are killed on timeout after say 10 minutes ?
>
> And if there is no way to achieve this, as seems to be the case, then how
> would you suggest to protect an instance against a request that would keep
> running forever ?Should be start a timer and attempt to handle timeout
> manually ?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-appengine+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-appengine/cbc75d76-591f-4f58-bff3-42d6fe0b8b4c%40googlegroups.com
> 
> .
>


-- 

Larry Schiefer
M: 469-263-9388
email: larry.schie...@hiqes.com
http://www.hiqes.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CAEOXmpKtm2K57XvCs%2Bud8C6wb%3Dd_vtFg%3DbTjPD4zcBwQvL5nvw%40mail.gmail.com.


Re: [google-appengine] Can't I set a specific request timeout ? 24 hours for running an HTTP requets seems crazy.

2020-01-31 Thread Joshua Smith
Relying on the infrastructure to police your algorithm’s implementation doesn’t 
make much sense.

If you’re doing some operation with a loop, you can simply add a check every 
few iterations and abort if it’s taking too long.

Using timers might be an option, depending on the language you are using. But 
being explicit within the algorithm is probably a better engineering practice.

> On Jan 31, 2020, at 3:40 AM, Patrice B  wrote:
> 
> Thank you for your time.   I do understand that task queues and cron jobs may 
> need a longer timeout value. 
> 
> My question really is this : is there no way to configure an instance in such 
> a way that HTTP requests are killed on timeout after say 10 minutes ? 
> 
> And if there is no way to achieve this, as seems to be the case, then how 
> would you suggest to protect an instance against a request that would keep 
> running forever ?Should be start a timer and attempt to handle timeout 
> manually ? 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-appengine+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-appengine/cbc75d76-591f-4f58-bff3-42d6fe0b8b4c%40googlegroups.com
>  
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/DAC3FA17-71F1-43F1-94FB-99FF06F54B29%40gmail.com.


Re: [google-appengine] Can't I set a specific request timeout ? 24 hours for running an HTTP requets seems crazy.

2020-01-31 Thread Patrice B
Thank you for your time.   I do understand that task queues and cron jobs 
may need a longer timeout value. 

My question really is this : is there no way to configure an instance in 
such a way that HTTP requests are killed on timeout after say 10 minutes ? 

And if there is no way to achieve this, as seems to be the case, then how 
would you suggest to protect an instance against a request that would keep 
running forever ?Should be start a timer and attempt to handle timeout 
manually ? 


-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/cbc75d76-591f-4f58-bff3-42d6fe0b8b4c%40googlegroups.com.


Re: [google-appengine] Can't I set a specific request timeout ? 24 hours for running an HTTP requets seems crazy.

2020-01-30 Thread Joshua Smith
HTTP requests service task queues and cron jobs, so while it would be crazy to 
think a web browser would still be around, it’s perfectly normal to put 
compute-intensive cron jobs into an HTTP request handler that might need many 
hours to run.

> On Jan 30, 2020, at 10:14 AM, Patrice B  wrote:
> 
> Regarding request timeout, I find here 
> https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed#timeout
>  that a timeout value of 10 minutes is used for "automatic scaling" and a 
> value of 24 hours is used in basic and manual scaling.And indeed, I have 
> observed requests running for hours and hours, with important impact on the 
> instance.
> 
> Is there no way for me to define a specific timeout value other than 10 
> minutes or 24 hours ?24 hours, which applies to HTTP requests as well as 
> task queue tasks,  is a crazy value for web requests, who would wait 24 hours 
> for an HTTP response ?  
> 
> This absence of a reasonable limit has major implications:  while the user 
> probably moved on and left the page after a few minutes, the request may be 
> running for hours, thus slowing the whole instance. 
> 
> It would be very useful to be able to specify one's own timeout value.   And 
> if that is impossible, then 10 minutes for HTTP requests is certainly a 
> better choice than 24 hours. 
> 
> Does anyone else have this kind of issue ? 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-appengine+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-appengine/f411f311-5ef0-47d5-ade7-2cb53830224c%40googlegroups.com
>  
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/1F102CC1-005D-476D-B427-673EE381554A%40gmail.com.


[google-appengine] Can't I set a specific request timeout ? 24 hours for running an HTTP requets seems crazy.

2020-01-30 Thread Patrice B
Regarding request timeout, I find here 
https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed#timeout
 
that a timeout value of 10 minutes is used for "automatic scaling" and a 
value of 24 hours is used in basic and manual scaling.And indeed, I 
have observed requests running for hours and hours, with important impact 
on the instance.

Is there no way for me to define a specific timeout value other than 10 
minutes or 24 hours ?24 hours, which applies to HTTP requests as well 
as task queue tasks,  is a crazy value for web requests, who would wait 24 
hours for an HTTP response ?  

This absence of a reasonable limit has major implications:  while the user 
probably moved on and left the page after a few minutes, the request may be 
running for hours, thus slowing the whole instance. 

It would be very useful to be able to specify one's own timeout value.   
And if that is impossible, then 10 minutes for HTTP requests is certainly a 
better choice than 24 hours. 

Does anyone else have this kind of issue ? 

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/f411f311-5ef0-47d5-ade7-2cb53830224c%40googlegroups.com.