Solaris Tunable Parameters Reference Manual

Paging-Related Tunables

The Solaris environment is a demand paged virtual memory system. As the system runs, pages are brought into memory as needed. When memory becomes occupied above a certain threshold and demand for memory continues, paging begins. Paging goes through several levels that are controlled by certain variables.

The general paging algorithm is as follows:

The system initially constrains itself to use no more than 4% of one CPU for pageout operations. As memory pressure increases, the amount of CPU time consumed in support of pageout operations linearly increases until a maximum of 80% of one CPU is consumed. The algorithm is to look through some amount of memory between slowscan and fastscan, and stops when one of the following occurs:

If a memory shortfall is still present when pageout finishes its scan, another scan is scheduled for 1/4 second in the future.

The configuration mechanism of the paging subsystem has changed in the Solaris 9 release. Instead of depending on a set of predefined values for fastscan, slowscan, and handspreadpages, the system determines the appropriate settings for these parameters at boot time. Setting any of these variables in the /etc/system file can cause the system to use less than optimal values.


Caution – Caution –

We recommend that all tuning of the VM system be removed from /etc/system. Run with the default settings and determine if it is necessary to adjust any of these parameters. Do not set either cachefree or priority_paging. They have been removed from the Solaris 9 release.


Beginning in the Solaris 7 5/99 release, dynamic reconfiguration (DR) for CPU and memory is supported. The behavior of the system in a DR operation involving the addition or deletion of memory is to recalculate values for the relevant parameters unless the parameter has been explicitly set in /etc/system. In that case, the value specified in /etc/system is used unless a constraint on the value of the variable has been violated, in which case the value is reset.

lotsfree

Description

Initial trigger for system paging to begin. When this threshold is crossed, the page scanner wakes up to begin looking for memory pages to reclaim.

Data Type

Unsigned long

Default

The greater of 1/64th of physical memory or 512 Kbytes

Range

The minimum value is 512 Kbytes or 1/64th of physical memory, whichever is greater, expressed as pages using the page size returned by getpagesize(3C).

The maximum is the number of physical memory pages. The maximum value should be no more than 30% of physical memory. The system does no enforcement of this range other than that described in the Validation section.

Units

Pages

Dynamic?

Yes, but dynamic changes are lost if a memory based DR operation occurs.

Validation

If lotsfree is greater than the amount of physical memory, the value is reset to the default.

Implicit

The relationship of lotsfree is greater than desfree, which is greater than minfree, should be maintained at all times.

When to Change

When demand for pages is subject to sudden sharp spikes, the memory algorithm might not be able to keep up with demand. One way to work around this problem is to start reclaiming memory at an earlier time. This solution gives the paging system some additional margin.

A rule of thumb is to set this parameter to 2 times what the system needs to allocate in a few seconds. This parameter is workload dependent: a DBMS server can probably work fine with the default settings, but a system doing heavy file system I/O might need to adjust this parameter.

For systems with relatively static workloads and large amounts of memory, adjust this value downwards. The minimum acceptable value is 512 Kbytes expressed as pages using the page size returned by getpagesize(3C).

Commitment Level

Unstable

desfree

Description

Amount of memory desired to be free at all times on the system.

Data Type

Unsigned integer

Default

lotsfree / 2

Range

The minimum value is 256 Kbytes or 1/128th of physical memory, whichever is greater, expressed as pages using the page size returned by getpagesize(3C).

The maximum is the number of physical memory pages. The maximum value should be no more than 15% of physical memory. The system does no enforcement of this range other than that described in the Validation section.

Units

Pages

Dynamic?

Yes, unless dynamic reconfiguration operations that add or delete memory occur. At that point, the value is reset to whatever was provided in the /etc/system file or was calculated from the new physical memory value.

Validation

If desfree is greater than lotsfree, desfree is set to lotsfree / 2. No message is displayed.

Implicit

The relationship of lotsfree is greater than desfree, which is greater than minfree, should be maintained at all times.

Side Effects

Several side effects can arise from increasing the value of this variable. When the new value nears or exceeds the amount of available memory on the system:

  • Asynchronous I/O requests are not processed unless available memory exceeds desfree. Increasing the value of desfree can result in rejection of requests that otherwise would succeed.

  • NFS Version 3 asynchronous writes are executed as synchronous writes.

  • The swapper is awakened earlier, and the behavior of the swapper is biased towards more aggressive actions.

  • The system might not prefault as many executable pages into the system. This side effect results in applications potentially running slower than they otherwise would.

When to Change

For systems with relatively static workloads and large amounts of memory, adjust this value downwards. The minimum acceptable value is 256 Kbytes expressed as pages using the page size returned by getpagesize(3C).

Commitment Level

Unstable

minfree

Description

