mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-06 10:00:25 +08:00
降低ttlcache最大内存增量
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
|||||||
// 最大的缓存时间为30 * 86400
|
// 最大的缓存时间为30 * 86400
|
||||||
// Piece数据结构:
|
// Piece数据结构:
|
||||||
// Piece1 | Piece2 | Piece3 | ...
|
// Piece1 | Piece2 | Piece3 | ...
|
||||||
// [ Item1, Item2, ... | ...
|
// [ Item1, Item2, ... ] | ...
|
||||||
// KeyMap列表数据结构
|
// KeyMap列表数据结构
|
||||||
// { timestamp1 => [key1, key2, ...] }, ...
|
// { timestamp1 => [key1, key2, ...] }, ...
|
||||||
type Cache struct {
|
type Cache struct {
|
||||||
@@ -26,7 +26,7 @@ func NewCache(opt ...OptionInterface) *Cache {
|
|||||||
countPieces := 128
|
countPieces := 128
|
||||||
maxItems := 2_000_000
|
maxItems := 2_000_000
|
||||||
|
|
||||||
var delta = systemMemoryGB() / 4
|
var delta = systemMemoryGB() / 8
|
||||||
if delta > 0 {
|
if delta > 0 {
|
||||||
maxItems *= delta
|
maxItems *= delta
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user