[LibOS] Add Page Cache feature for trusted files #2011
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
check issue #1712 for details.
This PR introduces a manifest option
sgx.trusted_files_cache_size
which specifies the cache size allocated for trusted files. A trusted file is cached if the file is opened more than 10 times. Cache eviction policy is Least Recently Used aka LRU. This optimization is used when there are frequently-reused files.Below are the results with and without this PR for nginx run:
Fixes #1712
How to test this PR?
Change
worker_processes
value toauto
inCI-Examples/nginx/nginx-gramine.conf.template
Add
open_file_cache max=1024 inactive=10s;
underhttp {
block inCI-Examples/nginx/nginx-gramine.conf.template
Native run:
SGX run:
Initial 1-3 run with gramine-sgx might give low performance results as trusted file chunks are added to the page cache for the first time. After 1-3 iterations results become consistent.
This change is