OpenLiberty / OpenLiberty/blogs
Standard Feature Blog post -Configuring Quiesce Timeout in Open Liberty 23.0.0.12
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 11
- Forks
- 77
- Avg merge
- 18h 4m
- Merged PRs (30d)
- 27
Description
Title: Configuring Quiesce Timeout in Open Liberty 23.0.0.12
There is a new capability in Open Liberty 23.0.0.12 that allows users to configure the server's quiesce timeout. This feature enables developers and administrators to manage server shutdowns more effectively, ensuring that applications have sufficient time to gracefully complete their operations.
Understanding Quiesce Timeout
The quiesce timeout is a period of time during server shutdown when the server stops accepting inbound requests and waits for existing threads to complete processing of existing requests. Until now, the quiesce timeout was hard-coded to 30 seconds. The minimum timeout value you can set is 30 seconds. If you set a value less than 30 seconds, the value 30 seconds will be used instead.
How to Configure Quiesce Timeout
To customize the quiesce timeout, add the quiesceTimeout attribute to the <applicationManager> element in the server.xml configuration file. For example, <applicationManager quiesceTimeout="1m30s"/> sets the quiesce timeout to 1 minute and 30 seconds.
Other Configurable Timeouts
Open Liberty has two other configurable timeouts related to server shutdown:
-
Chain Quiesce Timeout: This timeout is configurable on the
<channelfw>element ofserver.xmland governs how long channel chains, or endpoints, are allowed to complete existing request/response exchanges before being forced to close. A channel chain is a collection of associated channels (such as TCP, SSL, and HTTP channels) that make up an endpoint. By default, the timeout is set to 30 seconds. -
Server Stop Command Timeout: When issuing the server stop command, the server script sends the stop command to the server and waits for the server to complete shutdown. The server script can be thought of as a client, and it simply waits for the server to shut down. If the command times out, it could mean that the server is hung or that the server needs more time to shut down. When this occurs, the client simply terminates with an error code, but the server process continues. In this case, the server might need to be terminated manually. By default, the client waits up to 30 seconds. Users can configure this timeout using the
--timeoutoption on the server stop command, aligning it with the application's specific shutdown requirements.
Managing Timeout Relationships
It's important to understand the relationships between these timeout values:
-
The
application manager quiesce timeouttakes precedence over thechain quiesce timeout. When the application manager quiesce timeout expires, the server terminates, regardless of the state of existing requests or the time left on the chain quiesce timeout. Therefore, it is recommended to set the chain quiesce timeout to a value less than or equal to the application manager quiesce timeout. -
Align the
server stop command timeoutwith theapplication manager quiesce timeoutto ensure a graceful server shutdown. The timeout value for the server stop command should be determined by the length of time it normally takes for the Liberty server to shut down in your environment. Simply add an acceptable "grace period" to that time and set that as your timeout value.
Using the --force Option
To immediately shut down the server, Open Liberty provides the --force option on the server stop command, allowing the server to skip the quiesce stage and shut down immediately. However, be aware that a forced server shutdown does not allow time for requests already in progress to finish processing.
Conclusion
The ability to configure the quiesce timeout provides users with enhanced control over server shutdown behavior, enabling them to tailor timeouts to specific application requirements.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file or test is identified; use the issue text as the source for a standard feature blog post. Preserve the documented configuration examples and timeout relationships involving server.xml and the server stop command, and consider the work done when the post is formatted consistently with the repository's blog conventions.
Written by the indexing model from the issue text.
Assessment
- Domain
- content, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100