Yac ConfigureOptions
Yac ConfigureOptionsNameDefaultChangeableChangelogyac.compress_threshold4KINI_SYSTEMyac.debug0INI_ALLyac.enable1INI_SYSTEMyac.enable_cli0INI_SYSTEMyac.keys_memory_size8MINI_SYSTEMyac.serializerphpINI_SYSTEMyac.values_memory_size64MINI_SYSTEM
Runtime Runtime
| Name | Default | Changeable | Changelog |
|---|---|---|---|
| yac.compress_threshold | 4K | INI_SYSTEM | |
| yac.debug | 0 | INI_ALL | |
| yac.enable | 1 | INI_SYSTEM | |
| yac.enable_cli | 0 | INI_SYSTEM | |
| yac.keys_memory_size | 8M | INI_SYSTEM | |
| yac.serializer | php | INI_SYSTEM | |
| yac.values_memory_size | 64M | INI_SYSTEM |
Title
yac.compress_thresholdintSerialized values larger than this number of bytes are compressed (with LZ4, since Yac 2.4.0) before being stored. Values above the
1Mstored entry limit (YAC_MAX_RAW_COMPRESSED_LEN) are always compressed regardless of this setting, because they cannot be stored uncompressed. The default of4Kenables compression;-1disables it for values below the stored entry limit, and other positive values are clamped to the1024..1Mrange. Compressing large values saves shared memory at the cost of some CPU on both store and retrieve.yac.debugintReserved for debugging. As of Yac 2.4.0 this directive is registered but has no effect.
yac.enableintWhether Yac is enabled. If disabled, creating a
Yacinstance throws an exception.yac.enable_cliintWhether Yac is enabled when running under the
CLISAPI. It is disabled by default because command line scripts usually start and stop immediately, and the shared memory segment would be created for nothing.yac.keys_memory_sizestringAmount of shared memory for the table of keys. It caps how many entries can exist at once — the default of
8Mgives around 65,536 entries. Raise this when the hit rate drops andkicksclimb; see yac.memory-management for how a full table behaves and when that actually matters.yac.values_memory_sizestringAmount of shared memory for storing values. Values are allocated in a bump allocator over segments of 4M each; when no segment has room for a new value, an allocator cursor wraps and the oldest values are silently overwritten ("recycled"). Their reads then degrade to misses, detected by an integrity guard. Enlarge this if
recyclesclimb while slots still have room, or enable yac.compress_threshold to shrink large payloads. See yac.memory-management.yac.serializerstringSerializer used to turn arbitrary PHP values into bytes before storing them. Allowed values are
php(the default),json,igbinaryandmsgpack. The latter three require the extension to be built with the corresponding support. Binary serializers such asigbinaryandmsgpackare typically faster and produce smaller payloads thanphp.