Understanding passivation and requestor timeouts |
Passivation allows a requestor, service, or clipboard page to be saved into the PegaRULES database and reactivated later. A background process known as the passivation daemon converts the in-memory state and clipboard information into database rows, making the memory available for other uses. The reverse process is known as activation.
Passivation is controlled through the prconfig.xml
file or Dynamic System Settings. The passivation daemon wakes once a minute to handle passivations.
Passivation occurs through three distinct mechanisms:
Passivation frees up JVM memory, making more memory available to other requestors. In addition, Timeout passivation has security benefits, and HTTP passivation has failover benefits.
Idle pages within an otherwise active requestor session may indicate a design or implementation issue that merits research. Ensure that your processing creates only pages that are needed, and removes them when they are no longer needed.
Where passivation information is saved
Passivation details can be saved either as disk files on each PRPC server, or as database rows in the PegaRULES database. Which option you choose determines which passivation features are available.
By default, passivation details are saved as files on each PRPC server. This corresponds to the following prconfig.xml
file setting:
<env name="initialization/persistrequestor/storage"
value="file system" />
As an alternative to the prconfig.xml file, you can use Dynamic System Settings to configure your application.
See How to create or update a prconfig setting.
The saved information is converted to Java serialization file (SER file type) in a directory named PassivationData, a subdirectory of the temporary files directory. For performance reasons, files are distributed in up to 36 subdirectories of this directory.
On a large system, ensure that adequate disk space is available for these files. Optionally, you can use tactics such as disk striping and RAID over multiple disks for maximum performance. Through a symbolic link, you can place this directory on a dedicated high-performance disk or disk array.
In releases before V5.5, passivation details are saved in the PegaRULES database. This is no longer the default for V5.5+.
To save passivation details in the database rather than the server file system, add the following setting to the prconfig.xml
file.
<env name="initialization/persistrequestor/storage" value="database" />
As an alternative to the prconfig.xml file, you can use Dynamic System Settings to configure your application.
See How to create or update a prconfig setting.
When this option is set, the passivation daemon saves requestor information as an instance of the System-Requestor-Context class, corresponding to the pr_sys_context
database table. The daemon saves page details as an instance of the System-SavedPages class in the pr_page_store
database table.
To recover database space, the system automatically purges pages saved through this mechanism after three days.
When a requestor creates a page but does not access it for a long period, the passivation daemon may passivate the page class, and remove it from the clipboard. Other pages for that requestor remain in memory; requestor processing can continue normally until that page is needed (for read access or for update). On demand, the page is reactivated into memory.
Similarly, when an entire Thread or requestor is inactive, the Thread context or requestor context can be passivated (including the associated clipboard pages).
By default, the passivation daemon passivates:
Typically, page passivation improves performance for production systems that may have 50 or more simultaneously connected requestors (not counting agents). For smaller systems (with adequate JVM memory), the benefits may be small or nil.
To disable page passivation, add the following element to the prconfig.xml
file:
<env "initialization/persistrequestor/usepagelevelpassivation" value="false" />
As an alternative to the prconfig.xml file, you can use Dynamic System Settings to configure your application.
See How to create or update a prconfig setting.
When enabled (through Initialization/PersistRequestor
entries in the prconfig.xml
file or Dynamic System Setting), each HTTP requestor session can be saved after a specific time period of no activity.
To enable timeout passivation, use the following prconfig.xml
setting:
<env name="Initialization/PersistRequestor" value="OnTimeout"/>
To prevent timeout passivation, use the Never
value:
<env name="Initialization/PersistRequestor" value="Never"/>
If the PersistRequestor
element is not present, the system assumes OnTimeout
.
As an alternative to the prconfig.xml file, you can use Dynamic System Settings to configure your application.
See How to create or update a prconfig setting.
Passivated users are not automatically required to reauthenticate upon activation. The V4.X setting Initialization/NoAuthenticateOnActivate
defaults to true for V5.5 systems. As a best practice, do not override this default setting; other mechanisms may cause users to be prompted for credentials.
Passivation at HTTP interaction end
In a multinode cluster (with appropriate configuration), requestor passivation can promote high availability and load balancing across nodes, since the reactivated session can resume on a different node than the node that previously supported the user. (The previous node may be down or busy.)
Passivation also frees JVM memory, making more memory available to other requestors.
To support this capability, add the following entries to the prconfig.xml
file or Dynamic System Settings:
<env name="initialization/persistrequestor/storage" value="database" />
<env name="Initialization/PersistRequestor" value="AtInteractionEnd"/>
The system saves requestor state and user pages into the PegaRULES database at the end of each user interaction. This provides potentially higher availability, but with greater overhead. Each user interaction with the browser may involve multiple HTTP messages and responses from the server. To minimize overhead, the passivation daemon attempts to passivate only after the final HTTP response in a series (which is determined by observing a 30-second pause).
HTTP passivation to support failover in a cluster can occur only when passivation details are saved to the PegaRULES database, rather than the file system.
For IAC users, who access a PRPC application through a web node, passivation occurs at HTTP interaction end occurs always. The value of the Initialization/PersistRequestor
setting does not affect these users.
Troubleshooting long-lived pages
Clipboard pages that remain unused for long periods may indicate a design or implementation flaw that can hurt performance; the application created a page but neglected to use the Page-Remove method to remove the page after it was no longer needed.
When building or testing an application, you can discover whether your own processing has created such "orphan" or "near-orphan" page:
Reporting on passivated requestors
To see a list of passivated requestors on the PegaRULES database, open and run the standard list view report System-Requestor-Context.RequestorContextList.ALL. This information is also available from the System Management Application:
When a user exits a requestor session by logging off, all user clipboard pages are erased, including those pages not explicitly saved to the PegaRULES database by the Obj-Save method and Commit method. No passivation occurs.
Agent requestors have a BATCH
requestor type. They are never passivated.
V4.2 includes an additional PersistRequestor
value UseHTTPSession
. This setting is not functional in V5.X.
daemon, passivation, persistent object, prconfig.xml file, timeouts |