3 ms·
It always amazed me that the JVM doesn't have any options to restrict CPU resources (something VMware does have). The only alternative I can think of is to use
by rickette 15y ago
It always amazed me that the JVM doesn't have any options to restrict CPU resources (something VMware does have). The only alternative I can think of is to use the unix taskset utility to limit JVMs to specific CPU cores. Anybody got experiece with a setup like this?
Limiting memory usage and file permissions with the JVM is indeed easy.
- guelo 15y agoLet the OS manage the CPUs, you can use nice if you need to prioritize.
- ntoshev 15y agoThere is also cpulimit if you want to set hard limits.
- sciurus 15y agoCreate a cgroup hierarchy with the CPU subsystem attached, then put each JVM in its own cgroup in that hierarchy. By default, each JVM will get an equal amount of CPU time. A JVM can be given relatively more CPU time by increasing cpu.shares for its cgroup. You can similarly manage memory and i/o with the memory and blkio subsystems. http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/index.html http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6...