Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Solaris Tunable Parameters Reference Manual
Previous Next

Paging-Related Parameters

The Solaris OS uses 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 parameters.

The general paging algorithm is as follows:

  • A memory deficit is noticed. The page scanner thread runs and begins to walk through memory. A two-step algorithm is employed:

    1. A page is marked as unused.

    2. If still unused after a time interval, the page is viewed as a subject for reclaim.

    If the page has been modified, a request is made to the pageout thread to schedule the page for I/O. Also, the page scanner continues looking at memory. Pageout causes the page to be written to the page's backing store and placed on the free list. When the page scanner scans memory, no distinction is made as to the origin of the page. The page might have come from a data file, or it might represent a page from an executable's text, data, or stack.

  • As memory pressure on the system increases, the algorithm becomes more aggressive in the pages it will consider as candidates for reclamation and in how frequently the paging algorithm runs. (For more information, see fastscan and slowscan.) As available memory falls between the range lotsfree and minfree, the system linearly increases the amount of memory scanned in each invocation of the pageout thread from the value specified by slowscan to the value specified by fastscan. The system uses the desfree parameter to control a number of decisions about resource usage and behavior.

The system initially constrains itself to use no more than 4 percent 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 percent of one CPU is consumed. The algorithm looks through some amount of memory between slowscan and fastscan, then stops when one of the following occurs:

  • Enough pages have been found to satisfy the memory shortfall.

  • The planned number of pages have been looked at.

  • Too much time has elapsed.

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 was changed, starting 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 parameters in the /etc/system file can cause the system to use less than optimal values.


Caution - Remove all tuning of the VM system from the /etc/system file. 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, starting in the Solaris 9 release.


Beginning in the Solaris 7 5/99 release, dynamic reconfiguration (DR) for CPU and memory is supported. A system in a DR operation that involves the addition or deletion of memory recalculates 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 this case, the value is reset.

lotsfree

Description

Serves as the 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. For more information, seegetpagesize(3C).

The maximum value is the number of physical memory pages. The maximum value should be no more than 30 percent of physical memory. The system does not enforce 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 being 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 be unable to keep up with demand. One workaround 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. However, you might need to adjust this parameter for a system doing heavy file system I/O.

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

Commitment Level

Unstable

desfree

Description

Specifies the preferred amount of memory 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.

The maximum value is the number of physical memory pages. The maximum value should be no more than 15 percent of physical memory. The system does not enforce 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 the value provided in the /etc/system file or 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 being 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 parameter. When the new value nears or exceeds the amount of available memory on the system, the following can occur:

  • 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 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, lower this value. The minimum acceptable value is 256 Kbytes, expressed as pages using the page size returned by getpagesize.

Commitment Level

Unstable

minfree

Description

Specifies the minimum acceptable memory level. When memory drops below this number, the system biases allocations toward allocations necessary to successfully complete pageout operations or to swap processes completely out of memory. Either allocation 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.

The maximum value is the number of physical memory pages. The maximum value should be no more than 7.5 percent of physical memory. The system does not enforce 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 the value provided in the /etc/system file or 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 being 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, lower this value. The minimum acceptable value is 128 Kbytes, expressed as pages using the page size returned by getpagesize.

Commitment Level

Unstable

throttlefree

Description

Specifies the 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.

The maximum value is the number of physical memory pages. The maximum value should be no more than 4 percent of physical memory. The system does not enforce 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 the value provided in the /etc/system file or 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, lower this value. The minimum acceptable value is 128 Kbytes, expressed as pages using the page size returned by getpagesize. For more information, seegetpagesize(3C).

Commitment Level

Unstable

pageout_reserve

Description

Specifies the number of pages reserved for the exclusive use of the pageout or scheduler threads. When available memory is less than this value, nonblocking 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 percent of physical memory. The system does not enforce 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 the value provided in the /etc/system file or 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 being 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, lower this value. The minimum acceptable value is 64 Kbytes, expressed as pages using the page size returned by getpagesize.

Commitment Level

Unstable

pages_pp_maximum

Description

Defines the number of pages that must 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 the value provided in the /etc/system file or was calculated from the new physical memory value.

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. Validation is done only at boot time and during dynamic reconfiguration operations that involve adding or deleting memory.

When to Change

When memory-locking requests fail or when 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, mlockall, and memcntl) to fail unnecessarily. For more information, see mlock(3C), mlockall(3C), and memcntl(2).

Commitment Level

Unstable

Change History

For information, see pages_pp_maximum (Solaris Releases Prior to Solaris 9 Releases).

tune_t_minarmem

Description

Defines the minimum available resident (not swappable) memory to maintain necessary to avoid deadlock. Used to reserve a portion of memory for use by the core of the OS. 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 the default value if the system locks up and debugging information indicates that no memory was available.

Commitment Level

Unstable

fastscan

Description

Defines the 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 the value provided by /etc/system or calculated from the new physical memory value.

Validation

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

When to Change

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

Commitment Level

Unstable

slowscan

Description

Defines the 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 the value provided in the /etc/system file or 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 preferred during periods of memory shortfall, especially when the system is subject to periods of intense memory demand.

Commitment Level

Unstable

min_percent_cpu

Description

Defines the minimum percentage of CPU that pageout can consume. This parameter 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 OS 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 being reclaimed. The distance between the first hand and the second 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 reset_hands parameter also be set to a non-zero value. Once the new value of handspreadpages has been recognized, reset_hands is set to zero.

Validation

The value is set to the lesser of either the amount of physical memory and the handspreadpages value.

When to Change

When you want to increase the amount of time that pages are potentially resident before being reclaimed. 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

Defines 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

You might change this parameter 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.

You might also change this parameter when the system is subject to bursts of severe memory pressure. A larger value here helps maintain a larger cushion against the pressure.

Commitment Level

Unstable

maxpgio

Description

Defines the 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 number used by the paging system. This parameter is used to throttle the number of requests as well as to control process swapping.

Data Type

Signed integer

Default

40

Range

1 to a variable maximum that depends on the system architecture, but mainly by the I/O subsystem, such as the number of controllers, disks, and disk swap size

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

Increase this parameter to page out memory faster. A larger value might help to recover faster from memory pressure if more than one swap device is configured or if the swap device is a striped device. Note that the existing I/O subsystem should be able to handle the additional I/O load. Also, increased swap I/O could degrade application I/O performance if the swap partition and application files are on the same disk.

Commitment Level

Unstable

Change History

For information, see maxpgio (Solaris 10 Releases).

Previous Next

 
 
  Published under the terms fo the Public Documentation License Version 1.01. Design by Interspire