Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Example: Configuring CPU Utilization

    The master administrator can enable CPU control and configure CPU utilization parameters. This example shows how to enable CPU utilization control and configure CPU utilization quotas and a control target.

    Requirements

    Before you begin:

    Overview

    In this example, you enable CPU control and set the CPU control target to be 85 percent. You allocate reserved CPU quotas to the logical systems shown in Example: Creating User Logical Systems, Their Administrators, Their Users, and an Interconnect Logical System. The logical systems are bound to the security profiles shown in Table 1 and are assigned the reserved CPU quotas in the security profiles.

    Table 1: Logical Systems, Security Profiles, and Reserved CPU Quotas

    Logical System

    Security Profile

    Reserved CPU Quotas

    root-logical-system (master)

    master-profile

    2 percent

    ls-product-design

    ls-design-profile

    2 percent

    ls-marketing-dept, ls-accounting-dept

    ls-accnt-mrkt-profile

    1 percent

    Configuration

    CLI Quick Configuration

    To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

    set system security-profile resources cpu-controlset system security-profile resources cpu-control-target 85 set system security-profile master-profile cpu reserved 2 set system security-profile ls-design-profile cpu reserved 2 set system security-profile ls-accnt-mrkt-profile cpu reserved 1

    Step-by-Step Procedure

    The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide PDF Document.

    To configure CPU utilization control parameters:

    1. Log in to the master logical system as the master administrator and enter configuration mode.
      [edit]admin@host> configureadmin@host#
    2. Enable CPU control.
      [edit system security-profile resources]admin@host# set cpu-control
    3. Configure the CPU control target.
      [edit system security-profile resources]admin@host# set cpu-control-target 85
    4. Configure the reserved CPU quotas in the security profiles.
      [edit system]admin@host# set security-profile security-profile master-profile cpu reserved 2admin@host# set security-profile security-profile ls-design-profile cpu reserved 2admin@host# set security-profile security-profile ls-accnt-mrkt-profile cpu reserved 1

    Results

    From configuration mode, confirm your configuration by entering the show system security-profile command. If the output does not display the intended configuration, repeat the \ instructions in this example to correct the configuration.

    For brevity, this show command output includes only the configuration that is relevant to this example. Any other configuration on the system has been replaced with ellipses (...).

    [edit]admin@host# show system security-profile resources {cpu-control;cpu-control-target 85;}ls-accnt-mrkt-profile {...cpu {reserved 1;}logical-system [ ls-marketing-dept ls-accounting-dept ];}ls-design-profile {...cpu {reserved 2;}logical-system ls-product-design;}master-profile {...cpu {reserved 2;}logical-system root-logical-system;}

    If you are done configuring the device, enter commit from configuration mode.

    Verification

    Confirm that the configuration is working properly.

    Verifying CPU Utilization

    Purpose

    Display the configured reserved CPU quota, the actual CPU usage, and the drop rate.

    Action

    From operational mode, enter the show system security-profile cpu logical-system all command.

    admin@host> show system security-profile cpu logical-system all
    CPU control: TRUE
    CPU control target: 85.00%
    logical system name    profile name    CPU name    usage(%)    reserved(%)    drop rate(%)
    root-logical-system    master-profile CP              0.10%          2.00%           0.00%
    root-logical-system    master-Profile SPU             0.25%          2.00%           0.00%
    ls-product-design      ls-design-profile CP           0.53%          2.00%           0.00%
    ls-product-design      ls-design-profile SPU          0.26%          2.00%           0.00%
    ls-marketing-dept      ls-acct-mrkt-profile CP        0.10%          1.00%           0.00%
    ls-marketing-dept      ls-acct-mrkt-profile SPU       0.15%          1.00%           0.00%
    ls-accounting-dept     ls-acct-mrkt-profile CP        0.23%          1.00%           0.00%
    ls-accounting-dept     ls-acct-mrkt-profile SPU       0.34%          1.00%           0.00%

    Published: 2012-06-29