mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Allow caching based on a configurable number of hits. (#8891)
Co-authored-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
@@ -13,16 +13,19 @@ minio gateway <name> -h
|
||||
MINIO_CACHE_EXCLUDE: List of cache exclusion patterns delimited by ","
|
||||
MINIO_CACHE_EXPIRY: Cache expiry duration in days
|
||||
MINIO_CACHE_QUOTA: Maximum permitted usage of the cache in percentage (0-100).
|
||||
MINIO_CACHE_AFTER: Minimum number of access before caching an object.
|
||||
|
||||
...
|
||||
...
|
||||
|
||||
7. Start MinIO gateway to s3 with edge caching enabled on '/mnt/drive1', '/mnt/drive2' and '/mnt/export1 ... /mnt/export24',
|
||||
exclude all objects under 'mybucket', exclude all objects with '.pdf' as extension
|
||||
with expiry up to 40 days.
|
||||
with expiry up to 40 days. Cache only those objects accessed atleast 3 times.
|
||||
$ export MINIO_CACHE_DRIVES="/mnt/drive1,/mnt/drive2,/mnt/export{1..24}"
|
||||
$ export MINIO_CACHE_EXCLUDE="mybucket/*,*.pdf"
|
||||
$ export MINIO_CACHE_EXPIRY=40
|
||||
$ export MINIO_CACHE_QUOTA=80
|
||||
$ export MINIO_CACHE_AFTER=3
|
||||
$ minio gateway s3
|
||||
```
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Install MinIO - [MinIO Quickstart Guide](https://docs.min.io/docs/minio-quicksta
|
||||
|
||||
Disk caching can be enabled by setting the `cache` environment variables for MinIO gateway . `cache` environment variables takes the mounted drive(s) or directory paths, cache expiry duration (in days) and any wildcard patterns to exclude from being cached.
|
||||
|
||||
Following example uses `/mnt/drive1`, `/mnt/drive2` ,`/mnt/cache1` ... `/mnt/cache3` for caching, with expiry up to 90 days while excluding all objects under bucket `mybucket` and all objects with '.pdf' as extension while starting a s3 gateway setup. Cache max usage is restricted to 80% of disk capacity in this example.
|
||||
Following example uses `/mnt/drive1`, `/mnt/drive2` ,`/mnt/cache1` ... `/mnt/cache3` for caching, with expiry up to 90 days while excluding all objects under bucket `mybucket` and all objects with '.pdf' as extension while starting a s3 gateway setup. Objects are cached if they have been accessed three times or more.Cache max usage is restricted to 80% of disk capacity in this example.
|
||||
|
||||
```bash
|
||||
export MINIO_CACHE="on"
|
||||
@@ -23,6 +23,7 @@ export MINIO_CACHE_DRIVES="/mnt/drive1,/mnt/drive2,/mnt/cache{1...3}"
|
||||
export MINIO_CACHE_EXPIRY=90
|
||||
export MINIO_CACHE_EXCLUDE="*.pdf,mybucket/*"
|
||||
export MINIO_CACHE_QUOTA=80
|
||||
export MINIO_CACHE_AFTER=3
|
||||
minio gateway s3
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user