Documentation
¶
Index ¶
- Variables
- type FileSystemHttpCacheConfig
- func (x *FileSystemHttpCacheConfig) ClearManagerConfig()
- func (x *FileSystemHttpCacheConfig) ClearMaxCacheEntryCount()
- func (x *FileSystemHttpCacheConfig) ClearMaxCacheSizeBytes()
- func (x *FileSystemHttpCacheConfig) ClearMaxEvictionPeriod()
- func (x *FileSystemHttpCacheConfig) ClearMaxIndividualCacheEntrySizeBytes()
- func (x *FileSystemHttpCacheConfig) ClearMinEvictionPeriod()
- func (x *FileSystemHttpCacheConfig) GetCachePath() string
- func (x *FileSystemHttpCacheConfig) GetCacheSubdivisions() uint32
- func (x *FileSystemHttpCacheConfig) GetCreateCachePath() bool
- func (x *FileSystemHttpCacheConfig) GetEvictFraction() float32
- func (x *FileSystemHttpCacheConfig) GetManagerConfig() *v3.AsyncFileManagerConfig
- func (x *FileSystemHttpCacheConfig) GetMaxCacheEntryCount() *wrapperspb.UInt64Value
- func (x *FileSystemHttpCacheConfig) GetMaxCacheSizeBytes() *wrapperspb.UInt64Value
- func (x *FileSystemHttpCacheConfig) GetMaxEvictionPeriod() *durationpb.Duration
- func (x *FileSystemHttpCacheConfig) GetMaxIndividualCacheEntrySizeBytes() *wrapperspb.UInt64Value
- func (x *FileSystemHttpCacheConfig) GetMinEvictionPeriod() *durationpb.Duration
- func (x *FileSystemHttpCacheConfig) HasManagerConfig() bool
- func (x *FileSystemHttpCacheConfig) HasMaxCacheEntryCount() bool
- func (x *FileSystemHttpCacheConfig) HasMaxCacheSizeBytes() bool
- func (x *FileSystemHttpCacheConfig) HasMaxEvictionPeriod() bool
- func (x *FileSystemHttpCacheConfig) HasMaxIndividualCacheEntrySizeBytes() bool
- func (x *FileSystemHttpCacheConfig) HasMinEvictionPeriod() bool
- func (*FileSystemHttpCacheConfig) ProtoMessage()
- func (x *FileSystemHttpCacheConfig) ProtoReflect() protoreflect.Message
- func (x *FileSystemHttpCacheConfig) Reset()
- func (x *FileSystemHttpCacheConfig) SetCachePath(v string)
- func (x *FileSystemHttpCacheConfig) SetCacheSubdivisions(v uint32)
- func (x *FileSystemHttpCacheConfig) SetCreateCachePath(v bool)
- func (x *FileSystemHttpCacheConfig) SetEvictFraction(v float32)
- func (x *FileSystemHttpCacheConfig) SetManagerConfig(v *v3.AsyncFileManagerConfig)
- func (x *FileSystemHttpCacheConfig) SetMaxCacheEntryCount(v *wrapperspb.UInt64Value)
- func (x *FileSystemHttpCacheConfig) SetMaxCacheSizeBytes(v *wrapperspb.UInt64Value)
- func (x *FileSystemHttpCacheConfig) SetMaxEvictionPeriod(v *durationpb.Duration)
- func (x *FileSystemHttpCacheConfig) SetMaxIndividualCacheEntrySizeBytes(v *wrapperspb.UInt64Value)
- func (x *FileSystemHttpCacheConfig) SetMinEvictionPeriod(v *durationpb.Duration)
- func (x *FileSystemHttpCacheConfig) String() string
- type FileSystemHttpCacheConfig_builder
Constants ¶
This section is empty.
Variables ¶
View Source
var File_envoy_extensions_http_cache_file_system_http_cache_v3_file_system_http_cache_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type FileSystemHttpCacheConfig ¶
type FileSystemHttpCacheConfig struct {
// Configuration of a manager for how the file system is used asynchronously.
ManagerConfig *v3.AsyncFileManagerConfig `protobuf:"bytes,1,opt,name=manager_config,json=managerConfig,proto3" json:"manager_config,omitempty"`
// Path at which the cache files will be stored.
//
// This also doubles as the unique identifier for a cache, so a cache can be shared
// between different routes, or separate paths can be used to specify separate caches.
//
// If the same “cache_path“ is used in more than one “CacheConfig“, the rest of the
// “FileSystemHttpCacheConfig“ must also match, and will refer to the same cache
// instance.
CachePath string `protobuf:"bytes,2,opt,name=cache_path,json=cachePath,proto3" json:"cache_path,omitempty"`
// The maximum size of the cache in bytes - when reached, cache eviction is triggered.
//
// This is measured as the sum of file sizes, such that it includes headers, trailers,
// and metadata, but does not include e.g. file system overhead and block size padding.
//
// If unset there is no limit except file system failure.
MaxCacheSizeBytes *wrapperspb.UInt64Value `protobuf:"bytes,3,opt,name=max_cache_size_bytes,json=maxCacheSizeBytes,proto3" json:"max_cache_size_bytes,omitempty"`
// The maximum size of a cache entry in bytes - larger responses will not be cached.
//
// This is measured as the file size for the cache entry, such that it includes
// headers, trailers, and metadata.
//
// If unset there is no limit.
//
// [#not-implemented-hide:]
MaxIndividualCacheEntrySizeBytes *wrapperspb.UInt64Value `` /* 165-byte string literal not displayed */
// The maximum number of cache entries - when reached, cache eviction is triggered.
//
// If unset there is no limit.
MaxCacheEntryCount *wrapperspb.UInt64Value `protobuf:"bytes,5,opt,name=max_cache_entry_count,json=maxCacheEntryCount,proto3" json:"max_cache_entry_count,omitempty"`
// A number of folders into which to subdivide the cache.
//
// Setting this can help with performance in file systems where a large number of inodes
// in a single branch degrades performance. The optimal value in that case would be
// “sqrt(expected_cache_entry_count)“.
//
// On file systems that perform well with many inodes, the default value of 1 should be used.
//
// [#not-implemented-hide:]
CacheSubdivisions uint32 `protobuf:"varint,6,opt,name=cache_subdivisions,json=cacheSubdivisions,proto3" json:"cache_subdivisions,omitempty"`
// The amount of the maximum cache size or count to evict when cache eviction is
// triggered. For example, if “max_cache_size_bytes“ is 10000000 and “evict_fraction“
// is 0.2, then when the cache exceeds 10MB, entries will be evicted until the cache size is
// less than or equal to 8MB.
//
// The default value of 0 means when the cache exceeds 10MB, entries will be evicted only
// until the cache is less than or equal to 10MB.
//
// Evicting a larger fraction will mean the eviction thread will run less often (sparing
// CPU load) at the cost of more cache misses due to the extra evicted entries.
//
// [#not-implemented-hide:]
EvictFraction float32 `protobuf:"fixed32,7,opt,name=evict_fraction,json=evictFraction,proto3" json:"evict_fraction,omitempty"`
// The longest amount of time to wait before running a cache eviction pass. An eviction
// pass may not necessarily remove any files, but it will update the cache state to match
// the on-disk state. This can be important if multiple instances are accessing the same
// cache in parallel. (e.g. if two instances each independently added non-overlapping 10MB
// of content to a cache with a 15MB limit, neither instance would be aware that the limit
// was exceeded without this synchronizing pass.)
//
// If an eviction pass has not happened within this duration, the eviction thread will
// be awoken and perform an eviction pass.
//
// If unset, there will be no eviction passes except those triggered by cache limits.
//
// [#not-implemented-hide:]
MaxEvictionPeriod *durationpb.Duration `protobuf:"bytes,8,opt,name=max_eviction_period,json=maxEvictionPeriod,proto3" json:"max_eviction_period,omitempty"`
// The shortest amount of time between cache eviction passes. This can be used to reduce
// eviction churn, if your cache max size can be flexible. If a cache eviction pass already
// occurred more recently than this period when another would be triggered, that new
// pass is cancelled.
//
// This means the cache can potentially grow beyond “max_cache_size_bytes“ by as much as
// can be written within the duration specified.
//
// Generally you would use *either* “min_eviction_period“ *or* “evict_fraction“ to
// reduce churn. Both together will work but since they're both aiming for the same goal,
// it's simpler not to.
//
// [#not-implemented-hide:]
MinEvictionPeriod *durationpb.Duration `protobuf:"bytes,9,opt,name=min_eviction_period,json=minEvictionPeriod,proto3" json:"min_eviction_period,omitempty"`
// If true, and the cache path does not exist, attempt to create the cache path, including
// any missing directories leading up to it. On failure, the config is rejected.
//
// If false, and the cache path does not exist, the config is rejected.
//
// [#not-implemented-hide:]
CreateCachePath bool `protobuf:"varint,10,opt,name=create_cache_path,json=createCachePath,proto3" json:"create_cache_path,omitempty"`
// contains filtered or unexported fields
}
Configuration for a cache implementation that caches in the local file system.
By default this cache uses a least-recently-used eviction strategy.
For implementation details, see `DESIGN.md <https://github.com/envoyproxy/envoy/blob/main/source/extensions/http/cache/file_system_http_cache/DESIGN.md>`_. [#next-free-field: 11]
func (*FileSystemHttpCacheConfig) ClearManagerConfig ¶
func (x *FileSystemHttpCacheConfig) ClearManagerConfig()
func (*FileSystemHttpCacheConfig) ClearMaxCacheEntryCount ¶
func (x *FileSystemHttpCacheConfig) ClearMaxCacheEntryCount()
func (*FileSystemHttpCacheConfig) ClearMaxCacheSizeBytes ¶
func (x *FileSystemHttpCacheConfig) ClearMaxCacheSizeBytes()
func (*FileSystemHttpCacheConfig) ClearMaxEvictionPeriod ¶
func (x *FileSystemHttpCacheConfig) ClearMaxEvictionPeriod()
func (*FileSystemHttpCacheConfig) ClearMaxIndividualCacheEntrySizeBytes ¶
func (x *FileSystemHttpCacheConfig) ClearMaxIndividualCacheEntrySizeBytes()
func (*FileSystemHttpCacheConfig) ClearMinEvictionPeriod ¶
func (x *FileSystemHttpCacheConfig) ClearMinEvictionPeriod()
func (*FileSystemHttpCacheConfig) GetCachePath ¶
func (x *FileSystemHttpCacheConfig) GetCachePath() string
func (*FileSystemHttpCacheConfig) GetCacheSubdivisions ¶
func (x *FileSystemHttpCacheConfig) GetCacheSubdivisions() uint32
func (*FileSystemHttpCacheConfig) GetCreateCachePath ¶
func (x *FileSystemHttpCacheConfig) GetCreateCachePath() bool
func (*FileSystemHttpCacheConfig) GetEvictFraction ¶
func (x *FileSystemHttpCacheConfig) GetEvictFraction() float32
func (*FileSystemHttpCacheConfig) GetManagerConfig ¶
func (x *FileSystemHttpCacheConfig) GetManagerConfig() *v3.AsyncFileManagerConfig
func (*FileSystemHttpCacheConfig) GetMaxCacheEntryCount ¶
func (x *FileSystemHttpCacheConfig) GetMaxCacheEntryCount() *wrapperspb.UInt64Value
func (*FileSystemHttpCacheConfig) GetMaxCacheSizeBytes ¶
func (x *FileSystemHttpCacheConfig) GetMaxCacheSizeBytes() *wrapperspb.UInt64Value
func (*FileSystemHttpCacheConfig) GetMaxEvictionPeriod ¶
func (x *FileSystemHttpCacheConfig) GetMaxEvictionPeriod() *durationpb.Duration
func (*FileSystemHttpCacheConfig) GetMaxIndividualCacheEntrySizeBytes ¶
func (x *FileSystemHttpCacheConfig) GetMaxIndividualCacheEntrySizeBytes() *wrapperspb.UInt64Value
func (*FileSystemHttpCacheConfig) GetMinEvictionPeriod ¶
func (x *FileSystemHttpCacheConfig) GetMinEvictionPeriod() *durationpb.Duration
func (*FileSystemHttpCacheConfig) HasManagerConfig ¶
func (x *FileSystemHttpCacheConfig) HasManagerConfig() bool
func (*FileSystemHttpCacheConfig) HasMaxCacheEntryCount ¶
func (x *FileSystemHttpCacheConfig) HasMaxCacheEntryCount() bool
func (*FileSystemHttpCacheConfig) HasMaxCacheSizeBytes ¶
func (x *FileSystemHttpCacheConfig) HasMaxCacheSizeBytes() bool
func (*FileSystemHttpCacheConfig) HasMaxEvictionPeriod ¶
func (x *FileSystemHttpCacheConfig) HasMaxEvictionPeriod() bool
func (*FileSystemHttpCacheConfig) HasMaxIndividualCacheEntrySizeBytes ¶
func (x *FileSystemHttpCacheConfig) HasMaxIndividualCacheEntrySizeBytes() bool
func (*FileSystemHttpCacheConfig) HasMinEvictionPeriod ¶
func (x *FileSystemHttpCacheConfig) HasMinEvictionPeriod() bool
func (*FileSystemHttpCacheConfig) ProtoMessage ¶
func (*FileSystemHttpCacheConfig) ProtoMessage()
func (*FileSystemHttpCacheConfig) ProtoReflect ¶
func (x *FileSystemHttpCacheConfig) ProtoReflect() protoreflect.Message
func (*FileSystemHttpCacheConfig) Reset ¶
func (x *FileSystemHttpCacheConfig) Reset()
func (*FileSystemHttpCacheConfig) SetCachePath ¶
func (x *FileSystemHttpCacheConfig) SetCachePath(v string)
func (*FileSystemHttpCacheConfig) SetCacheSubdivisions ¶
func (x *FileSystemHttpCacheConfig) SetCacheSubdivisions(v uint32)
func (*FileSystemHttpCacheConfig) SetCreateCachePath ¶
func (x *FileSystemHttpCacheConfig) SetCreateCachePath(v bool)
func (*FileSystemHttpCacheConfig) SetEvictFraction ¶
func (x *FileSystemHttpCacheConfig) SetEvictFraction(v float32)
func (*FileSystemHttpCacheConfig) SetManagerConfig ¶
func (x *FileSystemHttpCacheConfig) SetManagerConfig(v *v3.AsyncFileManagerConfig)
func (*FileSystemHttpCacheConfig) SetMaxCacheEntryCount ¶
func (x *FileSystemHttpCacheConfig) SetMaxCacheEntryCount(v *wrapperspb.UInt64Value)
func (*FileSystemHttpCacheConfig) SetMaxCacheSizeBytes ¶
func (x *FileSystemHttpCacheConfig) SetMaxCacheSizeBytes(v *wrapperspb.UInt64Value)
func (*FileSystemHttpCacheConfig) SetMaxEvictionPeriod ¶
func (x *FileSystemHttpCacheConfig) SetMaxEvictionPeriod(v *durationpb.Duration)
func (*FileSystemHttpCacheConfig) SetMaxIndividualCacheEntrySizeBytes ¶
func (x *FileSystemHttpCacheConfig) SetMaxIndividualCacheEntrySizeBytes(v *wrapperspb.UInt64Value)
func (*FileSystemHttpCacheConfig) SetMinEvictionPeriod ¶
func (x *FileSystemHttpCacheConfig) SetMinEvictionPeriod(v *durationpb.Duration)
func (*FileSystemHttpCacheConfig) String ¶
func (x *FileSystemHttpCacheConfig) String() string
type FileSystemHttpCacheConfig_builder ¶
type FileSystemHttpCacheConfig_builder struct {
// Configuration of a manager for how the file system is used asynchronously.
ManagerConfig *v3.AsyncFileManagerConfig
// Path at which the cache files will be stored.
//
// This also doubles as the unique identifier for a cache, so a cache can be shared
// between different routes, or separate paths can be used to specify separate caches.
//
// If the same “cache_path“ is used in more than one “CacheConfig“, the rest of the
// “FileSystemHttpCacheConfig“ must also match, and will refer to the same cache
// instance.
CachePath string
// The maximum size of the cache in bytes - when reached, cache eviction is triggered.
//
// This is measured as the sum of file sizes, such that it includes headers, trailers,
// and metadata, but does not include e.g. file system overhead and block size padding.
//
// If unset there is no limit except file system failure.
MaxCacheSizeBytes *wrapperspb.UInt64Value
// The maximum size of a cache entry in bytes - larger responses will not be cached.
//
// This is measured as the file size for the cache entry, such that it includes
// headers, trailers, and metadata.
//
// If unset there is no limit.
//
// [#not-implemented-hide:]
MaxIndividualCacheEntrySizeBytes *wrapperspb.UInt64Value
// The maximum number of cache entries - when reached, cache eviction is triggered.
//
// If unset there is no limit.
MaxCacheEntryCount *wrapperspb.UInt64Value
// A number of folders into which to subdivide the cache.
//
// Setting this can help with performance in file systems where a large number of inodes
// in a single branch degrades performance. The optimal value in that case would be
// “sqrt(expected_cache_entry_count)“.
//
// On file systems that perform well with many inodes, the default value of 1 should be used.
//
// [#not-implemented-hide:]
CacheSubdivisions uint32
// The amount of the maximum cache size or count to evict when cache eviction is
// triggered. For example, if “max_cache_size_bytes“ is 10000000 and “evict_fraction“
// is 0.2, then when the cache exceeds 10MB, entries will be evicted until the cache size is
// less than or equal to 8MB.
//
// The default value of 0 means when the cache exceeds 10MB, entries will be evicted only
// until the cache is less than or equal to 10MB.
//
// Evicting a larger fraction will mean the eviction thread will run less often (sparing
// CPU load) at the cost of more cache misses due to the extra evicted entries.
//
// [#not-implemented-hide:]
EvictFraction float32
// The longest amount of time to wait before running a cache eviction pass. An eviction
// pass may not necessarily remove any files, but it will update the cache state to match
// the on-disk state. This can be important if multiple instances are accessing the same
// cache in parallel. (e.g. if two instances each independently added non-overlapping 10MB
// of content to a cache with a 15MB limit, neither instance would be aware that the limit
// was exceeded without this synchronizing pass.)
//
// If an eviction pass has not happened within this duration, the eviction thread will
// be awoken and perform an eviction pass.
//
// If unset, there will be no eviction passes except those triggered by cache limits.
//
// [#not-implemented-hide:]
MaxEvictionPeriod *durationpb.Duration
// The shortest amount of time between cache eviction passes. This can be used to reduce
// eviction churn, if your cache max size can be flexible. If a cache eviction pass already
// occurred more recently than this period when another would be triggered, that new
// pass is cancelled.
//
// This means the cache can potentially grow beyond “max_cache_size_bytes“ by as much as
// can be written within the duration specified.
//
// Generally you would use *either* “min_eviction_period“ *or* “evict_fraction“ to
// reduce churn. Both together will work but since they're both aiming for the same goal,
// it's simpler not to.
//
// [#not-implemented-hide:]
MinEvictionPeriod *durationpb.Duration
// If true, and the cache path does not exist, attempt to create the cache path, including
// any missing directories leading up to it. On failure, the config is rejected.
//
// If false, and the cache path does not exist, the config is rejected.
//
// [#not-implemented-hide:]
CreateCachePath bool
// contains filtered or unexported fields
}
func (FileSystemHttpCacheConfig_builder) Build ¶
func (b0 FileSystemHttpCacheConfig_builder) Build() *FileSystemHttpCacheConfig
Source Files
¶
- file_system_http_cache.pb.go
Click to show internal directories.
Click to hide internal directories.