Receive Spin Limit Tuning

The default values for receive spin limit yield good performance in many situations. When necessary, administrators can adjust receive spin limit as a parameter of individual transport definitions.

Goal: Minimal Latency

Blocking frees CPU resources for other threads. However, if minimal latency is crucial and CPU resources are plentiful, then you can avoid blocking by adjusting receive spin limit.

If unacceptable latency spikes occur during conditions of sparse message traffic, one possible cause could be that messages arrive shortly after the receive spin limit has elapsed, so the polling thread has recently blocked. In this situation, consider increasing the receive spin limit to a value that is greater than the maximum expected time between messages. Select a value that is large enough to prevent threads from blocking between consecutive messages. Test the results empirically.

Warning: Coordinate with developers to understand the thread behavior of application programs. When the application program creates many dispatch threads, use caution when increasing receive spin limits. Avoid starving threads by monopolizing CPU resources.

Goal: Optimization of CPU Resources

If CPU resources are scarce or expensive, then consider decreasing the receive spin limit so threads that are waiting for data relinquish their CPU resources to do other work.

Zero is an acceptable value. With this value, the TIBCO FTL library polls for available data only once. If data is not available, then the library code blocks immediately.