Instead run each service in a smaller VM. Why? First, if you cram multiple services in one VM, when you hit a bug, such as one that results in 100% CPU consumption till the VM is restarted, all services running in that VM are affected, rather than just one. Figuring out which service has the bug is also harder. As is understanding how many resources each service needs. As you tune performance, like increasing the Java heap size of one service, it could affect other services.
Don't Run Multiple Services In One VM
Don't Run Multiple Services In One VM
Don't Run Multiple Services In One VM
Instead run each service in a smaller VM. Why? First, if you cram multiple services in one VM, when you hit a bug, such as one that results in 100% CPU consumption till the VM is restarted, all services running in that VM are affected, rather than just one. Figuring out which service has the bug is also harder. As is understanding how many resources each service needs. As you tune performance, like increasing the Java heap size of one service, it could affect other services.