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

high runtime fees #13

Open
martinkallstrom opened this issue Mar 30, 2024 · 2 comments
Open

high runtime fees #13

martinkallstrom opened this issue Mar 30, 2024 · 2 comments
Labels
question Further information is requested

Comments

@martinkallstrom
Copy link

Loving this project, thanks for publishing!

Have you found a way around this issue? jamsocket/y-sweet#203

@naporin0624
Copy link
Member

naporin0624 commented Mar 30, 2024

No specific workaround is known.
One thing I can say is that you should use HibernationAPI.

I am getting more requests than are covered in jamsocket/y-sweet#203, but the connection time has not increased to this point.

I will respond to what I know about what is being discussed in this issue

  • The odd usage time of DurableObjects
  • The cost savings of using the Hibernation API
  • Duration time even after WebSocket closes

DurableObjects' odd usage time

Here is the LastWeek usage of my public https://yjs.napochaan.dev.

Image from Gyazo

What you can save money by using Hibernation API.

If you prefer, use state.acceptWebSocket() instead, which will stop incurring duration charges once all event handlers finish running.

https://developers.cloudflare.com/durable-objects/platform/pricing/#billing-metrics:~:text=If%20you%20prefer%2C%20use%20state.acceptWebSocket()%20instead%2C%20which%20will%20stop%20incurring%20duration%20charges%20once%20all%20event%20handlers%20finish%20running

It is described like this. y-durableobjects supports Hibernation API, so it is less expensive than y-sweet.

Duration time even after WebSocket is closed.

In my environment the connection appears to be closed.
It may happen when Hibernation API is not used.

Image from Gyazo

DurableObjects billing documentation

See here
https://developers.cloudflare.com/durable-objects/platform/pricing/#durable-objects-billing-examples

Examples 2, 3 and 4 are very expensive. The number of people using the system and the amount of time they are connected may lead to high bills.

@naporin0624
Copy link
Member

I had no knowledge of DurableObjects' high billing. I have not applied y-durableobjects to production, so this kind of input is very helpful.

@naporin0624 naporin0624 added the question Further information is requested label Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants