13ffc7051SMatthew Dillon.\" 23ffc7051SMatthew Dillon.\" swapcache - Cache clean filesystem data & meta-data on SSD-based swap 33ffc7051SMatthew Dillon.\" 43ffc7051SMatthew Dillon.\" Redistribution and use in source and binary forms, with or without 53ffc7051SMatthew Dillon.\" modification, are permitted provided that the following conditions 63ffc7051SMatthew Dillon.\" are met: 73ffc7051SMatthew Dillon.\" 1. Redistributions of source code must retain the above copyright 83ffc7051SMatthew Dillon.\" notice, this list of conditions and the following disclaimer. 93ffc7051SMatthew Dillon.\" 2. Redistributions in binary form must reproduce the above copyright 103ffc7051SMatthew Dillon.\" notice, this list of conditions and the following disclaimer in the 113ffc7051SMatthew Dillon.\" documentation and/or other materials provided with the distribution. 123ffc7051SMatthew Dillon.Dd February 7, 2010 133ffc7051SMatthew Dillon.Dt SWAPCACHE 8 143ffc7051SMatthew Dillon.Os 153ffc7051SMatthew Dillon.Sh NAME 163ffc7051SMatthew Dillon.Nm swapcache 173ffc7051SMatthew Dillon.Nd a 183ffc7051SMatthew Dillonmechanism which allows the system to use fast swap to cache filesystem 193ffc7051SMatthew Dillondata and meta-data. 203ffc7051SMatthew Dillon.Sh SYNOPSIS (defaults shown) 213ffc7051SMatthew Dillon.Cd sysctl vm.swapcache.accrate=100000 223ffc7051SMatthew Dillon.Cd sysctl vm.swapcache.maxfilesize=0 233ffc7051SMatthew Dillon.Cd sysctl vm.swapcache.maxburst=2000000000 243ffc7051SMatthew Dillon.Cd sysctl vm.swapcache.curburst=4000000000 253ffc7051SMatthew Dillon.Cd sysctl vm.swapcache.minburst=10000000 263ffc7051SMatthew Dillon.Cd sysctl vm.swapcache.read_enable=0 273ffc7051SMatthew Dillon.Cd sysctl vm.swapcache.meta_enable=0 283ffc7051SMatthew Dillon.Cd sysctl vm.swapcache.data_enable=0 293ffc7051SMatthew Dillon.Cd sysctl vm.swapcache.maxlaunder=256 303ffc7051SMatthew Dillon.Sh DESCRIPTION 313ffc7051SMatthew Dillon.Nm 323ffc7051SMatthew Dillonis a system capability which allows a solid state disk (SSD) in a swap 333ffc7051SMatthew Dillonspace configuration to be used to cache clean filesystem data and meta-data 343ffc7051SMatthew Dillonin addition to its normal function backing anonymous memory. 353ffc7051SMatthew Dillon.Pp 363ffc7051SMatthew DillonSysctls are used to manage operational parameters and can be adjusted at 373ffc7051SMatthew Dillonany time. Typically a large initial burst is desired after system boot, 383ffc7051SMatthew Dilloncontrolled by the initial 393ffc7051SMatthew Dillon.Cd vm.swapcache.curburst 403ffc7051SMatthew Dillonparameter. 413ffc7051SMatthew DillonThis parameter is reduced as data is written to swap by the swapcache 423ffc7051SMatthew Dillonand increased at a rate specified by 433ffc7051SMatthew Dillon.Cd vm.swapcache.accrate . 443ffc7051SMatthew DillonOnce this parameter reaches zero write activity ceases until it has 453ffc7051SMatthew Dillonrecovered sufficiently for write activity to resume. 463ffc7051SMatthew Dillon.Pp 473ffc7051SMatthew Dillon.Cd vm.swapcache.meta_enable 483ffc7051SMatthew Dillonenables the writing of filesystem meta-data to the swapcache. Filesystem 493ffc7051SMatthew Dillonmetadata is any data which the filesystem accesses via the disk device 503ffc7051SMatthew Dillonusing buffercache. 513ffc7051SMatthew Dillon.Pp 523ffc7051SMatthew Dillon.Cd vm.swapcache.data_enable 533ffc7051SMatthew Dillonenables the writing of filesystem file-data to the swapcache. Filesystem 543ffc7051SMatthew Dillonfiledata is any data which the filesystem accesses via a regular file. 553ffc7051SMatthew DillonIn technical terms, when the buffer cache is used to access a regular 56788ef3f9SMatthew Dillonfile through its vnode. Please do not blindly turn on this option, 57788ef3f9SMatthew Dillonsee the PERFORMANCE TUNING section for more information. 583ffc7051SMatthew Dillon.Pp 593ffc7051SMatthew Dillon.Cd vm.swapcache.read_enable 603ffc7051SMatthew Dillonenables reading from the swapcache and should be set to 1 for normal 613ffc7051SMatthew Dillonoperation. 623ffc7051SMatthew Dillon.Pp 633ffc7051SMatthew Dillon.Cd vm.swapcache.maxfilesize 643ffc7051SMatthew Dilloncontrols which files are to be cached based on their size. 653ffc7051SMatthew DillonIf set to non-zero only files smaller than the specified size 663ffc7051SMatthew Dillonwill be cached. Larger files will not be cached. 673ffc7051SMatthew Dillon.Sh PERFORMANCE TUNING 683ffc7051SMatthew DillonBest operation is achieved when the active data set fits within the 693ffc7051SMatthew Dillonswapcache. 703ffc7051SMatthew Dillon.Pp 713ffc7051SMatthew Dillon.Bl -tag -width 4n -compact 723ffc7051SMatthew Dillon.It Cd vm.swapcache.accrate 733ffc7051SMatthew DillonThis specifies the burst accumulation rate in bytes per second and 743ffc7051SMatthew Dillonultimately controls the write bandwidth to swap averaged over a long 753ffc7051SMatthew Dillonperiod of time. 763ffc7051SMatthew DillonThis parameter must be carefully chosen to manage the write endurance of 773ffc7051SMatthew Dillonthe SSD in order to avoid wearing it out too quickly. 783ffc7051SMatthew DillonEven though SSDs have limited write endurance there is massive 793ffc7051SMatthew Dilloncost/performance benefit to using one in a swapcache configuration. 803ffc7051SMatthew Dillon.Pp 813ffc7051SMatthew DillonLets use the Intel X25V 40G MLC SATA SSD as an example. This device 823ffc7051SMatthew Dillonhas approximately a 40TB (40 terrabyte) write endurance. 833ffc7051SMatthew DillonLimiting the long term average bandwidth to 100K/sec leads to no more 843ffc7051SMatthew Dillonthan ~9G/day writing which calculates approximately to a 12 year 853ffc7051SMatthew Dillonendurance. 863ffc7051SMatthew DillonEndurance scales linearly with size. The 80G version of this SSD 873ffc7051SMatthew Dillonwill have a write endurance of approximately 80TB. 883ffc7051SMatthew Dillon.Pp 893ffc7051SMatthew DillonMLC SSDs have approximately a 1000x write endurance, while the 9041bc85bbSMatthew Dillonlower density higher-cost SLC SSDs have an approximately 10000x 913ffc7051SMatthew Dillonwrite endurance. MLC SSDs can be used for the swapcache (and swap) 923ffc7051SMatthew Dillonas long as the system manager is cognizant of its limitations. 933ffc7051SMatthew Dillon.Pp 943ffc7051SMatthew Dillon.It Cd vm.swapcache.meta_enable 953ffc7051SMatthew DillonTurning on just 963ffc7051SMatthew Dillon.Cd meta_enable 973ffc7051SMatthew Dilloncauses only filesystem meta-data to be cached and will result 98*75d25c98SMatthew Dillonin very fast directory operations even over millions of inodes 99*75d25c98SMatthew Dillonand even in the face of other invasive operations being run 100*75d25c98SMatthew Dillonby other processes. 1013ffc7051SMatthew Dillon.Pp 1023ffc7051SMatthew Dillon.It Cd vm.swapcache.data_enable 1033ffc7051SMatthew DillonTurning on 1043ffc7051SMatthew Dillon.Cd data_enable 1053ffc7051SMatthew Dillon(with or without other features) allows bulk file data to be 1063ffc7051SMatthew Dilloncached. 1073ffc7051SMatthew DillonThis feature is very useful for web server operation when the 1083ffc7051SMatthew Dillonoperational data set fits in swap. 1093ffc7051SMatthew DillonThe usefulness is somewhat mitigated by the maximum number 1103ffc7051SMatthew Dillonof vnodes supported by the system via 1113ffc7051SMatthew Dillon.Cd kern.maxfiles , 1123ffc7051SMatthew Dillonbecause the bulk data in the cache is lost when the related 1133ffc7051SMatthew Dillonvnode is recycled. In this case it might be desireable to 1143ffc7051SMatthew Dillontake the plunge into running a 64-bit kernel which can support 1153ffc7051SMatthew Dillonfar more vnodes. 32-bit kernels have limited kernel virtual 1163ffc7051SMatthew Dillonmemory (KVM) and cannot reliably support more than around 117788ef3f9SMatthew Dillon100,000 active vnodes. 64-bit kernels can support 300,000+ 118788ef3f9SMatthew Dillonactive vnodes. 119788ef3f9SMatthew Dillon.Pp 120788ef3f9SMatthew DillonData caching is definitely more wasteful of SSD write bandwidth 121788ef3f9SMatthew Dillonthan meta-data caching. It doesn't hurt performance per-say, 122788ef3f9SMatthew Dillonbut may cause the 123788ef3f9SMatthew Dillon.Nm 124788ef3f9SMatthew Dillonto exhaust its burst and smack against the long term average 125788ef3f9SMatthew Dillonbandwidth limit, causing the SSD to wear out at the maximum rate you 126788ef3f9SMatthew Dillonprogrammed. Data caching is far less wasteful and more efficient 127788ef3f9SMatthew Dillonif (on a 64-bit system only) you provide a sufficiently large SSD and 128788ef3f9SMatthew Dillonincrease 129788ef3f9SMatthew Dillon.Cd kern.maxvnodes 130788ef3f9SMatthew Dillonto cover the entire directory topology being served. 131788ef3f9SMatthew DillonEach vnode requires about 1K of physical ram. 1323ffc7051SMatthew Dillon.Pp 1333ffc7051SMatthew Dillon.It Cd vm.swapcache.maxfilesize 1343ffc7051SMatthew DillonThis may be used to reduce cache thrashing when a focus on a small 1353ffc7051SMatthew Dillonpotentially fragmented filespace is desired, leaving the 1363ffc7051SMatthew Dillonlarger files alone. 1373ffc7051SMatthew Dillon.Pp 1383ffc7051SMatthew Dillon.It Cd vm.swapcache.minburst 1393ffc7051SMatthew DillonThis controls hysteresis and prevents nickle-and-dime write bursting. 1403ffc7051SMatthew DillonOnce 1413ffc7051SMatthew Dillon.Cd curburst 1423ffc7051SMatthew Dillondrops to zero writing to the swapcache ceases until it has recovered 1433ffc7051SMatthew Dillonpast 1443ffc7051SMatthew Dillon.Cd minburst . 1453ffc7051SMatthew DillonThe idea here is to avoid creating a heavily fragmented swapcache where 1463ffc7051SMatthew Dillonreading data from a file must alternate between the cache and the primary 1473ffc7051SMatthew Dillonfilesystem. Doing so does not save disk seeks on the primary filesystem 1483ffc7051SMatthew Dillonso we want to avoid doing small bursts. This parameter allows us to do 1493ffc7051SMatthew Dillonlarger bursts. 1503ffc7051SMatthew DillonThe larger bursts also tend to improve SSD performance as the SSD itself 1513ffc7051SMatthew Dilloncan do a better job write-combining and erasing blocks. 1523ffc7051SMatthew Dillon.Pp 1533ffc7051SMatthew Dillon.El 1543ffc7051SMatthew Dillon.Pp 1553ffc7051SMatthew DillonFinally, interleaved swap (multiple SSDs) may be used to increase 1563ffc7051SMatthew Dillonperformance even further. A single SATA SSD is typically capable of 1573ffc7051SMatthew Dillonreading 120-220MB/sec. Configuring two SSDs for your swap will 158788ef3f9SMatthew Dillonimprove aggregate swapcache read performance by 1.5x to 1.8x. 159788ef3f9SMatthew DillonIn tests with two Intel 40G SSDs 300MB/sec was easily achieved. 160788ef3f9SMatthew Dillon.Pp 161788ef3f9SMatthew DillonAt this point you will be configuring more swap space than a 32 bit 1623ffc7051SMatthew Dillon.Dx 1633ffc7051SMatthew Dillonkernel can handle (due to KVM limitations). By default, 32 bit 1643ffc7051SMatthew Dillon.Dx 1653ffc7051SMatthew Dillonsystems only support 32G of configured swap and while this limit 1663ffc7051SMatthew Dilloncan be increased somewhat in 1673ffc7051SMatthew Dillon.Pa /boot/loader.conf 1683ffc7051SMatthew Dillonyou should really be using a 64-bit 1693ffc7051SMatthew Dillon.Dx 1703ffc7051SMatthew Dillonkernel instead. 64-bit systems support up to 512G of swap by default 171788ef3f9SMatthew Dillonand can be boosted to up to 8TB if you are really crazy and have enough ram. 172788ef3f9SMatthew DillonEach 1GB of swap requires around 1MB of physical memory to manage it so 173*75d25c98SMatthew Dillonthe practical limit is more around 1TB of swap. 174788ef3f9SMatthew Dillon.Pp 175788ef3f9SMatthew DillonOf course, a 1TB SSD is something on the order of $3000+ as of this writing. 176*75d25c98SMatthew DillonEven though a 1TB configuration might not be cost effective, storage levels 177788ef3f9SMatthew Dillonmore in the 100-200G range certainly are. If the machine has only a 1GigE 178788ef3f9SMatthew Dillonethernet (100MB/s) there's no point configuring it for more SSD bandwidth. 179788ef3f9SMatthew DillonA single SSD of the desired size would be sufficient. 1803ffc7051SMatthew Dillon.Sh INITIAL BURSTING & REPEATED BURSTING 1813ffc7051SMatthew DillonEven though the average write bandwidth is limited it is desireable 1823ffc7051SMatthew Dillonto have a large initial burst after boot to load the cache. 1833ffc7051SMatthew Dillon.Cd curburst 1843ffc7051SMatthew Dillonis initialized to 4GB by default and you can force rebursting 1853ffc7051SMatthew Dillonby adjusting it with a sysctl. 1863ffc7051SMatthew DillonRemember that 1873ffc7051SMatthew Dillon.Cd curburst 1883ffc7051SMatthew Dillondynamically tracks burst and will go up and down depending. 1893ffc7051SMatthew Dillon.Pp 1903ffc7051SMatthew DillonIn addition there will be periods of time where the system is in 1913ffc7051SMatthew Dillonsteady state and not writing to the swapcache. During these periods 1923ffc7051SMatthew Dillon.Cd curburst 1933ffc7051SMatthew Dillonwill inch back up but will not exceed 1943ffc7051SMatthew Dillon.Cd maxburst . 1953ffc7051SMatthew DillonThus the 1963ffc7051SMatthew Dillon.Cd maxburst 1973ffc7051SMatthew Dillonvalue controls how large a repeated burst can be. 1983ffc7051SMatthew Dillon.Pp 1993ffc7051SMatthew DillonA second bursting parameter called 2003ffc7051SMatthew Dillon.Cd vm.swapcache.minburst 2013ffc7051SMatthew Dilloncontrols bursting when the maximum write bandwidth has been reached. 2023ffc7051SMatthew DillonWhen 2033ffc7051SMatthew Dillon.Cd minburst 2043ffc7051SMatthew Dillonreaches zero write activity ceases and 2053ffc7051SMatthew Dillon.Cd curburst 2063ffc7051SMatthew Dillonis allowed to recover up to 2073ffc7051SMatthew Dillon.Cd minburst 2083ffc7051SMatthew Dillonbefore write activity resumes. The recommended range for the 2093ffc7051SMatthew Dillon.Cd minburst 2103ffc7051SMatthew Dillonparameter is 1MB to 50MB. This parameter has a relationship to 2113ffc7051SMatthew Dillonhow fragmented the swapcache gets when not in a steady state. 2123ffc7051SMatthew DillonLarge bursts reduce fragmentation and reduce incidences of 2133ffc7051SMatthew Dillonexcessive seeking on the hard drive. If set too low the 2143ffc7051SMatthew Dillonswapcache will become fragmented within a single regular file 2153ffc7051SMatthew Dillonand the constant back-and-forth between the swapcache and the 2163ffc7051SMatthew Dillonhard drive will result in excessive seeking on the hard drive. 2173ffc7051SMatthew Dillon.Sh SWAPCACHE SIZE & MANAGEMENT 2183ffc7051SMatthew DillonThe swapcache feature will use up to 75% of configured swap space. 2193ffc7051SMatthew DillonThe remaining 25% is reserved for normal paging operation. 220*75d25c98SMatthew DillonThe system operator should configure at least 4 times the SWAP space 221*75d25c98SMatthew Dillonverses main memory and no less than 8G of swap space. 2223ffc7051SMatthew DillonIf a 40G SSD is used the recommendation is to configure 16G to 32G of 223788ef3f9SMatthew Dillonswap (note: 32-bit is limited to 32G of swap by default, for 64-bit 224788ef3f9SMatthew Dillonit is 512G of swap). 2253ffc7051SMatthew Dillon.Pp 2263ffc7051SMatthew DillonIf swapcache reaches the 75% limit it will begin tearing down swap 2273ffc7051SMatthew Dillonin linear bursts by iterating through available VM objects, until 2283ffc7051SMatthew Dillonswap space use drops to 70%. The tear-down is limited by the rate at 2293ffc7051SMatthew Dillonwhich new data is written and this rate in turn is often limited 2303ffc7051SMatthew Dillonby 2313ffc7051SMatthew Dillon.Cd vm.swapcache.accrate , 2323ffc7051SMatthew Dillonresulting in an orderly replacement of cached data and meta-data. 2333ffc7051SMatthew DillonThe limit is typically only reached when doing full data+meta-data 2343ffc7051SMatthew Dilloncaching with no file size limitations and serving primarily large 235788ef3f9SMatthew Dillonfiles, or (on a 64-bit system) bumping kern.maxvnodes up to very 236788ef3f9SMatthew Dillonhigh values. 237788ef3f9SMatthew Dillon.Sh NORMAL SWAP PAGING ACTIVITY WITH SSD SWAP 238788ef3f9SMatthew DillonThis is not a function of 239788ef3f9SMatthew Dillon.Nm 240788ef3f9SMatthew Dillonper-say but instead a normal function of the system. Most systems have 241788ef3f9SMatthew Dillonsufficient memory that they do not need to page memory to swap. These 242788ef3f9SMatthew Dillontypes of systems are the ones best suited for MLC SSD configured swap 243788ef3f9SMatthew Dillonrunning with a 244788ef3f9SMatthew Dillon.Nm 245788ef3f9SMatthew Dillonconfiguration. 246788ef3f9SMatthew DillonSystems which modestly page to swap, in the range of a few hundred 247788ef3f9SMatthew Dillonmegabytes a day worth of writing, are also well suited for MLC SSD 248788ef3f9SMatthew Dillonconfigured swap. Desktops usually fall into this category even if they 249788ef3f9SMatthew Dillonpage out a bit more because swap activity is governed by the actions of 250788ef3f9SMatthew Dillona single person. 251788ef3f9SMatthew Dillon.Pp 252788ef3f9SMatthew DillonSystems which page anonymous memory heavily when 253788ef3f9SMatthew Dillon.Nm 254788ef3f9SMatthew Dillonwould otherwise be turned off are not usually well suited for MLC SSD 255788ef3f9SMatthew Dillonconfigured swap. Heavy paging activity is not governed by 256788ef3f9SMatthew Dillon.Nm 257788ef3f9SMatthew Dillonbandwidth control parameters and can lead to excessive uncontrolled 258788ef3f9SMatthew Dillonwriting to the MLC SSD, causing premature wearout. You would have to 25941bc85bbSMatthew Dillonuse the lower density, more expensive SLC SSD technology (which has 10x 260*75d25c98SMatthew Dillonthe durability). This isn't to say that 261788ef3f9SMatthew Dillon.Nm 262788ef3f9SMatthew Dillonwould be ineffective, just that the aggregate write bandwidth required 263788ef3f9SMatthew Dillonto support the system would be too large for MLC flash technologies. 264788ef3f9SMatthew Dillon.Pp 265*75d25c98SMatthew DillonWith this caveat in mind SSD based paging on systems with insufficient 266788ef3f9SMatthew Dillonram can be extremely effective in extending the useful life of the system. 267*75d25c98SMatthew DillonFor example, a system with a measily 192MB of ram and SSD swap can run 268*75d25c98SMatthew Dillona -j 8 parallel build world in a little less than twice the time it 269*75d25c98SMatthew Dillonwould take if the system had 2G of ram, whereas it would take 5x to 10x 270788ef3f9SMatthew Dillonas long with normal HD based swap. 271*75d25c98SMatthew Dillon.Sh WARNINGS 2723ffc7051SMatthew DillonSSDs have limited durability and 2733ffc7051SMatthew Dillon.Nm 2743ffc7051SMatthew Dillonparameters should be carefully chosen to avoid early wearout. 2753ffc7051SMatthew DillonFor example, the Intel X25V 40G SSD has a nominal 40TB (terrabyte) 2763ffc7051SMatthew Dillonwrite durability. 2773ffc7051SMatthew DillonGenerally speaking you want to select parameters that will give you 278788ef3f9SMatthew Dillonat least 5 years of service life. 10 years is a good compromise. 2793ffc7051SMatthew Dillon.Pp 2803ffc7051SMatthew DillonDurability typically scales with size and also depends on the 2813ffc7051SMatthew Dillonwear-leveling algorithm used by the device. Durability can often 2823ffc7051SMatthew Dillonbe improved by configuring less space (in a manufacturer-fresh drive) 2833ffc7051SMatthew Dillonthan the drive's capacity. For example, by only using 32G of a 40G 284*75d25c98SMatthew DillonSSD. SSDs typically implement 10% more storage than advertised and 285*75d25c98SMatthew Dillonuse this storage to improve wear leveling. As cells begin to fail 286*75d25c98SMatthew Dillonthis overallotment slowly becomes part of the primary storage 287*75d25c98SMatthew Dillonuntil it has been exhausted. After that the SSD has basically failed. 288*75d25c98SMatthew DillonKeep in mind that if you use a larger portion of the SSDs advertised 289*75d25c98SMatthew Dillonstorage the SSD will not know if/when you decide to use less unless 290*75d25c98SMatthew Dillonappropriate TRIM commands are sent (if supported), or a low level 291*75d25c98SMatthew Dillonfactory erase is issued. 2923ffc7051SMatthew Dillon.Pp 2933ffc7051SMatthew DillonThe swapcache is designed for use with SSDs configured as swap and 2943ffc7051SMatthew Dillonwill generally not improve performance when a normal hard drive is used 2953ffc7051SMatthew Dillonfor swap. 296788ef3f9SMatthew Dillon.Pp 297788ef3f9SMatthew Dillon.Nm smartctl 298788ef3f9SMatthew Dillon(from pkgsrc's smartmontools) may be used to retrieve the wear indicator 299788ef3f9SMatthew Dillonfrom the drive. 300788ef3f9SMatthew DillonOne usually runs something like 'smartctl -d sat -a /dev/daXX' 301788ef3f9SMatthew Dillon(for AHCI/SILI/SCSI), or 'smartctl -a /dev/adXX' for NATA. Many SSDs 302788ef3f9SMatthew Dillonwill brick the SATA port when smart operations are done while the drive 303788ef3f9SMatthew Dillonis busy with normal activity, so the tool should only be run when the 304788ef3f9SMatthew DillonSSD is idle. 305788ef3f9SMatthew Dillon.Pp 306*75d25c98SMatthew DillonId 232 (0xe8) in the SMART data dump indicates available reserved 307*75d25c98SMatthew Dillonspace and Id 233 (0xe9) is the wear-out meter. Reserved space 308*75d25c98SMatthew Dillontypically starts at 100 and decrements to 10, after which the SSD 309*75d25c98SMatthew Dillonis considered to operate in a degraded mode. The wear-out meter 310*75d25c98SMatthew Dillontypically starts at 99 and decrements to 0, after which the SSD 311*75d25c98SMatthew Dillonhas failed. 312*75d25c98SMatthew DillonWear on SSDs is a function only of the write durability which is 313*75d25c98SMatthew Dillonessentially just the total aggregate sectors written. 314*75d25c98SMatthew Dillon.Nm 315*75d25c98SMatthew Dillontends to use large 64K writes as well as operates in a bursty fashion 316*75d25c98SMatthew Dillonwhich the SSD is able to take significant advantage of. 317*75d25c98SMatthew DillonPower-on hours, power cycles, and read operations do not really effect wear. 318788ef3f9SMatthew Dillon.Pp 319788ef3f9SMatthew DillonSSD's with MLC-based flash technology are high-density, low-cost solutions 320788ef3f9SMatthew Dillonwith limited write durability. SLC-based flash technology is a low-density, 32141bc85bbSMatthew Dillonhigher-cost solution with 10x the write durability as MLC. The durability 322788ef3f9SMatthew Dillonalso scales with the amount of flash storage, with SLC based flash typically 323788ef3f9SMatthew Dillontwice as expensive per gigabyte. From a cost perspective SLC based flash 32441bc85bbSMatthew Dillonis at least 5x more cost effective in situations where high write 32541bc85bbSMatthew Dillonbandwidths are required (lasting 10x longer). MLC is at least 2x more 32641bc85bbSMatthew Dilloncost effective in situations where high write bandwidths are not required. 32741bc85bbSMatthew DillonWhen wear calculations are in years these differences become huge. 328788ef3f9SMatthew Dillon.Nm 329788ef3f9SMatthew Dillonis usable with both technologies. 3303ffc7051SMatthew Dillon.Sh SEE ALSO 3313ffc7051SMatthew Dillon.Xr swapon 8 , 3323ffc7051SMatthew Dillon.Xr fstab 5 3333ffc7051SMatthew Dillon.Sh HISTORY 3343ffc7051SMatthew Dillon.Nm 3353ffc7051SMatthew Dillonfirst appeared in 3363ffc7051SMatthew Dillon.Dx 2.5 . 3373ffc7051SMatthew Dillon.Sh AUTHORS 3383ffc7051SMatthew Dillon.An Matthew Dillon 339