Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document usage with datasette-scale-to-zero #30

Open
simonw opened this issue Aug 21, 2023 · 2 comments
Open

Document usage with datasette-scale-to-zero #30

simonw opened this issue Aug 21, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@simonw
Copy link
Owner

simonw commented Aug 21, 2023

Following #29 I decided to try this:

datasette publish fly \
   fixtures.db \
   --app datasette-publish-fly-issue-29 \
   --install datasette-auth-passwords \
   --plugin-secret datasette-auth-passwords root_password_hash 'pbkdf2_sha256$480000$9ce99372d1fa079f770d4e2245bcf335$zJjskTDc6M8sxmEUYZBr/EC0e730Q9pzcF8RJB43c/c=' \
   --install datasette-scale-to-zero \
   --plugin-secret datasette-scale-to-zero duration 5m

Using https://datasette.io/plugins/datasette-scale-to-zero ... and it worked!

I watched the Fly Dashboard and the app at https://datasette-publish-fly-issue-29.fly.dev/ now successfully scales to zero if it receives no hits for 5 minutes, then starts running again when traffic arrives:

Here's it exiting 5m after the last request:

CleanShot 2023-08-21 at 12 14 55@2x

And here's it rebooting when a new request comes in:

CleanShot 2023-08-21 at 12 16 59@2x
@simonw simonw added the documentation Improvements or additions to documentation label Aug 21, 2023
@simonw
Copy link
Owner Author

simonw commented Aug 21, 2023

I'm inclined to add this as a feature - maybe datasette publish fly ... --scale-to-zero 5m.

Or --sleep-after 5m perhaps?

@simonw
Copy link
Owner Author

simonw commented Aug 21, 2023

As observed here:

Fly also call this "wake on request".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant