Serverless sleep time adjustment
nickvanzdev
HOBBYOP

5 months ago

is there a way to set the serverless sleep time to something other then the standard 10 minutes?

i've got a microservice which isn't used much at all, in prod probaply like 24 times a day at max for one endpoint call each time. with quite some time between each call.

so i'd like it to go back to sleep as soon as possible after the request is finished

i know it wouldn't save THAT much usage fees by setting it to 1 minute instead of 10 for example, but every resource saved will count up at the end of the day.
this is a lightweight api which i'm talking about, it's python flask and starts fast. however, the chromedriver from the dockerfile image, which is used in it to use playwright, eats some memory..

4 Replies

brody
EMPLOYEE

5 months ago

Hello,

We don't provide a way to change this, unfortunately.


adam
MODERATOR

5 months ago

If it's only used for one endpoint call at a time, you could have it terminate itsself after completing the request


adam
MODERATOR

5 months ago

quit() in Python should do it


brody
EMPLOYEE

5 months ago

I don't think we will restart it if the app actually exits, because then it's in a completed state, instead of the desired sleeping state, but it's worth a try.


Loading...