Multiple JVMs vs single app server

前端 未结 4 1027
灰色年华
灰色年华 2021-02-04 03:11

I\'m dealing with a system that runs a Java application per customer in its own JVM. We\'ve got about a half dozen dedicated servers that are running close to 100 JVMs total now

4条回答
  •  抹茶落季
    2021-02-04 03:54

    There's pros and cons of either approach:

    Shared JVM

    • Lower overhead - JVM memory footprint (core libraries etc.) only needs to be loaded once.
    • Better memory usage. Java processes will consume OS memory for heap space that may not currently be in use.

    Separate JVM

    • Insulation from 'greedy' or 'leaky' applications.
    • Better security from malicious code.
    • Easier updates, updating one app without bringing down the other.

    Overall, I wouldn't set a blanket policy. Look for small / micro-services or other low-usage apps that may be good candidates to share first and expand from there.

提交回复
热议问题