-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cache) use a different shm for cache misses
Following this mlcache patch: thibaultcha/lua-resty-mlcache#42 We can now specify a different shm for mlcache to cache L3 misses. This is especially helpful in the context of Kong since client-triggered DB lookups can have a very high cardinality of keys to fetch (e.g. credentials such as API keys) and can make the cache turnover so high that it can be rendered almost useless (filled with misses, thus evicting actual hits from the cache shm). This is considered as a potential attack vector. The size of this shm (12MB) allows for roughly ~45,000 nil sentinel values to be stored in the shm (depending on the size of the keys). This value is aligned with that chosen for the rate-limiting shared dict in PR #3311 (12MB and about ~48,000 simultaneous counters).
- Loading branch information
1 parent
602404f
commit f1a830f
Showing
5 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters