her @sudhir.j, thank’s for the reply. I’m planning on having servers scattered around the globe. Haven’t made a decision on size, but is there a good way to estimate or calculate that? This is perhaps a question more suited for the Elixir forums.
I’m wondering in the off chance that I get 100 concurrent connections, would the app crash. But it sounds like a soft/hard limit of 50 would be reasonable?
I did a bit of sleuthing (maybe the results will be useful for the next person who asks this question) and:
- I’m using the default instance size (I’d be okay to temporarily upgrade):
# flyctl scale show
VM Resources for gems
VM Size: shared-cpu-1x
VM Memory: 256 MB
Max Per Region: Not set
- Looking at Observer (Elixir) I was able to that:
- the base memory consumption when the app is running with no-connections is around 60mb.
- with 15 tabs opened (aka: 15 connections) roughly 70mb of memory is consumed (screenshot below).
Although there is no guarantee that prod would run the same as a local instance, if we did the math then: (70mb - 60 mb)/15 connections = 0.67 mb a connection. This is when there are no active clicks and the page is statically running.
When triggering clicks in the app as fast as I could (meaning a Phoenix LiveView click event) it bumped up to 80mb. Not sure how that would scale with the number of connections (but each connection would receive an update event).
I’m inclined to believe that an VM instance size of 256mb would handle 50 connections easily.
What else am I missing or not accounting for in my (very approximate) calculation?