php8.5
Home/ Manual/ reference / yac/ Yac ConfigureOptions

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

NameDefaultChangeableChangelog
yac.compress_threshold4KINI_SYSTEM
yac.debug0INI_ALL
yac.enable1INI_SYSTEM
yac.enable_cli0INI_SYSTEM
yac.keys_memory_size8MINI_SYSTEM
yac.serializerphpINI_SYSTEM
yac.values_memory_size64MINI_SYSTEM

Title

yac.compress_thresholdint

Serialized values larger than this number of bytes are compressed (with LZ4, since Yac 2.4.0) before being stored. Values above the 1M stored entry limit (YAC_MAX_RAW_COMPRESSED_LEN) are always compressed regardless of this setting, because they cannot be stored uncompressed. The default of 4K enables compression; -1 disables it for values below the stored entry limit, and other positive values are clamped to the 1024..1M range. Compressing large values saves shared memory at the cost of some CPU on both store and retrieve.

yac.debugint

Reserved for debugging. As of Yac 2.4.0 this directive is registered but has no effect.

yac.enableint

Whether Yac is enabled. If disabled, creating a Yac instance throws an exception.

yac.enable_cliint

Whether Yac is enabled when running under the CLI SAPI. 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_sizestring

Amount of shared memory for the table of keys. It caps how many entries can exist at once — the default of 8M gives around 65,536 entries. Raise this when the hit rate drops and kicks climb; see yac.memory-management for how a full table behaves and when that actually matters.

yac.values_memory_sizestring

Amount 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 recycles climb while slots still have room, or enable yac.compress_threshold to shrink large payloads. See yac.memory-management.

yac.serializerstring

Serializer used to turn arbitrary PHP values into bytes before storing them. Allowed values are php (the default), json, igbinary and msgpack. The latter three require the extension to be built with the corresponding support. Binary serializers such as igbinary and msgpack are typically faster and produce smaller payloads than php.

Source: reference/yac/ini.xml · from the official PHP manual (php/doc-en)