Setting up a virtual memory using HDD is a terrible idea
Uh oh…
Using a hard disk drive (HDD) as a swap space can be a practical solution in some cases, but it may not be ideal for all situations.
On the one hand, using an HDD as a swap space can be beneficial in terms of cost and storage capacity. HDDs are generally less expensive than solid-state drives (SSDs), and they offer much more storage capacity per dollar. Therefore, using an HDD as a swap space may be a more affordable option, especially for systems with limited budgets.
On the other hand, there are some disadvantages to using an HDD as a swap space. Compared to SSDs, HDDs are slower, and they have higher latency and access times. This can result in slower system performance, especially when accessing frequently used files or when swapping heavily.
Moreover, HDDs are mechanical devices that are prone to wear and tear. The continuous read and write operations associated with swap space usage can lead to additional wear on the HDD, which can decrease its lifespan and reliability.
Overall, whether or not using an HDD as a swap space is a good idea depends on the specific use case and system requirements. If the system has enough memory and is not swapping heavily, using an HDD as a swap space may be a reasonable solution. However, if performance is a critical factor or if the system is swapping heavily, it may be better to use an SSD or add more RAM to the system.
Ohh yeah, and one more thing…
HDD’s random I/O bottleneck can have a significant impact on swap performance (as you can see the random I/O of HDD is just 0.3 MB/s, compared to its 148 MB/s sequential).
When a system runs out of physical memory, it needs to use swap space to temporarily store data that would normally reside in RAM. This involves reading and writing data to the swap space on the hard disk drive (HDD).
Since HDDs have mechanical parts that need to physically move to access data, they can be slow when performing random I/O operations. This means that if the system is frequently accessing swap space, the HDD may have trouble keeping up with the demand, resulting in slow system performance.
In contrast, solid-state drives (SSDs) can perform random I/O operations much faster than HDDs since they don’t have mechanical parts. Therefore, using an SSD as a swap space can provide better performance and reduce the impact of random I/O operations on system performance.
Overall, if your system has a significant amount of swap usage or frequently accesses the swap space, using an SSD as a swap space may be a better option than using an HDD to avoid performance issues.