Home > Enterprise >  Different behaviour on 2 containers of same tomcat image run on 2 Debian servers
Different behaviour on 2 containers of same tomcat image run on 2 Debian servers

Time:12-07

When I run docker tomcat manager on 2 Debian servers I have these 2 displays:

Tomcat1: https://i.stack.imgur.com/kucJQ.png

Tomcat2: https://i.stack.imgur.com/ygOCh.png

Tomcat status memory pools are listed with different names as "PS < memory pool>" in Tomcat 1 and only "< memory pool >" in Tomcat 2 (like "PS Eden Space" vs "Eden Space").

Both container are run the same way :

docker run   --name tomcat-test   -it   -p 8083:8080   -v /tmp/tomcat-users.xml:/usr/local/tomcat/conf/tomcat-users.xml   -v /tmp/context.xml:/tmp/context.xml   tomcat:8.5-jdk8-openjdk  /bin/bash -c "mv /usr/local/tomcat/webapps /usr/local/tomcat/webapps2; mv /usr/local/tomcat/webapps.dist /usr/local/tomcat/webapps; cp /tmp/context.xml /usr/local/tomcat/webapps/manager/META-INF/context.xml; catalina.sh run"
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>

with same param xml files:

cat /tmp/context.xml
<Context antiResourceLocking="false" privileged="true" >
  <!--
    <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d \.\d \.\d |::1|0:0:0:0:0:0:0:1" />
  -->
  <Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>
<iframe name="sif2" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>

and

# cat /tmp/tomcat-users.xml
<tomcat-users>
  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <user username="tomcat" password="s3cret" roles="manager-gui,manager-script"/>
</tomcat-users>
<iframe name="sif3" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>

Both server are the same versions:

# cat /etc/debian_version
9.13

# docker version
Client: Docker Engine - Community
 Version:           19.03.15
 
<iframe name="sif4" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>

Any idea why there is such difference? Shouldn't 2 containers running the same image do the sctrictly same behaviour? It's a small difference but I'm wondering if there is such difference I have seen, maybe there are other I don't see...

CodePudding user response:

The names of the memory pools depend on the garbage collector implementation used. This in turn depends on the characteristics (memory, number of real/virtual CPUs) of the servers on which the JVM runs.

The instance reporting memory pools prefixed by PS must be using the parallel garbage collector (see this question). The other instance is probably using the serial garbage collector.

See this answer on how the GC implementation used depends upon the characteristics of the server.

  • Related