Search code examples
nexus3

Nexus sonatype/nexus3:3.17.0 on docker tells its using only one cpu


im running Nexus 3 on a 4 CPU Docker Host only limiting RAM Usage to the Container.

After Upgrading to sonatype/nexus3:3.17.0 from 3.16.1 Nexus tells me on the Status Page in the Admin Backend:

Available CPUs: The host system is allocating a maximum of 1 cores to the application. A minimum of 4 is recommended.

I don't know why this is even showing

So i entered the nexus container and retrieved some info how many cores are in there

cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l

Result: 4

Does anybody know whats wrong here ?


Solution

  • finally i found out what's wrong here.

    Java and its crappy docker implementation.

    So if you want that your JavaVM fully recognizes all host cpus yout have to set proper JAVA_OPTS.

    For Nexus this means:

    INSTALL4J_ADD_VM_PARAMS=-XX:ActiveProcessorCount=<NUMBER_OF_CORES>
    

    Et voila - the Nexus Status Page got the right amount of CPU Cores.