OpenLiberty / blogs

Blog posts for https://openliberty.io
https://openliberty.io/blog/
Other
10 stars 71 forks source link

Standard Feature Blog post -Configuring Quiesce Timeout in Open Liberty 23.0.0.12 #3419

Open jimblye opened 10 months ago

jimblye commented 10 months ago

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:

  1. Chain Quiesce Timeout: This timeout is configurable on the <channelfw> element of server.xml and 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.

  2. 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 --timeout option 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:

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. 


GraceJansen commented 3 weeks ago

Hi @jimblye is this still a blog you'd like to write? Sounds like a great topic and it looks as if you already have a lot of the content planned out, so it would be great to have if you're still interested in writing it