Technical Documentation

Configuring Resource Limits

The Level IV policy is set by the administrative user using the resource-limits statement at the [edit system extensions] hierarchy level.

[edit system extensions]resource-limits {package package-name {resources {cpu {priority number;time seconds;}file {core-size bytes;open number;size bytes;}memory {data-size bytes;locked-in bytes;resident-set-size bytes;socket-buffers bytes;stack-size bytes;}}}process process-ui-name {resources {cpu {priority number;time seconds;}file {core-size bytes;open number;size bytes;}memory {data-size bytes;locked-in bytes;resident-set-size bytes;socket-buffers bytes;stack-size bytes;}}}}

The limits imposed by a Level IV policy can be configured either by package or by individual processes in the package. Limits defined for individual processes override the limits defined for an entire package. Any limits not set as Level IV limits inherit the limits from Level III if they exist or from Level II.

Level IV policies can be more restrictive than previous policy levels, but they cannot raise the limits set by the other levels.

If an SDK application exceeds any of the imposed limits, the router logs it. For example, if a process tries to exceed its stack size, the process is terminated and the system generates a core file.

Level IV policies can be applied either during runtime of the application or before the application gets started by init(). However, if the SDK application was already running, it must be restarted manually in order to allow for the new limits to take effect.

If you try to commit a resource limit that is higher (less stringent) than the inherited value, the commit operation fails with the following error message:

[edit system extensions resource-limits]
  'process jnx-example-service'
    Limit validation failed for program 'jnx-example-service', resource 'file' limit 'open': raising limits defined in role 'Provider_Daemon' is not allowed.
commit complete

[edit system extensions resource-limits]

If you delete a resource configuration, the setting goes back to the limits from the assigned role in the manifest file (Level II or Level III).


Published: 2010-05-09