You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the manifest for the dataset is found, we check Redis for a cache hit. If we have a cache hit, we return the cached data and everything is 👌.
If we have a cache miss, we call sendTransposeOutput(), which will call fs.readFile():
Not sure how often we expect the manifests to change, or if we can try loading all 3 manifest JSON files at server startup and keep them cached instead of calling fs.existsSync() for each dataset request. Maybe the fs.readFile() isn't as serious if we're expecting 99.999% of the calls to be Redis cache hits and we only load the file when the cache has expired (which hopefully in production we'll have a long cache life).
The text was updated successfully, but these errors were encountered:
Production does have a 24-hour cache life, so most will be cache hits, but I do feel that shouldn't stop us from optimizing cache miss performance. And this is an excellent point. In production, the manifests won't change once the application starts running.
Randomly trolling through the code, and trying to understand the couple of fs.* calls in /src/server.js:
ensemble-transposer/src/server.js
Lines 22 to 31 in 983b8cd
If I'm reading this correctly, ever call to
server.get('/:dataset', ...)
will callfs.existsSync(manifestFilename)
.ensemble-transposer/src/server.js
Line 83 in 983b8cd
If the manifest for the dataset is found, we check Redis for a cache hit. If we have a cache hit, we return the cached data and everything is 👌.
If we have a cache miss, we call
sendTransposeOutput()
, which will callfs.readFile()
:ensemble-transposer/src/server.js
Lines 51 to 68 in 983b8cd
Not sure how often we expect the manifests to change, or if we can try loading all 3 manifest JSON files at server startup and keep them cached instead of calling
fs.existsSync()
for each dataset request. Maybe thefs.readFile()
isn't as serious if we're expecting 99.999% of the calls to be Redis cache hits and we only load the file when the cache has expired (which hopefully in production we'll have a long cache life).The text was updated successfully, but these errors were encountered: