mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-03 12:20:27 +08:00
使用MMAP提升缓存读取性能
This commit is contained in:
@@ -96,7 +96,7 @@ func (this *HTTPCachePolicy) UpdateDiskDir(dir string, subDirs []*CacheDir) {
|
||||
return
|
||||
}
|
||||
|
||||
var options = &HTTPFileCacheStorage{}
|
||||
var options = NewHTTPFileCacheStorage()
|
||||
err = json.Unmarshal(oldOptionsJSON, options)
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
@@ -16,6 +16,14 @@ type HTTPFileCacheStorage struct {
|
||||
|
||||
OpenFileCache *OpenFileCacheConfig `yaml:"openFileCache" json:"openFileCache"` // open file cache配置
|
||||
EnableSendfile bool `yaml:"enableSendFile" json:"enableSendfile"` // 是否启用Sendfile
|
||||
|
||||
EnableMMAP bool `yaml:"enableMMAP" json:"enableMMAP"` // 是否启用MMAP
|
||||
}
|
||||
|
||||
func NewHTTPFileCacheStorage() *HTTPFileCacheStorage {
|
||||
return &HTTPFileCacheStorage{
|
||||
EnableMMAP: true,
|
||||
}
|
||||
}
|
||||
|
||||
func (this *HTTPFileCacheStorage) Init() error {
|
||||
|
||||
Reference in New Issue
Block a user