SCSPREFETCH

Enable READS prefetching and WRITES/PUTS buffering for xfServer

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX

 

The SCSPREFETCH environment variable enables READS prefetch support and WRITES/PUTS buffering by defining the maximum amount of memory to use for the buffer.

A number between 0 and 32, inclusive, that specifies the size of the prefetch buffer in kilobytes. Prefetching is off by default. Once prefetching is on, you can turn it off by setting SCSPREFETCH to 0.

To improve sequential READS performance when using xfServer, a prefetch feature is available that enables the client to prefetch (or buffer) sequential READS of records for files of any type that are open in input mode, relative files that are open for update, or ISAM files that are open for update and use the LOCK:Q_NO_TLOCK option. An intervening WRITE, DELETE, or STORE statement turns off the cache.

Similarly, buffering records improves sequential WRITES and PUTS performance, because it enables the client to temporarily hold sequential records and then write them to the server all at once. Buffering is used with relative and sequential files that are opened in output or append mode (WRITES) and with stream files that are opened in output or append mode (WRITES or PUTS). Buffering does not occur when WRITES is used with the GETRFA option.

The SCSPREFETCH environment variable controls both prefetching and buffering by enabling them to be turned on or off.

Note

To enable or disable this feature on a file-by-file basis, regardless of the environment setting, use the SETLOG routine to set or clear SCSPREFETCH prior to the OPEN statement. The value of SCSPREFETCH is checked on every remote file open. (Note that after you open a file with SCSPREFETCH set, you cannot turn prefetching off on that channel until you close and reopen the file with SCSPREFETCH set to 0.)

We recommend that you set SCSPREFETCH to 8 initially and then change it if necessary. If SCSPREFETCH is set to an invalid value, a default value of 8 will be used.

The SCSPREFETCH value is also used by the /bufstore option of the OPTIONS qualifier on the OPEN statement if it is set, but it does not turn that option on or off. If SCSPREFETCH is not set, /bufstore uses a default value of 8 (i.e., 8K).

When a remote file is opened to xfServer with /sequential, any READS operation that includes the LOCK qualifier Q_NO_LOCK will enable SCSPREFETCH to improve performance.

To improve performance of record retrieval using Select, the SCSPREFETCH environment variable must be set before opening the channel specified in the From, and that file must be open for input only. When using Join, SCSPREFETCH is enabled by default (starting in version 10.3.3f).

On the client, the environment or the [synergy], [dbr], or [myprog] section of synergy.ini (where myprog is any .dbr file).

xfServer

On UNIX,

SCSPREFETCH=8    ;export SCSPREFETCH

The code below is an example of enabling and disabling SCSPREFETCH on a file-by-file basis:

xcall getlog('SCSPREFETCH', tmp_pre_val, tmp_len)       ;Check if prefetch is already set
xcall setlog('SCSPREFETCH', '16', tmp_status)           ;If not, set prefetch
.
.
.
xcall setlog('SCSPREFETCH', '0', tmp_status)            ;Reset after processing