The individual owning this blog works for Oracle in Germany. The opinions expressed here are his own, are not necessarily reviewed in advance by anyone but the individual author, and neither Oracle nor any other party necessarily agrees with them.
Wednesday, June 16. 2010
After writing about the processor sets and their role in computing the number of garbage collection threads recently, there were some questions about configuring processor sets. In this article i want to explain the usage of resource pools in Solaris in regard of CPU resources. You don't configure the processor sets directly. Instead of this the pool facility does this for you.
I want to explain how to configure, how to use and how to monitor them. However i can just scratch the surface in such an article.
PrerequisitesWhen you want to demonstrate a feature of the OS that influences the way processes are dispatched on the CPUs it's useful to have something that produces a lot of load. A normal household cpuhog will be sufficient, so i use the one from the resource manager tutorial.
Configuring the CPU resource poolThere are two important commands to control the behavior of the pool facility.
Normally the pool facility isn't activated, so you can't work with it.
Additionally it's not possible to configure it.
So we have to activate the pool facility first.
Now we are able to start the configuration.
The "discover" subcommand scans the system and creates a matching configuration and writes them into the default location
There are two ways to lookup the current configuration. You can use the
At start both outputs are identical, but the difference will be much clearer soon.
Let's configure the pool facility. At first we create a new processor set.
This command creates a processor set that has at least one CPU and at most one cpu. Or to say it easier: It hast exactly one CPU all the time. In the next step we create a pool. You can think of the pool as the entity that
For my example I've created a pool called
With the associate subcommand you configure this connection.
Okay, let's have short look into the state of of pool facility.
We see just one pool at the moment. We have to activate the currently configured configuration first. We have to do this by using the the
When we use the
When you look at the currently running configuration, you will see that one processor has moved to the
But there is a little gotcha in the configuration. The currently persistent configuration looks a little bit differently. Let's look up that configuration.
To make the current distribution boot persistent you have to write the currently active configuration in the persisting configuration.
When you now recheck the persisting configuration, you will see that it's equal to the configuration you get with the
Using the the resource poolsOkay, now we have this nice processor set, but how do we use it. There are several possibilities, but i my example i will explain the usage of projects to use the resource pools.
At first i create a project.
The commands create a project with the name
When you think about the Resource Manager tutorial you are already know how to start command under a dedicated project (and then you will know, you are already running your processes within a project called
When you look at output of
Just to check the behavior from a different perspective:
Albeit there are at least two CPUs, there is just one cpuhog on a CPU and all other are runnable, but wait until they are dispatched on the
Okay, we don't need those hogs any longer ...
It's possible to move an already running process under the control of a project and thus under the control of the resource pools.
Let's assume you've started a single cpuhog.
We can assign a project to a running process. We need the process id of the process for this task:
When you look at the output of
Another way to reach the same is to use the
However i prefer the first method
This was just the surfaceIn this tutorial i barely touched the resource pool facility of Solaris. It has vastly more functions from dynamic resource pools based on load measurement and a rule set which pools and thus which applications are most important up to mechanisms to have several config files that could activate different pool configurations via cron (for example for dayshift and nightshift configurations) or mechanisms to force
ConclusionThe pool facility is a really powerful feature to control the usage of CPU resources. However many people aren't really aware of the possibibilties of the toolset. This may result from the point that most people use their server in a single task per server configuration or aren't aware of possible performance advantages by forcing processes on certain CPUs leveraging the topology of a computer system.
Do you want to learn more?
docs.sun.com - Resource Pools (Overview)
docs.sun.com - Creating and Administering Resource Pools (Tasks)
poold - automated resource pools partitioning daemon
pooladm - activate and deactivate the resource pools facility
poolcfg - create and modify resource pool configuration files
poolstat - report active pool statistics
poolbind - bind processes, tasks, or projects or query binding of processes to resource pools
Posted by Joerg Moellenkamp in English, Oracle, Solaris at 09:16 | Comments (7)
Related entries by tags:
Display comments as (Linear | Threaded)
This can be very useful when I want to limit resources stolen by antivirus/antispam daemons in the mail queue.
A new question about cpu pools comes to my mind now: what about using it in conjunction with latest VirtualBox?
I mean, if I configure a guest with 2 processors, using all the virt flags, where it is actually running? Is it still moving from core to core?
Maybe combining the multiprocessor virt guest and cpu pools would let my guest run on 2 specific cores all the time, and get some benefit?
Since resource pools allocate certain CPU cores, by ID, only those certain cores will be usable by VirtualBox if started inside a resource pool.
Yes, but considering that some of the VBox daemons run shared and in the kernel, would it be sufficient to run the VBoxHeadless inside a configured project?
And, would I gain any better performance from it?
It may be worth mentioning that if a zone is configured with a number of "dedicated-cpu"'s, a resource pool will be created on start up, which the zone is then running in.
I guess I was one of the guys asking for this kind of configuration...
However, one question. When processes run binded to a pool, I do see that it consumes only 1 CPU, but load averages goes to 4, even 5.
Why is it so?
That's due to the way load avg is computed: It's usr time + systime + thread wait. When a CPU is totally consumed by usr and sys by a hog, all other processes have to wait, so they accumulate thread wait time. So it's normal that 5 processes would yield a load avg of 5 when scheduled to a single cpu.
The author does not allow comments to this entry
The LKSF book
The book with the consolidated Less known Solaris Tutorials is available for download here
Martin about End of c0t0d0s0.org
Mon, 01.05.2017 11:21
Thank you for many interesting blog posts. Good luck with al l new endeavours!
Hosam about End of c0t0d0s0.org
Mon, 01.05.2017 08:58
Joerg Moellenkamp about tar -x and NFS - or: The devil in the details
Fri, 28.04.2017 13:47
At least with ZFS this isn't c orrect. A rmdir for example do esn't trigger a zil_commit, as long as you don't speci [...]
Thu, 27.04.2017 22:31
You say: "The following dat a modifying procedures are syn chronous: WRITE (with stable f lag set to FILE_SYNC), C [...]