I had this “problem” all the time … since 2020 launched … and with 2024 even more:
How does the RollingCache really work? … I mean … really
In FS2020 it was very quickly obvious that the cache mainly causes problems:
- With sim updates it could cause hangs (e.g. due to asset conflicts)
- In regular conditions it causes FPS reduction and stutter (on my system)
So the solution for me was to simply disable the cache and be a happy goose.
With FS2024 it is different. The RollingCache.ccc
is now a fundamental part of a “good system”, as streaming is now a “first class citizen” for all assets.
So the concrete questions that I have are right now:
- Is there a good resource somewhere which does a deep dive into the
RollingCache.ccc
(RC)?- e.g. in the developer SDK documentation area
- Did someone document (or reverse engineer) the “file format” of the RC?
- Does the SDK offer special RC tools?
- Dump a cache hit-miss heuristic
- Dump a list of all items which are in the cache
- etc.
- Are there any “hidden” config options or files which allow to assign space to different asset types?
- … aircraft, sat images, geometry, etc.
- What is the FPS impact of a … say … 2 TB RC vs the 16 GB version?
- Given that today a single aircraft ca have 5 to 10 GB of data I feel like 16 GB is not “a lot”.
- What Windows tools could be used to really understand the cache access?
- I am looking at
Resource Monitor
and while I do see lots of “read” I have never ever seen a “write” operation. Curious.
- I am looking at
So I will leave it at this initial list. Any pointers are highly welcome.
PS: Specially with all those server problems right now I feel like having a “good” rolling cache strategy might be helpful for me and others.
High level summary of my tests
Practical ideas (recommendations?) to improve local caching
- Increase the size of your RC as much as possible
- … but I might change my opinion on this, once I take a closer look at the “tiny purple line” at the beginning of the cache.
- Especially the landscape data on long flights can and will wipe out important sim data
- … which then needs to be downloaded again if it only was in the RC.
- Sizes of up to 250 GB seem to be without noticable problems (so far).
- Sizes above 750 GB might be a waste of storage,
- … as the sim might not be able to use it all (due to the nature of the RC index structure).
- Once the feature gets added to FS2024, manually cache (aka. “Install”) as many relevant FS2024 Marketplace assets (aircraft, airports) as you can outside of the RC.
- This form of manually caching outside the RC will reliably reduce the need for network usage.
Observed download (RC write) volumes
The following has been measured at “Ultra” graphics settings:
- A very large and very detailed aircraft, like the Boeing 737 Max by Asobo
- … will cause a download of 0.4 GB during the “Config UI” phase
- … and will need to download another 1 GB for all the high LOD features.
- Test P
- Flying with 70 ktas in a TIN landscape …
- at 15,000 ft will download around 0.3 GB in 10 minutes.
- at 1,000 ft will download around 3 GB in 10 minutes.
- This translates to a utilized network bandwidth of 5 to 50 Mbps.
- Higher speeds will increase the volume accordingly.
- Flying with 70 ktas in a TIN landscape …
- Test C to F
- 5 GB or more have been written to the RC by visiting a large handmade international airport (e.g. KSFO).
- A large part are the static aircraft
- … and vehicles (cars, trucks, busses, …)
- … and common objects (boxes, fences, people, …)
- A large part are the static aircraft
- 5 GB or more have been written to the RC by visiting a large handmade international airport (e.g. KSFO).
Technical RC aspects that could be improved
Addressing the following aspects does require (significant) code changes.
- The Least Recently Used (LRU) cache strategy does not fit the nature of FS2024.
- LRU was designed for random data with no meta info.
- However, FS2024 has and can collect a lot of meta information about the data:
- Usage history
- The data category
- Pilot preferences
- Game mode
- Current flight plan
- etc.
- FS2024 could adopt other (additional) well known cache management options … e.g.
- Data category specific caching
- Layered (generational) caching
- Predictive caching
Useful Windows Tools for analysis
Resource Monitor
- Comes preinstalled with Windows.
- Can filter system activity for the
FlightSimulator2024.exe
process. - Provides a visual high level overview of the system usage (cpu, disk, network, memory) over the last minute.
Process Monitor
- Provided by Microsoft for free via the regular app store as part of the
Sysinternals Tools
. - Performs a highly detailed analysis of almost all system activities
- … by obtaining a full event recording for a certain period of time.
- Process Monitor - Sysinternals | Microsoft Learn
- Provided by Microsoft for free via the regular app store as part of the
2024.12 - FS2024 v1.1.10.0 Observations
Here is a short summary of the more detailed findings which are provided below:
2024.12.03-14.45 - v1.1.10.0 - Switching between Archer and Joby 5 times
- My first tests suggest that the
RollingCache.ccc
is efficient and effective- read and writes happen in large batches and 80% of all reads come from the cache.
- But there is a lot of network traffic in the background in cases where a goose like me would not expect any.
- It seems likely (after the second test) that simple switching between already (fully) cached aircraft
- … will trigger network traffic in the order of a few MB per switching action.
2024.12.03-20.26 - v1.1.10.0 - 20 min idle in Change Aircraft
- Being idle in “Change Aircraft” is a fairly inactive state
- … with only very minor network activity.
2024.12.03-22.25 - v1.1.10.0 - Scrolling around in My Library for 10 min
- In general it feels like there is a (severe?) lack of local caching during the “Marketplace” access.
- No local caching always means more stress for the backend databases and servers.
- Too large thumbnails … means too much unnecessary data transfer.
- The
RollingCache.ccc
is not used at all to cache data (e.g. images, metadata) from the marketplace- … which results in a very “broken” experience during times where the servers are busy
- as everything needs to be downloaded over and over again … while scrolling up and down.
- So if I could see a thumbnail a few minutes ago … it might be gone a little later.
- The network usage is low … but mainly because the requests seem to be queueing up inside the client (sim)
- … and so they are not visible in the OS events.
2024.12.04-22.43 - v1.1.10.0 - Launch of game - in 3 minutes - under server stress
- Out of the total 4.4 GB read during a launch only 0.046 GB are read over the network
- … so, besides the very first launch, it clearly is not the amount of data which is “streamed” that has an impact on the launch time.
- A warmed up
RollingCache.ccc
will deliver around 10% (0.57 GB) of the necessary launch data- … so a warm cache reduces the network usage from 580 MB to just 46 MB … which is around 90% reduction.
- It is yet unclear what has the highest impact on the extreme differences in observed launch times.
2024.12.04-16.44 - v1.1.10.0 - Flying for 11 minutes around Lana’i - 3600 ft
- The
RollingCache.ccc
does deliver, as promised, a dramatic reduction in necessary network traffic- … when it comes to landscape information (ground textures, 3D meshes, etc.).
- However, based purely on an educated guess (as I do not know the code),
- … it feels like the sim does not cache responses to landscape related queries
- … like “which texture ID at this LOD should I display for that GPS location”?
- This would explain why we see 20 times more data read from the network then written to the
RollingCache.ccc
.- This does not smell like “data” but rather like “data about data” (query results).
- … it feels like the sim does not cache responses to landscape related queries
2024.12.04-18.26 - v1.1.10.0 - Flying for 11 minutes around Lana’i - low alt
- Many observations of the previous “3,600 ft” test also apply to this “low altitude” test.
- Multiple low altitude flights are needed to really stream all the data for a region.
- This indicates that the backend (API or CDN) most likely is not “fast enough” yet.
- The 11 minute low altitude flight needed about 1 GB of additional landscape downloads
- … and on average 3-times more data was read from the
RollingCache.ccc
per second.
- … and on average 3-times more data was read from the
- Some recorded events are hard to interpret and it could either be the result of “bugs” or “features”.
- Maybe, and this is a big “maybe”, the FS2024 sim uses an IO subsystem, which is “priority and throughput” aware. Maybe.
2024.12.04-21.47 - v1.1.10.0 - Selecting uncached aircraft - 737 Max (Asobo)
- A very large and very detailed aircraft, like the Boeing 737 Max by Asobo
- … will cause a download of 0.4 GB during the “Config UI” phase
- … and will need to download another 1 GB for all the high LOD features.
- Aircraft specific sound is downloaded during the “Config UI” phase
- … and is written into a dedicated file … and does not go into the normal
RollingCache.ccc
. - This might be because the OS sound APIs work better if a dedicated file handle can be provided? Unclear.
- … and is written into a dedicated file … and does not go into the normal
2024.12.11-14.42 - v1.2.7.0 - Cache size increase from 16 to 256 GB
- The speed of a bulk data append to the
RollingCache.ccc
is mainly limited by the OS and the hardware.- On my system I could see almost 160 MB/s write performance.
- However, this test cannot predict the real cache performance during a flight. It mainly provides the “absolute best case” limit.
- On my system I could see almost 160 MB/s write performance.
- For an “order of magnitude” context here are some numbers from previous tests:
- up to 4 GB … need to be read during the walkaround of large ultra detailed aircraft (see test: 2024.12.04-21.47)
- 2 to 5 MB/s … 20 to 50 Mbps … landscape data are read from the cache in the case of a low altitude flight with 170 ktas (see test: 2024.12.04-18.26)
2024.12 - FS2024 v1.2.x Observations
Here is a short summary of the more detailed findings which are provided below:
2024.12.18-14.38 - v1.2.7.0 - KSFO short slow drone flight
- A major custom build international airport like KSFO can easily write 6 GB and more into the cache.
- So with a 16 GB cache and an “ultra aircraft” flying between two “ultra airports”
- … even a simple two-way flight might required the first airport to get streamed twice.
- So with a 16 GB cache and an “ultra aircraft” flying between two “ultra airports”
- Slow download speeds can result in server request timeouts (failures)
- … which can cause any kind of asset to only be visible in a lower than expected level of detail (LOD).
- The “healing process” for objects that have been cached in a “corrupt” (low LOD) state, is … well … unclear.
- Maybe one has to wait until the data is dropped from the cache
- … which would become a problem in (desirable) very large
RollingCache.ccc
configurations.
- … which would become a problem in (desirable) very large
- Maybe one has to wait until the data is dropped from the cache
2024.12.18-17.43 - v1.2.7.0 - Launch game … downloads the same 40 MB again and again
- Around 40 MB of downloads related to 301 files stored inside the
SceneryIndexes
folder get downloaded on every sim launch- … even when they are bit-identical to the files which already have be stored on the local drive.
- This seems to prolong the launch process by 1 to 2 minutes under “normal” conditions.
- There seems to be a lack of “meta-index” files with checksums and versions … an “index-index”.
- With such a simple addition the sim launches might be a lot fast.
2024.12 - v1.2.7.0 - Cache usage pattern … Is it a trivial FIFO ring buffer? No.
- The
RollingCache.ccc
is NOT operated as a trivial FIFO ring buffer … and this is very good news! - However, this high level view can not show exactly which strategy (algorithm) is used
- … but frequently used data (e.g. favorite aircraft) should remain in the cache.
- If recently downloaded and used assets gets downloaded again in a short period of time
- … then the size of the cache is either simply too small (see also: Test 2024.12.18-14.38)
- or there is some kind of “feature” (bug?) related to caching priorities or asset versioning.
- … then the size of the cache is either simply too small (see also: Test 2024.12.18-14.38)
- Compression of the
RollingCache.ccc
only shows clear benefits while the cache is not fully utilized- … as in those cases there is still a lot of easy to compress “zero-fill” data.
- Or to reverse the logic. If compressing does not show much benefit, then the cache has already been fully utilized once.
2024.12.23 - v1.2.8.0 - Can one-time landscape TIN data remove long-time active data from the cache? Yes.
- Terminating FS2024 via
Task Manager
seems to result in a clean shutdown.- The next launch of FS2024 was without any warnings or problems … which is very good.
- The
RollingCache.ccc
is most likely managed by a strict Least Recently Used (LRU) cache replacement policy.- This will result in the unnecessary (re)downloading of previously cached data
- … which puts unnecessary stress on already stressed servers
- … and can for example significantly increase the sim launch time.
- This will result in the unnecessary (re)downloading of previously cached data
- My practical recommendations did not change … but I think that I can now back them up with the tests provided above:
- Increase the size of your RC as much as possible
- … but I might change my opinion on this, once I take a closer look at the “tiny purple line” at the beginning of the cache.
- Manually cache (aka. “Install”) as many relevant FS2024 Marketplace assets (aircraft, airports) as you can outside of the RC.
- Increase the size of your RC as much as possible
2024.12.23 - v1.2.8.0 - Will a “failure” to cache 3D data infect the RC for subsequent flights? No.
- Stressed servers can result in very very very slow or even failed asset downloads.
- Truly “failed” asset downloads will not heal, no matter how long the camera looks at them
- … but since healing can take many minutes it will be hard to distingiush “slow” from “failed” in a normal flight.
- The sim will remember the failed state … and it seems that state is also stored in the RC.
- Most likely the sim does give up “permanently” on “failed” assets at some point.
- This is bad news … especially for a sightseeing goose or the official “World Photographer” mode.
- However after a new launch of the sim, there will be new attempts to load the failed assets
- … and under good conditions the proper 3D planet will become visible.
- So the good news is, that failed assets inside the
RollingCache.ccc
file do not result in “permanent” 3D data infections.- It is not necessary to delete the entire RC.
2024.12.31 - v1.2.8.0 - More observations about (not) healing “broken” objects … is a mixed story.
- Getting a clear picture of the different kind of “broken” objects is tricky
- … especially because some conditions are hard to provoke reliably.
- Some “broken” objects do heal … after waiting long enough.
- The missing TIN data in LA required 19 minutes to arrive.
- Some “broken” objects do heal … after a new flight gets started.
- The broken rudder texture of a static aircraft was such an example.
- Some “broken” objects do heal … but require a restart of the sim.
- The “red error pilot” was such a case.
- Some “broken” objects do never heal … because they are “broken by design”.
- The different car examples fall in this category.
- The good news is that so far I was not able to trigger a case where the “broken” object persisted inside the
RollingCache.ccc
file- … and thereby would have persistent across multiple launches of the
FlightSimulator2024.exe
. - So there is, obviously, a cache state representation inside the RAM
… and that cache can hold on to “broken” objects. But this does not survive a restart.
- … and thereby would have persistent across multiple launches of the
2024.12.31 - v1.2.8.0 - Rolling Cache data volumes during a normal slow sightseeing flight
- The network bandwidth recommendations from the FS2024 team seem plausible.
- With Ultra graphics settings I have seen a demand for 5 to 50 Mbps.
- Flying with 70 ktas in a TIN landscape …
- at 15,000 ft will read around 0.3 GB in 10 minutes.
- at 1,000 ft will read around 3 GB in 10 minutes.
- Loading into an airport, taxiing or approaching an airport … those are the demanding phases of a flight.
- Even without the excessive TIN landscape scanning, a normal 4 hour flight will fill a fresh
RollingCache.ccc
- … and at the default 16 GB size it will get overwhelmed,
- … as long as it is governed by a Least Recently Used (LRU) cache replacement policy.
- … and at the default 16 GB size it will get overwhelmed,
2025.01.03 - Ideas for a happy new Rolling Cache ecosystem
- Todays Least Recently Used (LRU) strategy does not fit the nature of FS2024.
- LRU was designed for random data with no meta info.
- FS2024 has and can collect a lot of meta information about the data:
- Usage history
- The data category
- Pilot preferences
- Game mode
- Current flight plan
- etc.
- Manual caching (a.k.a. “installing a package”) is a possible hot fix
- … but FS2024 should and could also provide way better on demand caching options … e.g.
- Data category specific caching
- Layered (generational) caching
- Predictive caching
2025.01.05 - v1.2.8.0 - A more detailed Rolling Cache data access analysis
Process Monitor
does not “record” all events. Some events seem to get “lost”.- With 72 (or 80?) bytes per index item
- … and an index block size of 512 MB
- … the index can hold up to around 7,456,000 references to blob items.
- With an average blob item oft perhaps 50,000 to 100,000 bytes (0,1 MB)
- a
RollingCache.ccc
file larger than 745 GB may run out of index space. - So there is plenty of room to grow a single RC file.
- However, the performance problems may then be more related to in RAM index lookup (search) codes
- … or the periodic index “full? dump to disk” persistency strategy.
- However, the performance problems may then be more related to in RAM index lookup (search) codes
- Somewhat confusing is, that for many blob items the HEADER is (far) larger than the BODY.
- This feels like a waste of memory.
- And why is there a need for a 1 KB HEADER in the first place?
- 1 KB * 500,000 items = 0,5 GB of “waste?” storage.
- And there are lots of “strange” blobs with 32 bytes to BODY.
- Hmmm. Many interesting questions.
- a
- The access does suggest a “Read after write” access pattern.
- This makes sense because the RC seems to serve as a way to decouple chunked (rainy) server downloads from (blue skies) sim data usage.
2025.01.08 - v1.2.8.0 - Rolling Cache read-to-write ratio
- It is highly likely that network downloads are initially cached in memory … and not inside the RC.
- Only data intended for the RC is then written to the RC.
- Data intended for the regular filesystem is not buffered in the RC first.
- The observed Read:Write ratio numbers of the RC fit the different test characteristics
- … and the Least Recently Used (LRU) cache replacement policy.
- The RC remembers too much “useless” data and forgets too much “important” data.
- Landscape data is usually (naturally) rarely reused
- … which results in “R:W ratio” number of 1.0 or below.
- Other categories of data (airports, aircraft, etc.) … can result in higher “R:W ratio” numbers
- … but a RC with a small size and a LRU policy, will struggle to keep them in the RC.
- Especially the FS2024 speciality, flying low and enjoying the new ground details and bioms,
- … will result in landscape wiping out important data that should stay in the RC.
- Landscape data is usually (naturally) rarely reused
- Overall real use “R:W ratio” number for the RC are barely above 1.0.
- The RC mostly acts like a buffer (queue) and only rarely like a real cache.
- The current RC design does not seem to take away significants load from the API, CDN or Origin servers.
2025.01.10 - Ideas for a “Hotfix” release of the Rolling Cache
- A “Hotfix” cache update should respect key constraints:
- Any local caching solution must be able to work at the 16 GB default cache size.
- No changes to the LRU Cache code base … or the present
CCC
file structure.
- A “Hotfix” cache should try to achieve the following key goals:
- Increase the cache Read:Write ratio … significantly.
- Avoid increased cache item lookup latency.
- Avoid too many necessary code change in the sim.
- This could be achieved by splitting todays RC file into three cache files for different content categories:
HighReuse
= Scenery Index, Aircraft, Airports, …MediumReuse
= Globe (landscape) low + med zoom levels, Challenges, Marketplace, …LowReuse
orAllOther
= Globe (landscape) high zoom levels, Live data, …
- Multiple cache files would allow to reduce the index area size in each file.
- Introducing a config section in the
UserCfg.opt
file during a “Hotfix” would …- allow easy customzation for nerd pilots who want to tune their PC system.
- prepare the ground for a “Brave New World” cache future.