Set Kernel Parameters for Solaris

Related Topics

Before You Begin

To set the kernel parameters for Solaris 9 and lower

Complete the following steps.

  1. Create a backup copy of the /etc/system file.
  2. From the client, open the /etc/system file (using vi, for example).
  3. Change (if necessary) the value of each parameter in the following table to a value within the prescribed range indicated for the parameter.  If the system will be configured as an iDataAgent, update each affected parameter value to accommodate 10 streams. If the system will be configured as a MediaAgent, allocate no fewer than 100 additional streams per affected parameter.
    In the following table:
    • MAXINT = 0x7fffffff (2147483647)
    • MAXINT3264 = MAXINT (if 32-bit) or 0x7fffffffffffffff (if 64-bit)
    Parameter Purpose Possible Range of Values
    SEMMNI* Defines the maximum number of semaphore sets in the entire system 1 – 65535 (unsigned short)
    SEMMNS* Defines the maximum semaphores in the system 1 – MAXINT
    SEMMSL* Defines the minimum recommended semaphore value 1 – MAXINT
    SHMMIN Defines the minimum allowable size of a single shared memory segment 0 (Physical Ram)
    1

    (Generally, do not change the current value if set. If the value is not set, set it to 1.)

    SHMMNI* Defines the maximum number of shared memory segments in the entire system 0 – MAXINT
    SHMMAX Defines the maximum allowable size of one shared memory segment 0 - MAXINT3264

    (If the current value is less than 4199304, just set it to 4199304.)

    SHMSEG* Defines the maximum number of shared memory segments that one process can attach 0 - 32767 (signed short)
    seminfo_semmnu Defines the total number of undo structures supported by the System V semaphore system

    This parameter is critical in extreme circumstances regarding the Solaris MediaAgent (e.g., whenever the Solaris MediaAgent is hosting hundreds of LAN clients). Running out of kernel space allocated for this parameter setting will cause massive pipeline failures. Therefore, be sure to consider setting this parameter whenever you are configuring a Solaris MediaAgent server.

    1024
  4. Reboot the system to allow the changes to take effect.

To set the kernel resources for Solaris 10

  1. Decide which resource controls you would like to change. Use the following table as a reference.
    Resource Control Purpose Maximum Value [Default Value]
    project.max-shm-memory Defines the total amount of shared memory allowed for a project [Default = 25% of the physical memory]

    NOTES

    It is recommended that this resource control not be set. However, if you have to set the control to accommodate other resource consumers, ensure that the value is not less than 2MB = [2097152].

    project.max-shm-ids* Defines the maximum number of shared memory IDs allowed for a project 16777216 [Default = 128]
    project.max-sem-ids* Defines the maximum number of semaphores allowed for a project 16777216 [Default = 128]
  1. From the client, use either the projmod command or the prctl command to change the value of any resource control in the previous table to a value that does not exceed the maximum value indicated for the control. The projmod command makes a "permanent" change to the value of the affected control (i.e., until you change the value subsequently), while the prctl command makes a temporary change to the value (i.e., the value reverts back to the previous value upon system reboot).
    Be sure to check the appropriate man page for these commands. Information on the projmod command is located at http://docs.sun.com/app/docs/doc/816-5166/6mbb1kqch?a=view. Information on the prctl command is located at http://docs.sun.com/app/docs/doc/816-5165/6mbb0m9p6?a=view.

    If the system will be configured as an iDataAgent, update each affected control value to accommodate 10 streams. If the system will be configured as a MediaAgent, allocate no fewer than 100 additional streams per affected control.

    The following commands and examples are based on the Solaris 10 General Availability (GA) version and may be subject to change.

    The command syntax for the projmod command is as follows:

    projmod [-n] [-f filename] [-p projid [-o]] [-c comment] [-a|-s|-r] [-U user [,user...]] [-G group [,group...]] [[-K name[=value[,value...]...]]] [-I new_projectname] project

    In Solaris 10, the /etc/project file contains all the "projects" that are associated with a processor. By default, root gets associated with "project" user.root. Therefore, for example, suppose that user.root includes the following:

    project.max-shm-ids=(priv,640,deny)

    Now, suppose you want to change the value of project.max-shm-ids to 1280. To do so, you can issue the following command:

    projmod -s -K "project.max-shm-ids=(priv,1280,deny)" user.root


    The command syntax for the prctl command is as follows:

    prctl [-P] [-t[basic| privileged| system]] [-n name] [-v value] [-e| d action] [-p pid] [-i idtype] id...

    For example, suppose you want to display the current value of project.max-shm-ids. To do this, you can issue the following command:

    prctl -P -n project.max-shm-ids -i project user.root

    The following output may be displayed:

    project: 1: user.root
    project.max-shm-ids privileged 640 - deny -
    project.max-shm-ids system 16777216 max deny –

    This indicates that the current value of project.max-shm-ids is 640.

    Now, suppose you want to change the value of project.max-shm-ids to 1280. To do so, you can issue the following command:

    prctl -n project.max-shm-ids -v 1280 -r -i project user.root

  2. Reboot the system to allow the changes to take effect.