Hi Nick,
Thanks for the responses, and that really helped my understanding..
And a bit of update.. I think I might have cracked the case, and it's related to how an AppStream session behaves...
For reference, Use Session Scripts to Manage Your AppStream 2.0 Users' Streaming Experience - Amazon AppStream 2.0 details the process about running a session script before an AppStream session is started. Specifically, step #3 in the diagram mentions
If application settings persistence is enabled for your users, the application settings Virtual Hard Disk (VHD) file that stores your users' customizations and Windows settings is downloaded and mounted. Windows user login is required in this case.
In my case, I was trying to mount the S3 bucket using a setup script (not to be confused with the session script). With session scripts, the Windows user login always occurs before session scripts start executing. However, with setup script, this might not be the case.
In my case, because I had been focusing on reducing the time it takes the execute the setup script, in hindsight, I think the rclone mount
command had been executing before the VHD with the application persistence is mounted. This would explain why I would see the cache folder/files in the AppStream session (because the VHD would've been mounted by then), but the log file says otherwise (because it was run before the VHD would not have been mounted by then). And when I launch the application, it took about 10s to load.
When I changed my setup script to check for the existence of the drive (where VHD file is mounted) before performing the rclone mount
, then the logs would show something like
INFO : vfs cache: cleaned: objects 36 (was 36) in use 0, to upload 0, uploading 0, total size 94.971Mi (was 94.971Mi)
which as you've suggested, means that it was able to find the cache. Following that, when I launch the application, it now takes about 4s the first time. And this 4s, like you said, would be attributed to the time it takes for the OS cache to build - and subsequent launches would be close to instant (once the OS cache builds).
So yeah, I think the mystery's been solved, and I feel the discussion can closed now. Thanks again for sticking around and offering your help, time and insight Nick!
Many thanks,
James