Minimum acceptable memory level. When memory drops below this number, the system biases allocations toward those necessary to successfully complete pageout operations or to swap processes completely out of memory, and either denies or blocks other allocation requests.

Data Type

Unsigned integer

Default

desfree / 2

Range

The minimum value is 128 kbytes or 1/256th of physical memory, whichever is greater, expressed as pages using the page size returned by getpagesize(3C).

The maximum is the number of physical memory pages. The maximum value should be no more than 7.5% of physical memory. The system does no enforcement of this range other than that described in the Validation section.

Units

Pages

Dynamic?

Yes, unless dynamic reconfiguration operations that add or delete memory occur. At that point, the value is reset to whatever was provided in the /etc/system file or was calculated from the new physical memory value.

Validation

If minfree is greater than desfree, minfree is set to desfree / 2. No message is displayed.

Implicit

The relationship of lotsfree is greater than desfree, which is greater than minfree, should be maintained at all times.

When to Change

The default value is generally adequate. For systems with relatively static workloads and large amounts of memory, adjust this value downwards. The minimum acceptable value is 128 Kbytes expressed as pages using the page size returned by getpagesize(3C).

Commitment Level

Unstable

throttlefree

Description

Memory level at which blocking memory allocation requests are put to sleep, even if the memory is sufficient to satisfy the request.

Data Type

Unsigned integer

Default

minfree

Range

The minimum value is 128 Kbytes or 1/256th of physical memory, whichever is greater, expressed as pages using the page size returned by getpagesize(3C).

The maximum is the number of physical memory pages. The maximum value should be no more than 4% of physical memory. The system does no enforcement of this range other than that described in the Validation section.

Units

Pages

Dynamic?

Yes, unless dynamic reconfiguration operations that add or delete memory occur. At that point, the value is reset to whatever was provided in the /etc/system file or was calculated from the new physical memory value.

Validation

If throttlefree is greater than desfree, throttlefree is set to minfree. No message is displayed.

Implicit

The relationship of lotsfree is greater than desfree, which is greater than minfree, should be maintained at all times.

When to Change

The default value is generally adequate. For systems with relatively static workloads and large amounts of memory, adjust this value downwards. The minimum acceptable value is 128 Kbytes expressed as pages using the page size returned by getpagesize(3C).

Commitment Level

Unstable

pageout_reserve

Description

Number of pages reserved for the exclusive use of the pageout or scheduler threads. When available memory is less than this value, non-blocking allocations are denied for any processes other than pageout or the scheduler. Pageout needs to have a small pool of memory for its use so it can allocate the data structures necessary to do the I/O for writing a page to its backing store. This variable was introduced in the Solaris 2.6 release to ensure that the system would be able to perform a pageout operation in the face of the most severe memory shortage.

Data Type

Unsigned integer

Default

throttlefree / 2

Range

The minimum value is 64 Kbytes or 1/512th of physical memory, whichever is greater, expressed as pages using the page size returned by getpagesize(3C).

The maximum is the number of physical memory pages. The maximum value should be no more than 2% of physical memory. The system does no enforcement of this range other than that described in the Validation section.

Units

Pages

Dynamic?

Yes, unless dynamic reconfiguration operations that add or delete memory occur. At that point, the value is reset to whatever was provided in the /etc/system file or was calculated from the new physical memory value.

Validation

If pageout_reserve is greater than throttlefree / 2, pageout_reserve is set to throttlefree / 2. No message is displayed.

Implicit

The relationship of lotsfree is greater than desfree, which is greater than minfree, should be maintained at all times.

When to Change

The default value is generally adequate. For systems with relatively static workloads and large amounts of memory, adjust this value downwards. The minimum acceptable value is 64 Kbytes expressed as pages using the page size returned by getpagesize(3C).

Commitment Level

Unstable

pages_pp_maximum

Description

Defines the number of pages that the system requires be unlocked. If a request to lock pages would force available memory below this value, that request is refused.

Data Type

Unsigned long

Default

The greater of (tune_t_minarmem + 100 and [4% of memory available at boot time + 4 Mbytes])

Range

Minimum value enforced by the system is tune_t_minarmem + 100. The system does not enforce a maximum value.

Units

Pages

Dynamic?

Yes, unless dynamic reconfiguration operations that add or delete memory occur. At that point, the value is reset to whatever was provided in the /etc/system file or was calculated.

Validation

If the value specified in the /etc/system file or the calculated default is less than tune_t_minarmem + 100, the value is reset to tune_t_minarmem + 100.

No message is displayed if the value from the /etc/system file is increased. Done only at boot time, and during dynamic reconfiguration operations that involve adding or deleting memory.

When to Change

When memory locking requests or attaching to a shared memory segment with the SHARE_MMU flag fails, yet the amount of memory available seems to be sufficient.

Excessively large values can cause memory locking requests (mlock(3C), mlockall(3C), andmemcntl(2)) to fail unnecessarily.

