Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Should swappiness be lowered for a SWAP partition on an SSD?

  1. #11
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    887

    Default Re: Should swappiness be lowered for a SWAP partition on an SSD?

    Quote Originally Posted by malcolmlewis View Post
    Hi
    What are the specs for your SSD... I wouldn't even worry about it, there are probably more writes to the journal....
    Here is the specs section of the store and page I bought it from: https://www.emag.ro/solid-state-driv...cation-section
    openSUSE Tumbleweed x64, KDE Framework 5

  2. #12
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,695
    Blog Entries
    15

    Default Re: Should swappiness be lowered for a SWAP partition on an SSD?

    Quote Originally Posted by MirceaKitsune View Post
    Here is the specs section of the store and page I bought it from: https://www.emag.ro/solid-state-driv...cation-section
    Hi
    So how many hours does the device have on it, how many bytes have been written?

    Your specs show 800 TB of data written is the expected lifetime... based on that and my current nvme device from smartctl, I see;

    Code:
    Data Units Written:                 2,353,652 [1.20 TB]
    Power On Hours:                     2,085
    Based on your specs the above drive say 1 TB per 2000 hours times 800 = 1,600,000 hours, which equates to around 182 years.... if you turn it around and say I want the device to last say 5 years, that's 160 TB per year or about 438 GB a day or 18 GB an hour....


    My NVMe device is writing 0.575GB per hour or 13.8GB a day.... most of (OCZ, SanDisk, WD and Crucial devices) mine are the same eg 0.5GB an hour I just don't worry about it....

    My oldest SSD (OCZ 60GB) still running fine it has one (1) retired block and SSD life curve is still at 100.

    Code:
      9 Power_On_Hours_and_Msec 0x0032   037   037   000    Old_age   Always       -       55585h+18m+37.730s
    241 Lifetime_Writes_GiB     0x0032   000   000   000    Old_age   Always       -       25947
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #13
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    887

    Default Re: Should swappiness be lowered for a SWAP partition on an SSD?

    Code:
    mircea@linux-qz0r:~> sudo smartctl -a /dev/sda                  
    [sudo] password for root: 
    smartctl 7.0 2019-05-21 r4917 [x86_64-linux-5.3.12-1-default] (SUSE RPM)
    Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
    
    === START OF INFORMATION SECTION ===
    Device Model:     ADATA SU900
    Serial Number:    2I4220083049
    LU WWN Device Id: 5 707c18 1006f921e
    Firmware Version: Q0125A
    User Capacity:    256,060,514,304 bytes [256 GB]
    Sector Size:      512 bytes logical/physical
    Rotation Rate:    Solid State Device
    Device is:        Not in smartctl database [for details use: -P showall]
    ATA Version is:   ACS-2 (minor revision not indicated)
    SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
    Local Time is:    Sun Dec  8 02:12:36 2019 EET
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled
    
    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED
    
    General SMART Values:
    Offline data collection status:  (0x02) Offline data collection activity
                                            was completed without error.
                                            Auto Offline Data Collection: Disabled.
    Self-test execution status:      (   0) The previous self-test routine completed
                                            without error or no self-test has ever 
                                            been run.
    Total time to complete Offline 
    data collection:                (  171) seconds.
    Offline data collection
    capabilities:                    (0x71) SMART execute Offline immediate.
                                            No Auto Offline data collection support.
                                            Suspend Offline collection upon new
                                            command.
                                            No Offline surface scan supported.
                                            Self-test supported.
                                            Conveyance Self-test supported.
                                            Selective Self-test supported.
    SMART capabilities:            (0x0002) Does not save SMART data before
                                            entering power-saving mode.
                                            Supports SMART auto save timer.
    Error logging capability:        (0x01) Error logging supported.
                                            General Purpose Logging supported.
    Short self-test routine 
    recommended polling time:        (   2) minutes.
    Extended self-test routine
    recommended polling time:        (  10) minutes.
    Conveyance self-test routine
    recommended polling time:        (   2) minutes.
    SCT capabilities:              (0x003d) SCT Status supported.
                                            SCT Error Recovery Control supported.
                                            SCT Feature Control supported.
                                            SCT Data Table supported.
    
    SMART Attributes Data Structure revision number: 1
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
      1 Raw_Read_Error_Rate     0x0000   100   100   000    Old_age   Offline      -       0
      5 Reallocated_Sector_Ct   0x0000   100   100   000    Old_age   Offline      -       14
      9 Power_On_Hours          0x0000   100   100   000    Old_age   Offline      -       9386
     12 Power_Cycle_Count       0x0000   100   100   000    Old_age   Offline      -       98
    160 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       0
    161 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       22
    163 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       13
    164 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       18377
    165 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       73
    166 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       5
    167 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       35
    148 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       778
    149 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       65
    150 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       0
    151 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       51
    169 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       100
    177 Wear_Leveling_Count     0x0000   100   100   050    Old_age   Offline      -       0
    181 Program_Fail_Cnt_Total  0x0000   100   100   000    Old_age   Offline      -       20
    182 Erase_Fail_Count_Total  0x0000   100   100   000    Old_age   Offline      -       0
    187 Reported_Uncorrect      0x0000   100   100   000    Old_age   Offline      -       0
    192 Power-Off_Retract_Count 0x0000   100   100   000    Old_age   Offline      -       38
    194 Temperature_Celsius     0x0000   100   100   000    Old_age   Offline      -       51
    196 Reallocated_Event_Count 0x0000   100   100   016    Old_age   Offline      -       0
    199 UDMA_CRC_Error_Count    0x0000   100   100   050    Old_age   Offline      -       0
    232 Available_Reservd_Space 0x0000   100   100   000    Old_age   Offline      -       91
    241 Total_LBAs_Written      0x0000   100   100   000    Old_age   Offline      -       100633
    242 Total_LBAs_Read         0x0000   100   100   000    Old_age   Offline      -       27564
    245 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       294032
    248 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       920758
    
    SMART Error Log Version: 1
    Invalid Error Log index = 0x07 (T13/1321D rev 1c Section 8.41.6.8.2.2 gives valid range from 1 to 5)
    
    SMART Self-test log structure revision number 1
    Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
    # 1  Short offline       Completed without error       00%       170         -
    # 2  Short offline       Completed without error       00%       147         -
    # 3  Short offline       Completed without error       00%       123         -
    # 4  Short offline       Completed without error       00%        99         -
    # 5  Short offline       Completed without error       00%        75         -
    # 6  Short offline       Completed without error       00%        51         -
    # 7  Short offline       Completed without error       00%        27         -
    # 8  Extended offline    Completed without error       00%         3         -
    # 9  Short offline       Completed without error       00%         1         -
    #10  Short offline       Completed without error       00%       235         -
    #11  Short offline       Completed without error       00%       211         -
    #12  Short offline       Completed without error       00%       187         -
    #13  Short offline       Completed without error       00%       163         -
    #14  Short offline       Completed without error       00%       139         -
    #15  Short offline       Completed without error       00%       115         -
    #16  Short offline       Completed without error       00%        90         -
    #17  Short offline       Completed without error       00%        66         -
    #18  Short offline       Completed without error       00%        42         -
    #19  Short offline       Completed without error       00%        18         -
    #20  Short offline       Completed without error       00%       251         -
    #21  Short offline       Completed without error       00%       227         -
    
    SMART Selective self-test log data structure revision number 1
     SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
        1        0        0  Not_testing
        2        0        0  Not_testing
        3        0        0  Not_testing
        4        0        0  Not_testing
        5        0        0  Not_testing
        7        0    65535  Read_scanning was completed without error
    Selective self-test flags (0x0):
      After scanning selected spans, do NOT read-scan remainder of disk.
    If Selective self-test is pending on power-up, resume after 0 minute delay.
    openSUSE Tumbleweed x64, KDE Framework 5

  4. #14
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,695
    Blog Entries
    15

    Default Re: Should swappiness be lowered for a SWAP partition on an SSD?

    Quote Originally Posted by MirceaKitsune View Post
    Code:
    mircea@linux-qz0r:~> sudo smartctl -a /dev/sda                  
    [sudo] password for root: 
    smartctl 7.0 2019-05-21 r4917 [x86_64-linux-5.3.12-1-default] (SUSE RPM)
    Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
    
    === START OF INFORMATION SECTION ===
    Device Model:     ADATA SU900
    Serial Number:    2I4220083049
    LU WWN Device Id: 5 707c18 1006f921e
    Firmware Version: Q0125A
    User Capacity:    256,060,514,304 bytes [256 GB]
    Sector Size:      512 bytes logical/physical
    Rotation Rate:    Solid State Device
    Device is:        Not in smartctl database [for details use: -P showall]
    ATA Version is:   ACS-2 (minor revision not indicated)
    SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
    Local Time is:    Sun Dec  8 02:12:36 2019 EET
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled
    
    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED
    
    General SMART Values:
    Offline data collection status:  (0x02) Offline data collection activity
                                            was completed without error.
                                            Auto Offline Data Collection: Disabled.
    Self-test execution status:      (   0) The previous self-test routine completed
                                            without error or no self-test has ever 
                                            been run.
    Total time to complete Offline 
    data collection:                (  171) seconds.
    Offline data collection
    capabilities:                    (0x71) SMART execute Offline immediate.
                                            No Auto Offline data collection support.
                                            Suspend Offline collection upon new
                                            command.
                                            No Offline surface scan supported.
                                            Self-test supported.
                                            Conveyance Self-test supported.
                                            Selective Self-test supported.
    SMART capabilities:            (0x0002) Does not save SMART data before
                                            entering power-saving mode.
                                            Supports SMART auto save timer.
    Error logging capability:        (0x01) Error logging supported.
                                            General Purpose Logging supported.
    Short self-test routine 
    recommended polling time:        (   2) minutes.
    Extended self-test routine
    recommended polling time:        (  10) minutes.
    Conveyance self-test routine
    recommended polling time:        (   2) minutes.
    SCT capabilities:              (0x003d) SCT Status supported.
                                            SCT Error Recovery Control supported.
                                            SCT Feature Control supported.
                                            SCT Data Table supported.
    
    SMART Attributes Data Structure revision number: 1
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
      1 Raw_Read_Error_Rate     0x0000   100   100   000    Old_age   Offline      -       0
      5 Reallocated_Sector_Ct   0x0000   100   100   000    Old_age   Offline      -       14
      9 Power_On_Hours          0x0000   100   100   000    Old_age   Offline      -       9386
     12 Power_Cycle_Count       0x0000   100   100   000    Old_age   Offline      -       98
    160 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       0
    161 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       22
    163 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       13
    164 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       18377
    165 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       73
    166 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       5
    167 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       35
    148 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       778
    149 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       65
    150 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       0
    151 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       51
    169 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       100
    177 Wear_Leveling_Count     0x0000   100   100   050    Old_age   Offline      -       0
    181 Program_Fail_Cnt_Total  0x0000   100   100   000    Old_age   Offline      -       20
    182 Erase_Fail_Count_Total  0x0000   100   100   000    Old_age   Offline      -       0
    187 Reported_Uncorrect      0x0000   100   100   000    Old_age   Offline      -       0
    192 Power-Off_Retract_Count 0x0000   100   100   000    Old_age   Offline      -       38
    194 Temperature_Celsius     0x0000   100   100   000    Old_age   Offline      -       51
    196 Reallocated_Event_Count 0x0000   100   100   016    Old_age   Offline      -       0
    199 UDMA_CRC_Error_Count    0x0000   100   100   050    Old_age   Offline      -       0
    232 Available_Reservd_Space 0x0000   100   100   000    Old_age   Offline      -       91
    241 Total_LBAs_Written      0x0000   100   100   000    Old_age   Offline      -       100633
    242 Total_LBAs_Read         0x0000   100   100   000    Old_age   Offline      -       27564
    245 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       294032
    248 Unknown_Attribute       0x0000   100   100   000    Old_age   Offline      -       920758
    
    SMART Error Log Version: 1
    Invalid Error Log index = 0x07 (T13/1321D rev 1c Section 8.41.6.8.2.2 gives valid range from 1 to 5)
    
    SMART Self-test log structure revision number 1
    Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
    # 1  Short offline       Completed without error       00%       170         -
    # 2  Short offline       Completed without error       00%       147         -
    # 3  Short offline       Completed without error       00%       123         -
    # 4  Short offline       Completed without error       00%        99         -
    # 5  Short offline       Completed without error       00%        75         -
    # 6  Short offline       Completed without error       00%        51         -
    # 7  Short offline       Completed without error       00%        27         -
    # 8  Extended offline    Completed without error       00%         3         -
    # 9  Short offline       Completed without error       00%         1         -
    #10  Short offline       Completed without error       00%       235         -
    #11  Short offline       Completed without error       00%       211         -
    #12  Short offline       Completed without error       00%       187         -
    #13  Short offline       Completed without error       00%       163         -
    #14  Short offline       Completed without error       00%       139         -
    #15  Short offline       Completed without error       00%       115         -
    #16  Short offline       Completed without error       00%        90         -
    #17  Short offline       Completed without error       00%        66         -
    #18  Short offline       Completed without error       00%        42         -
    #19  Short offline       Completed without error       00%        18         -
    #20  Short offline       Completed without error       00%       251         -
    #21  Short offline       Completed without error       00%       227         -
    
    SMART Selective self-test log data structure revision number 1
     SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
        1        0        0  Not_testing
        2        0        0  Not_testing
        3        0        0  Not_testing
        4        0        0  Not_testing
        5        0        0  Not_testing
        7        0    65535  Read_scanning was completed without error
    Selective self-test flags (0x0):
      After scanning selected spans, do NOT read-scan remainder of disk.
    If Selective self-test is pending on power-up, resume after 0 minute delay.
    Hi
    You need to find out from Adata what their calculation for "Total_LBAs_Written" is to calculate out how much has been written, but I expect not that much per hour, as well as nothing to worry about.....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #15

    Default Re: Should swappiness be lowered for a SWAP partition on an SSD?

    Quote Originally Posted by MirceaKitsune View Post
    whenever the system gets past roughly 6 GB of used memory, it begins filling the SWAP at once. With some software it can reach and stay at over 9 GB of RAM for a while, which in a few hours causes the SWAP to be filled up to 100 MB. This is pretty fast for barely exceeding half of my available RAM!
    Interesting thread. I just came from Debian and other Debian based systems and now I'm thinking to reinstall my openSUSE with swap, lol. So basically I see this issue from the other side, I also prefer giving decent swap base for Linux systems however around 3 years ago I've had serious freezing issues on Debian but a lot has changed since then. I think my case was related to SSD's firmware and kernel
    https://wiki.debian.org/SSDOptimization
    https://askubuntu.com/questions/4177...-cache-problem
    At the end, I solved it with a drastic vm.swappiness=1 in /etc/sysctl.d/99-sysctl.conf, I had to. Since then, I installed every distro without RAM, even my current and very first Tumbleweed few days ago. Now I'm just thinking if I should try to install it with swap, despite I've 32GB RAM

  6. #16

    Default Re: Should swappiness be lowered for a SWAP partition on an SSD?

    Ok, I just decided not to reinstall my system without swap just to get a swap partition. Although you're able to almost turn swap off, my current installation just seems quick and stable enough for now. Also I'll decrease the amount of unnecessary snapshots.
    It's an old post but ti's still worth to mention
    https://lizards.opensuse.org/2015/02...-for-opensuse/

  7. #17
    Join Date
    Mar 2020
    Location
    São Leopoldo, RS, Brazil
    Posts
    243

    Default Re: Should swappiness be lowered for a SWAP partition on an SSD?

    Quote Originally Posted by alysu View Post
    Ok, I just decided not to reinstall my system without swap just to get a swap partition. Although you're able to almost turn swap off, my current installation just seems quick and stable enough for now. Also I'll decrease the amount of unnecessary snapshots.
    It's an old post but ti's still worth to mention
    https://lizards.opensuse.org/2015/02...-for-opensuse/
    Article very outdated & unreliable concerning I/O scheduler, ssd wear & tear, snapshots (!!!).

    Up to date (as of 2020-06-10) information:

    * It's fine to have some swap space on SSD
    * Match to workload memory size if you want to use suspend-to-disk
    * It's possible to configure vm.swappiness to reduce swapping
    * Let snapper handle system snapshots (snapshots do not write more data, they do result in more space being used from data already written).
    * openSUSE by default will pick an appropriate scheduler
    openSUSE Tumbleweed

  8. #18
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    746

    Default Re: Should swappiness be lowered for a SWAP partition on an SSD?

    A bit unrelated but in my machines with high RAM (>16GB), I used to put swap partition on a spinning HDD and my swapiness down to 1 or 0. Also, the result wasn't pretty, as soon as my system needed to use the SWAP, it would freeze and/or crash. I never had this issue when I had set swappiness to 10 in 8GB RAM machine.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •