I have few questions and I have searched for below questions over the net but got more confused.
- I have java application running on single machine with single JVM , 20 core machine with 20 GB ram with 20 java thread. ( single machine, single JVM, 20 core, 20 GB ram, 20 java threads )
- I have java application running on single machine with 20 JVM, 20 core mahcine with 1 GB ram to each JVM with 1 JAVA thread to each process. ( single machine, 20 JVM, 20 core, 20 GB ram, 20 java threads )
From above points 1 and 2 which one is better and why in terms of
- Performance of application
- CPU utilization of machine
- If CPU is not consumed fully even increasing the number of threads, then what to do in application or machine in order to utilize more CPU.
- In which case context switching will be more.
In above 1 and 2 point, lets say each thread takes 10ms to complete the task then, in how much time all the tasks will be completeed in case 1 and 2. Please explain.
I have search and heard about CPU intensive and I/O intensive application in regard of CPU utilization. Can you please explain a bit as over net I got confused alot.
Generally it is recommened to have number of threads equal to number of cores. If i have more number of thread then cores then what will be the impact. Please explain.