Commitment Level

Unstable

Change History

For information, see pages_pp_maximum (Pre-Solaris 9 Releases).

tune_t_minarmem

Description

The minimum available resident (not swappable) memory to maintain in order to avoid deadlock. Used to reserve a portion of memory for use by the core of the operating system. Pages restricted in this way are not seen when the OS determines the maximum amount of memory available.

Data Type

Signed integer

Default

25

Range

1 to physical memory

Units

Pages

Dynamic?

No

Validation

None. Large values result in wasted physical memory.

When to Change

The default value is generally adequate. Consider increasing it if the system locks up and debugging information indicates the problem was because no memory was available.

Commitment Level

Unstable

fastscan

Description

Maximum number of pages per second that the system looks at when memory pressure is highest.

Data Type

Signed integer

Default

The lesser of 64 Mbytes and 1/2 of physical memory.

Range

1 to one-half of physical memory

Units

Pages

Dynamic?

Yes, unless dynamic reconfiguration operations that add or delete memory occur. At that point, the value is reset to whatever was provided by /etc/system or was calculated from the new physical memory value.

Validation

Maximum value is the lesser of 64 Mbytes and 1/2 of physical memory.

When to Change

When more aggressive scanning of memory is desired during periods of memory shortfall, especially if the system is subject to periods of intense memory demand or when performing heavy file I/O.

Commitment Level

Unstable

slowscan

Description

Minimum number of pages per second that the system looks at when attempting to reclaim memory.

Data Type

Signed integer

Default

The smaller of 1/20th of physical memory in pages and 100.

Range

1 to fastscan / 2

Units

Pages

Dynamic?

Yes, unless dynamic reconfiguration operations that add or delete memory occur. At that point, the value is reset to whatever was provided in the /etc/system file or was calculated from the new physical memory value.

Validation

If slowscan is larger than fastscan / 2, slowscan is reset to fastscan / 2. No message is displayed.

When to Change

When more aggressive scanning of memory is desired during periods of memory shortfall especially if the system is subject to periods of intense memory demand.

Commitment Level

Unstable

min_percent_cpu

Description

Minimum percentage of CPU that pageout can consume. This variable is used as the starting point for determining the maximum amount of time that can be consumed by the page scanner.

Data Type

Signed integer

Default

4

Range

1 to 80

Units

Percentage

Dynamic?

Yes

Validation

None

When to Change

Increasing this value on systems with multiple CPUs and lots of memory, which are subject to intense periods of memory demand, enables the pager to spend more time attempting to find memory.

Commitment Level

Unstable

handspreadpages

Description

The Solaris environment uses a two-handed clock algorithm to look for pages that are candidates for reclaiming when memory is low. The first hand of the clock walks through memory marking pages as unused. The second hand walks through memory some distance after the first hand, checking to see if the page is still marked as unused. If so, the page is subject to reclaim. The distance between the front hand and the back hand is handspreadpages.

Data Type

Unsigned long

Default

fastscan

Range

1 to maximum number of physical memory pages on the system

Units

Pages

Dynamic?

Yes. This parameter requires that the kernel variable reset_hands also be set to a non-zero value. Once the new value of handspreadpages has been recognized, reset_hands is set to zero.

Validation

Set to lesser of the amount of physical memory and the handspreadpages value

When to Change

When you want the amount of time that pages are potentially resident before reclaim is increased. Increasing this value increases the separation between the hands, and therefore, the amount of time before a page can be reclaimed.

Commitment Level

Unstable

pages_before_pager

Description

Part of a system threshold that immediately frees pages after an I/O completes instead of storing the pages for possible reuse. The threshold is lotsfree + pages_before_pager. The NFS environment also uses this threshold to curtail its asynchronous activities as memory pressure mounts.

Data Type

Signed integer

Default

200

Range

1 to amount of physical memory

Units

Pages

Dynamic?

No

Validation

None

When to Change

When the majority of I/O is done for pages that are truly read or written once and never referenced again. Setting this variable to a larger amount of memory keeps adding pages to the free list.

When the system is subject to bursts of severe memory pressure. A larger value here helps to keep a bigger cushion against the pressure.

Commitment Level

Unstable

maxpgio

Description

Maximum number of page I/O requests that can be queued by the paging system. This number is divided by 4 to get the actual maximum used by the paging system. It is used to throttle the number of requests as well as to control process swapping.

Data Type

Signed integer

Default

40

Range

1 to 1024

Units

I/0s

Dynamic?

No

Validation

None

Implicit

The maximum number of I/O requests from the pager is limited by the size of a list of request buffers, which is currently sized at 256.

When to Change

When the system is subject to bursts of severe memory pressure. A larger value here helps to recover faster from the pressure if more than one swap device is configured or the swap device is a striped device.

Commitment Level

Unstable