On Solaris, the top command always takes all cpu usage as a maximum 100%, no matter how many cpus are there on the board. In a case of 4 processors on a server, any single process listed on top command will not exceed 25% of overall cpu usage. This is the well-known "Solaris Mode". The rationale can found in the manual of top command on Solaris:
SUNOS 57 NOTES
CPU percentage is calculated as a fraction of total available computing resources. Hence on a multiprocessor machine a single threaded process can never consume cpu time in excess of 1 divided by the number of processors. For example, on a 4 processor machine, a single threaded process will never show a cpu percentage higher than 25%. The CPU percentage column will always total approximately 100, regardless of the number of processors.
Which means, Solaris takes all the processors as a whole, the total usage of cpu is always from 0% to 100%, regardless how many processors the server has. That is, if a Solaris server with N processors, a single process can only consume the overall cpu usage up to (100/N)%.
The feature of Solaris Mode has been adopted on Linux, the opposite concept is called Irix Mode, which is the default mode on Linux, and can be switched on and off. When Irix Mode is on, the maximum total cpu usage are the summation of total number of cpu, no more fixed at 1 (100%) as Solaris mode. Hence, a single process can be up to 100% when Irix Mode is on.
Let's see an example on a Linux server with 4 processors:
$ top
top - 19:53:18 up 5:03, 2 users, load average: 0.74, 0.47, 0.19
Tasks: 85 total, 2 running, 83 sleeping, 0 stopped, 0 zombie
Cpu(s): 11.8% us, 22.5% sy, 0.0% ni, 63.9% id, 0.1% wa, 1.7% hi, 0.0% si
Mem: 4147376k total, 658276k used, 3489100k free, 52380k buffers
Swap: 2031608k total, 0k used, 2031608k free, 496740k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5330 oracle 16 0 14456 5944 3936 S 71 0.1 3:04.48 sqlplus
5269 root 16 0 7708 2304 1832 R 53 0.1 2:07.39 sshd
5355 oracle 17 0 308m 61m 49m S 17 1.5 0:39.94 oracle
...
Since the default mode of Linux is Irix Mode, any single process can consume up to 100% of one processor. In the above example, the first process takes 71% on cpu usage.
Let's switch to Solaris Mode before the process disappears by pressing I on the keyboard.
top - 19:54:59 up 5:05, 2 users, load average: 0.51, 0.44, 0.20
Tasks: 85 total, 4 running, 81 sleeping, 0 stopped, 0 zombie
Cpu(s): 10.2% us, 23.8% sy, 0.0% ni, 64.4% id, 0.0% wa, 1.5% hi, 0.0% si
Mem: 4147376k total, 658340k used, 3489036k free, 52440k buffers
Swap: 2031608k total, 0k used, 2031608k free, 496680k cached
Irix mode Off
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5330 oracle 16 0 14456 5944 3936 R 18 0.1 3:17.43 sqlplus
5269 root 16 0 7708 2304 1832 R 13 0.1 2:17.35 sshd
5355 oracle 16 0 308m 61m 49m S 4 1.5 0:43.52 oracle
7871 oracle 16 0 3848 996 776 R 0 0.0 0:00.13 top
...
Cpu usage of the first process drops from 71% to 18% under Solaris Mode, which is no more than (100/4)% = 25%.
A final note, it's impossible for any single process to utilize more than one processor at the same time. If you want database operations to utilize more processors, you should try "degree of parallel" on the database-level or "multi-thread" on the application-level.
nice article
Thanks!
Very informative article.
Thanks a lot!