Best way to host a websocket server

2,999 views
Skip to first unread message

Benjamin Ferguson

unread,
Jan 17, 2022, 3:55:41 AM1/17/22
to Google Cloud Developers
Hello! I am new to GCP and need some advice.

I have a side project I'm working on to help me learn and get started. I have an angular app where I want users to communicate with each other. I'm looking to use websockets and am considering cloud run. Is this the best platform for something like that? 

Right now my highest priority is cost saving since this is a small personal project. I understand that a websocket will keep the server active while the connection is open, so I'm worried that I'll rack up a bill every month.

Thoughts?

Thanks you!
Ben
Message has been deleted

goya

unread,
Jan 26, 2022, 11:58:42 AM1/26/22
to Google Cloud Developers

Yes, using websockets will keep the instances active and this can affect billing [1]. There are some other factors that can change the costs of your Cloud Run service such as setting a max number of instances [2] and increasing the concurrent requests per instance [3].


I recommend you to use the pricing calculator [4] and try different combinations so you can get an idea of how much you would end up paying before you deploy your code. 

 


[1]: https://cloud.google.com/run/docs/triggering/websockets#billing_incurred_when_using_websockets 

[2]: https://cloud.google.com/run/docs/configuring/max-instances 

[3]: https://cloud.google.com/run/docs/about-concurrency 


[4]: https://cloud.google.com/products/calculator
On Wednesday, January 19, 2022 at 5:25:14 PM UTC+1 cpolur...@gmail.com wrote:
Hi Ben,

I am Jhumkara from TheTechyChips Inc. I do have some advice for you. If you are working for an org, please ask them for furthur support. If not, just contact cpolur...@gmail.com.


Thanks,
Jhumkara P
Reply all
Reply to author
Forward
0 new messages