. |
Status Caching Overview When using client/server, data for specific functions can be cached on the client side. This feature is useful for optimizing performance with applications that continuously poll controller data via client/server. With caching enabled, certain MPI status methods will get status values that are stored locally in a cache. Multiple small client/server transactions are replaced with one large client/server transaction to refresh the cache. This technique takes advantage of Ethernet's ability to send large packets more efficiently than small packets. The following methods in the MPI library configure and handle status caching.
The Refresh Interval To enable caching, a non-zero refresh interval is designated by the user. The interval specifies how old the cache data can be and still be considered valid. The cache is refreshed from the server in two ways:
Optimizing the Refresh Interval Setting the cache refresh interval to less than the time it takes to actually refresh the cache can negatively impact system performance by causing all calls to a cache dependant function to trigger a cache refresh. On the other hand, a cache refresh interval that is too large will cause unnecessarily old data to be returned from the status functions that use the cache. The optimal cache refresh interval for a particular application and system can be determined by running the application with the refresh interval set to 100 milliseconds (a large value). After the application has run for a period of time, use the mpiControlStatusCacheStatistics function to get the average cache refresh time. The optimal refresh interval should be set to slightly higher than the average refresh time. Cached Functions In version 03.04.11 (and later), the following functions will utilize the cache: meiSqNodeDriveMonitor If an application does not use a separate thread to periodically refresh the cache, then a status call will occasionally take longer than usual while it makes the call to the server to refresh all cached data.
|
| | Copyright © 2001-2021 Motion Engineering |