cmcfarlen commented on code in PR #12717: URL: https://github.com/apache/trafficserver/pull/12717#discussion_r2761133393
########## doc/admin-guide/files/volume.config.en.rst: ########## @@ -73,20 +73,65 @@ Optional directory entry sizing You can also add an option ``avg_obj_size=<size>`` to the volume configuration line. This overrides the global :ts:cv:`proxy.config.cache.min_average_object_size` -configuration for this volume. This is useful if you have a volume that is dedicated -for say very small objects, and you need a lot of directory entries to store them. +configuration for this volume. The size supports multipliers (K, M, G, T) for +convenience (e.g., ``avg_obj_size=64K`` or ``avg_obj_size=1M``). This is useful +if you have a volume that is dedicated for say very small objects, and you need +a lot of directory entries to store them. Optional fragment size setting ------------------------------ You can also add an option ``fragment_size=<size>`` to the volume configuration line. This overrides the global :ts:cv:`proxy.config.cache.target_fragment_size` -configuration for this volume. This allows for a smaller, or larger, fragment size -for a particular volume. This may be useful together with ``avg_obj_size`` as well, -since a larger fragment size could reduce the number of directory entries needed -for a large object. +configuration for this volume. The size supports multipliers (K, M, G, T) for +convenience (e.g., ``fragment_size=512K`` or ``fragment_size=2M``). This allows +for a smaller, or larger, fragment size for a particular volume. This may be +useful together with ``avg_obj_size`` as well, since a larger fragment size could +reduce the number of directory entries needed for a large object. -Note that this setting has a maximmum value of 4MB. +Note that this setting has a maximum value of 4MB. + +Optional RAM cache size allocation +----------------------------------- + +You can add an option ``ram_cache_size=<size>`` to the volume configuration line +to allocate a dedicated RAM cache pool for this volume. The size supports +multipliers (K, M, G, T) for convenience (e.g., ``ram_cache_size=512M`` or +``ram_cache_size=2G``). Setting ``ram_cache_size=0`` disables the RAM cache +for this volume, which is equivalent to ``ramcache=false``. + +When ``ram_cache_size`` is specified for a volume, that amount is **automatically +subtracted** from the global :ts:cv:`proxy.config.cache.ram_cache.size` setting, +and the remainder is shared among volumes without private allocations. This ensures +total RAM cache usage never exceeds the configured global limit. + +For example, if the global RAM cache size is 4GB and you allocate 1GB to volume 1 +and 512MB to volume 2, the remaining 2.5GB will be distributed among other volumes +using the normal proportional allocation based on disk space. + +**Important notes:** + +* If the sum of all ``ram_cache_size`` allocations exceeds the global RAM cache size, + a warning is logged and the private allocations are disabled, falling back to + the standard shared allocation. Review Comment: Should it also be an error if `ramcache=false` and `ram_cache_size` is specified? Or just make sure not to subtract from `ram_cache.size` if the size is specified and `ramcache=false`? ########## doc/admin-guide/files/volume.config.en.rst: ########## @@ -73,20 +73,65 @@ Optional directory entry sizing You can also add an option ``avg_obj_size=<size>`` to the volume configuration line. This overrides the global :ts:cv:`proxy.config.cache.min_average_object_size` -configuration for this volume. This is useful if you have a volume that is dedicated -for say very small objects, and you need a lot of directory entries to store them. +configuration for this volume. The size supports multipliers (K, M, G, T) for +convenience (e.g., ``avg_obj_size=64K`` or ``avg_obj_size=1M``). This is useful +if you have a volume that is dedicated for say very small objects, and you need +a lot of directory entries to store them. Optional fragment size setting ------------------------------ You can also add an option ``fragment_size=<size>`` to the volume configuration line. This overrides the global :ts:cv:`proxy.config.cache.target_fragment_size` -configuration for this volume. This allows for a smaller, or larger, fragment size -for a particular volume. This may be useful together with ``avg_obj_size`` as well, -since a larger fragment size could reduce the number of directory entries needed -for a large object. +configuration for this volume. The size supports multipliers (K, M, G, T) for +convenience (e.g., ``fragment_size=512K`` or ``fragment_size=2M``). This allows +for a smaller, or larger, fragment size for a particular volume. This may be +useful together with ``avg_obj_size`` as well, since a larger fragment size could +reduce the number of directory entries needed for a large object. -Note that this setting has a maximmum value of 4MB. +Note that this setting has a maximum value of 4MB. + +Optional RAM cache size allocation +----------------------------------- + +You can add an option ``ram_cache_size=<size>`` to the volume configuration line +to allocate a dedicated RAM cache pool for this volume. The size supports +multipliers (K, M, G, T) for convenience (e.g., ``ram_cache_size=512M`` or +``ram_cache_size=2G``). Setting ``ram_cache_size=0`` disables the RAM cache +for this volume, which is equivalent to ``ramcache=false``. + +When ``ram_cache_size`` is specified for a volume, that amount is **automatically +subtracted** from the global :ts:cv:`proxy.config.cache.ram_cache.size` setting, +and the remainder is shared among volumes without private allocations. This ensures +total RAM cache usage never exceeds the configured global limit. + +For example, if the global RAM cache size is 4GB and you allocate 1GB to volume 1 +and 512MB to volume 2, the remaining 2.5GB will be distributed among other volumes +using the normal proportional allocation based on disk space. + +**Important notes:** + +* If the sum of all ``ram_cache_size`` allocations exceeds the global RAM cache size, + a warning is logged and the private allocations are disabled, falling back to + the standard shared allocation. Review Comment: Should this be a fatal error on startup? It might be hard to notice a warning and otherwise traffic_server would run with unexpected config. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
