Configuring request and retry timeout values
You can supply tuning options to control how long the eXtreme Scale client code waits for requests to complete, and for how long it attempts to retry requests that are associated with accessing the data grid.
About this task
You can configure settings for the eXtreme Scale client that control how long the client attempts to create network connections, how long the client attempts to process a data grid request to a partition, and how long it attempts to retry that request to the partition, before it returns an exception to your application.
Factors for tuning request and retry timeout values in IBM eXtremeIO (XIO) and Object Request Broker (ORB)
For some tuning options, where you set the values depends on which transport you are using, either XIO or ORB. These transport-level tuning options have the initial impact on interactions with your client because they govern how long the transport attempts network socket connections and how long an individual remote procedure call (RPC) analogous to a data grid operation is given to complete.
- Network latencies
- Coupling of grid interactions with external resources like databases
- Garbage collection pauses resulting from your combination of heap size, heap usage, and garbage collection tuning policies
ORB settings for tuning request and retry timeout values
- com.ibm.CORBA.ConnectionTimeout
- Specifies the amount of time that the ORB attempts to create a socket connection with the remote location before the attempts time out. The ORB caches these connections, and therefore, this operation is not done on every request.
- com.ibm.CORBA.RequestTimeout
- Specifies the amount of time that the ORB waits for an RPC to complete before timing out.
- com.ibm.CORBA.FragmentTimeout
- Reference the IBM ORB documentation for precise details. The product provides default settings for this value.
- com.ibm.CORBA.LocateRequestTimeout
- Reference the IBM ORB documentation for precise details. The product provides default settings for this value.
- com.ibm.CORBA.SocketWriteTimeout
- Specifies how many seconds a socket write waits before giving up.
As you tune the RequestTimeout and ConnectionTimeout settings, adjusting them based on the default recommendations can be appropriate. You can also set these settings with the same value, where you define these settings that are based on how long you want the request timeout to be.
XIO settings for tuning request and retry timeout values
- The xioTimeout setting determines how long the XIO transport attempts to establish a network socket connection.
- There is no equivalent to the LocateRequest setting and the FragmentTimeout setting in the ORB.
- The xioRequestTimeout value specifies how many seconds any request waits for a response before giving up. This property influences the amount of time a client takes to fail over if a network outage failure occurs. If you set this property too low, requests might time out inadvertently. Carefully consider the value of this property to prevent inadvertent timeouts.
Common settings for tuning request and retry timeout values
- Asynchronously asks the catalog server for the latest routing table in case partitions are located elsewhere because of a failover.
- Takes new routes and retries the request, or stops trying and throws an exception to your application.
The requestRetryTimeout property is set in milliseconds. Set the value greater than zero for the request to be retried on exceptions for which retry is available. Set the value to 0 to fail without retries on exceptions. To use the default behavior, remove the property or set the value to -1.
XIO failture detection
The properties, xioRequestTimeout, xioTimeout, and requestRetryTimeout have an impact on the XIO failure detection system, in that the clients will be quicker to tell the catalog that a container might be failing, and therefore, trigger the catalog to attempt communication with the container. Where a failure exists, shard failure recovery is initiated for the container shards. Similarly, catalog calls to containers over XIO are governed by the xioRequestTimeout and xioTimeout properties.
Ways to set request retry timeout
You can configure the request retry timeout value on the client properties file or in a session. The session value overrides the client properties setting. If the value is set to greater than zero, the request is tried until either the timeout condition is met or a permanent failure occurs. A permanent failure might be a DuplicateKeyException exception. A value of zero indicates the fail-fast mode setting and the data grid does not attempt to try the transaction again after any type of transaction.
Transaction timeout and request retry timeout
During run time, the transaction timeout value is used with the request retry timeout value, ensuring that the request retry timeout does not exceed the transaction timeout.
- For transactions that are called within a session, transactions are tried again for ORB CORBA SystemException (TransportException for XIO) and eXtreme Scale client TargetNotAvailable exceptions.
- Autocommit transactions are tried again for CORBA SystemException and eXtreme Scale client availability exceptions. These exceptions include the ReplicationVotedToRollbackTransactionException, TargetNotAvailable, and AvailabilityException exceptions.
Application or other permanent failures return immediately and the client does not try the transaction again. These permanent failures include the DuplicateKeyException and KeyNotFoundException exceptions. Use the fail-fast setting to return all exceptions without trying transactions again after any exceptions.
- ReplicationVotedToRollbackTransactionException (only on autocommit)
- TargetNotAvailable
- org.omg.CORBA.SystemException (TransportException is the XIO equivalent of this ORB system exception.)
- AvailabilityException (only on autocommit)
- LockTimeoutException (only on autocommit)
- UnavailableServiceException (only on autocommit)
- DuplicateKeyException
- KeyNotFoundException
- LoaderException
- TransactionAffinityException
- LockDeadlockException
- OptimisticCollisionException
Procedure
Example
10
seconds, and the
xioTimeout property matches the ORB ConnectionTimeout
value, which is 5
seconds.
Grid Type | ORB | XIO |
---|---|---|
A Java™ or .NET client application that accesses an eXtreme Scale API directly |
|
Modify the objectGridClient.properties file for your
client application with the following values:
|
HTTP session | Same ORB configuration as a Java or .NET client application that accesses an eXtreme Scale API directly | Same XIO configuration as a Java or .NET client application that accesses an eXtreme Scale API directly |
Dynamic cache | Same ORB configuration as a Java or
.NET client application that accesses an eXtreme Scale API
directly. For dynamic cache instances, you can set the following additional property on the cache instance:
|
Same XIO configuration as a Java or .NET
client application that accesses an eXtreme Scale API directly.
For dynamic cache instances, you can set the following additional property on the cache instance:
|