In pivotal cloud foundry I am running a Java app with 2GB memory having 1 instance . The below code in Java prints 16 on runtime. Should I assume 16 CPU Cores available to process or this is CPU share of overall machine and each app getting share as explained here https://docs.cloudfoundry.org/concepts/container-security.html#cpu
int processors = Runtime.getRuntime().availableProcessors();
System.out.println("Available processor::"+ processors); //16
Also , What does below specifies
cat /sys/fs/cgroup/cpu/cpu.shares
2080
this is CPU share of overall machine and each app getting share as explained here https://docs.cloudfoundry.org/concepts/container-security.html#cpu
Yes. It means the Diego Cell on which your app is running has 16 cores. If that Cell is completely void of any other work, you could, in theory, have access to all 16 Cells, however, that's not usually the case and when there is contention you will be throttled based on the number of CPU shares you have allocated.
cat /sys/fs/cgroup/cpu/cpu.shares 2080
This is the number of shares that you've been assigned. It is not a very meaningful number to look at because it is relative to the other applications running on the same Diego Cell as your application.
In general...
You can try using this cf cli plugin if you want to see more usable numbers. It will do some math based on your app's current usage and your CPU shares and give you the percentage of your allocation that you're being used. Including if you are bursting over your CPU usage.
It's OK to be temporarily over your CPU allocation, but you don't want to consistently be over your allocation or your application performance could suffer if some other application is scheduled onto the same Diego Cell as your application (ie. if/when contention occurs).