BigAdmin System Administration Portal
Community-Submitted Tech Tips
Print-friendly VersionPrint-friendly Version
This content is submitted by a BigAdmin user. It has not been reviewed for technical accuracy by Sun Microsystems, though it may have been lightly edited to improve readability. If you find an error or would like to comment on the article, please contact the submitter or use the comment field at the bottom of the article. Community submissions may not follow Sun trademark guidelines. For information on Sun trademarks, please see http://www.sun.com/suntrademarks/.
 
 

Set Up a Default Scheduling Class to Fully Use Resources on Multithreaded Systems

Victor Feng, April 2008

The Sun Fire T2000 server uses the UltraSPARC T1 processor, which handles multithreaded processes well. For example, the Sun Fire T2000 server is good for Oracle databases and web applications that are multithreaded applications. When some of the applications on a box are single-threaded, you might still be able to fully utilize the computing resources.

The test box I used for this tech tip is an 8-core Sun Fire T2000 server (running the Solaris 10 OS). Since each core has 4 threads, we have 32 CPUs, and mpstat reports 32 CPUs. In the following, I will show the difference made by setting up a default scheduling class.

Without a Default Scheduling Class

Without a default scheduling class, the system can handle only 12 single-threaded processes:

# dispadmin -d
dispadmin: Default scheduling class is not set

Let's run 32 single-threaded processes:

# perl -e 'while (--$ARGV[0] and fork) {}; while () {}' 32 &

Then we'll use vmstat to check how many processes are in the run queue:

# vmstat 3 3
 kthr      memory            page            disk          faults
 cpu
 r  b w   swap     free    re mf pi po fr de sr s1 s2 s3 s4  in   sy
 cs  us sy  id
 0  0 0 38799496 15164936   1  4  4  1  1  0  1  1 -0 -0  0 497  208
 442  0  0 100
 20 0 0 39127104 15498368   0  3  0  0  0  0  0  0  0  0  0 575  197
 401 37  0  63
 20 0 0 39126848 15498104   0  1  2  2  2  0  0  0  0  0  0 578  186
 416 37  0  62

vmstat reports 20 processes (under kthr:r) in the run queue and 37% CPU utilization. So we know the system can handle only 32 minus 20 (that is, 12) single-threaded processes.

With a Default Scheduling Class

With a default scheduling class, the system can handle 32 single-threaded processes. The dispadmin command displays or sets the scheduler parameters for a system:

# dispadmin -d
FSS     (Fair Share)
# perl -e 'while (--$ARGV[0] and fork) {}; while () {}' 32 &
# vmstat 3 3
 kthr      memory            page            disk           faults
 cpu
 r b w   swap    free    re  mf  pi po fr de sr s1 s2 s3 s4  in   sy
 cs   us sy id
 0 0 0 37673528 15247408 90 276 355  1  1  0 84 12 -0 -0 19 796 5710
 2370  37  1 62
 0 0 0 38753928 15163160  0   4   0  0  0  0  0  0  0  0  0 760  176
  356 100  0  0
 0 0 0 38753672 15162904  0   1   0  0  0  0  0  0  0  0  0 729  256
  362 100  0  0

vmstat reports 0 processes in the run queue and 100% CPU utilization.

I also tried the TS (Time Sharing) class, and the system can handle 32 single-threaded processes.

As you can see, when you have a server with a multithreaded processor (for example, the UltraSPARC T1 or T2 processor), it is better to set up a default scheduling class so that you can fully utilize the server's computing resources.

Discuss and comment on this resource in the BigAdmin Wiki


Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License.


BigAdmin
  
 
 
 
 
Would you recommend this Sun site to a friend or colleague?
Contact About Sun News & Events Employment Site Map Privacy Terms of Use Trademarks Copyright Sun Microsystems, Inc.