Usage of the resources when running more than 1 web app

Say, I’m running a website in Phoenix and just an app in Elixir and it consumes on average 100 Mb of RAM and some percentage of CPU. And I also have 4 other different but equivalent to the 1st one websites in Phoenix/app and each of them alone consumes on average 100 Mb of RAM and the same amount of CPU as the 1st one too – if I run them alone.

What if I were to run all of them as the same time on the same server, would they consume approximately 5 * 100 Mb = 500 Mb? Or is there some kind of trick performed by BEAM so that each additional app doesn’t need to allocated all on the resources again thus reducing the amount of RAM and CPU needed for 5 apps?

If you do run them all on the same node, then the overhead for the runtime itself is applied only once.

A quick and dirty way were to write another app that depends on all the others.

2 Likes