1. This is an off-topic section of the forum.
    If you have an issue related to BeamNG, please post in Troubleshooting section instead.

Steam's Patching Mechanism is Wearing SSD and here's how to (partially)Mitigate it

Discussion in 'Computer Hardware' started by default0.0player, Dec 25, 2023.

  1. default0.0player

    default0.0player
    Expand Collapse

    Joined:
    Nov 30, 2018
    Messages:
    2,046
    As the game's size goes up over the update, more and more players start to notice that a large percentage of the update is stuck at the so-called "patching process". This problem also happens at other games such as Euro Truck Simulator 2.

    There are two intriguing complaints from the player: "It takes more time to patch than uninstall and reinstall the game" and "not enough disk space". In addition to that, a significant percentage of players, which I suspect to be astroturfer, blame the victim of slow update of using an HDD despite the victim declare that they are in fact using an SDD.

    Here are some threads, for your reference: Downloading the whole ETS2 is faster than doing a 25MB Update; So why is steam nowdays always moving the files after every update ? 7mb update 22gb moving files.. this is so annoyig; Steam Patching filling up hard drive? Anyone experience this and have suggestions?; 52mb update, and 15gb of writting to my ssd.
    Two problems:
    1. Slow disk write speed,
    2. High disk space usage.

    You might ask why? Here's what I discovered. As already mentioned by others before about the topic, both on this forum and elsewhere. Steam is using delta or differential patching mechanism, which only download what is changed in updated file(s) instead of downloading the file(s) it/themself, then insert/remove the changed content. Sounds clever? Well, it is, but only in theory. In practice Steam did a very poor job.
    The process is at follows:
    1. Download the delta
    2. Copy-paste(instead of cut-paste) all the outdated files to another place
    3. Delta patch the copied files, which involves lot of random read/write I/O
    4. Use the patched files to overwrite the outdated files.

    The most troublesome of the copy-paste and overwrite put heavy wear on both HDD and SDD.

    For HDD, a ton of the data will be fragmented, updating the main.scs in ETS2, increases the fragmentation of the HDD for a whopping 17% percent. The mitigation of this is quite simple, defrag your disk after updating and before playing the game.

    For SSD, things get complex, because unlike HDD, data on SSD cannot be overwritten, the sector of the written data must be erased before new data can be written, and for a given SSD, the number of erases is finite before the failure of the SSD.

    What would have been, if Steam uses efficient delta patching technique. If there's no copy-pasting and overwriting. The total written is only slightly higher than the delta itself. Since SSD have no spinning disk nor magnetic head, fragmentation does not reduce SSD read speed. Overwriting of SSD is just marking old data as "invalid" and write the new data elsewhere, when all sector on an SSD is either data or invalid, the first invalid data will be erased, and the process continues. The data before and after the delta will be unchanged.

    Unfortunately Gaben doesn't care about users' SSD life, so the inefficient process will probably never be fixed, and reduced downloaded data definitely saves tons of operation cost of Steam, so more net profit for Gaben.

    There are many factors that could affect SSD's life, two of them are involved in this.
    1. Write amplification. Since SSD's data cannot be directly overwritten, the actual total written to the SSD is a multiple of data intended to write. Here's a list of write amplification factors. As shown, writing non-sequential data and smaller data sizes will have greater impact on write amplification, i.e. wearing down the SSD faster, and deduplication saves unnecessary write that is good for the SSD, which Steam does the opposite.
    2. Wear leveling. Since SSD can only be erased for a finite time, the SSD should wear each sector equally to reduce premature end-of-life. However, the act of moving stationary data back and forth causes additional write by itself. Thus it's recommended for the user to leave some space of SSD empty to facilitate sufficient space for wear leveling.

    Thus we can understand why Steam is wearing down the user's SSD.
    1. Copy-pasting outdated data is duplication, which is bad.
    2 .Delta patching itself involves lots of random writes, which has a very high WA factor. According to the disk usage, the MB/s is much lower than moving or copying files by yourself. To make matters worse, the delta patching is done after the reducing free disk space copy-pasting step, making the SSD harder to perform WL.
    3. Using the patched files to overwrite the outdated files contributing additional write since data in SSD cannot be overwritten.

    The total written = patched_file_total_data + delta * high_WA_factor + patched file_total_data

    If the player uninstall the game and re-download the game, the total written data is just the game size. In addition to that, the free space is larger during the installation process.

    Mitigation: time is money, so to reduce operating cost, the time of the update process must be considered, along with download data cost and expected cost per SSD life expectancy loss.

    If your internet connection is very fast and unmetered, > 40Mpbs (5MiB/s), and you are using HDD, always uninstall and re-download the game
    If your internet connection is very fast and unmetered, > 250Mpbs (31.25MiB/s), and you are using SSD, always uninstall and re-download the game
    If your internet is in mid-range and unmetered, ~ 10Mbps (1.25MiB/s), uninstall and re-download if HDD, update if using SSD if you are in a rush, re-download if you have time to spare i.e. have other things to do during the download.
    If your internet is slow, < 1Mbps (125KiB/s), update the game.
    If your internet is metered, that depends. If your data is always cost per MB, patching is beneficial since the lower the online data the better. If you have a data plan, i.e 100GB per month, re-download would be better if your are near the end of the month and you still have lots of data left.
     
    • Like Like x 1
  2. trekko727

    trekko727
    Expand Collapse

    Joined:
    Aug 10, 2013
    Messages:
    233
    this goes out for the recent 98mb patch :\ thats patching 25GB.. :\ what a joke just to patch some minor things
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice