datasette-publish-fly
datasette-publish-fly copied to clipboard
Document usage with datasette-scale-to-zero
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:
And here's it rebooting when a new request comes in:
I'm inclined to add this as a feature - maybe datasette publish fly ... --scale-to-zero 5m
.
Or --sleep-after 5m
perhaps?
As observed here:
- https://github.com/simonw/datasette-scale-to-zero/issues/4#issuecomment-1646525071
Fly also call this "wake on request".