5 ms·
Ask HN: On the importance of RAM: Is Paging as bad on an SSD as it is on an HDD?
We all know that paging is bad. In an ideal world - you want all your memory in RAM so that everything is on the bus.
My question is from a relativistic standpoint: when paging takes place, is it as slow on an SSD as it is on an HDD? Is the bottleneck the transfer time over the bus or the seek time itself?
For context: I am debating moving from an SSD Macbook Pro to an SSD Macbook Air, which would require moving from 8 GB RAM to 4 GB RAM. I am interested in the technical answer though as well as the pragmatic one.
- senko 15y agoIf you need more than 4G of memory (ie. if you think it's probable that swap is going to get used), using 8G + HDD is a no-brainer. SSD is a fantastic improvement over HDD, but the difference between memory -> disk is not a factor of few (like HDD->SDD), it's orders of magnitude.
- patio11 15y agoAs to whether an HDD or SSD wins on any given paging operation, it is going to depend on things like workload, contention for system resources, the locality of reference among memory you need, how efficient your OS and applications are at optimizing memory access, etc etc etc. As to whether memory or $ARBITRARY_NONVOLATILE_STORAGE_TECHNOLOGY wins, however, there is no question. Data in RAM will beat data not in RAM, every single time, just like data in cache beats data not in cache, every single time. It is not a close-run thing, either. See: http://news.ycombinator.com/item?id=702887 http://news.ycombinator.com/item?id=702887 Relatedly: RAM is the best bang-for-the-buck of any feature on your computer for programmers. If you feel the need to settle for less, settle for less anywhere but on RAM. Slower HD? Oh well. Slower CPU? Oh well. Skimping on RAM? Welcome to Painsville, population: you.
- pasbesoin 15y agoIf you're maintaining a somewhat older system whose RAM has not been maxed out, max it out before your RAM configuration reaches the scarcity-based upswing in price that eventually occurs. Even if you're not keeping the system, you can pass on a perfectly usable system to a family member, friend, or good cause. (Or help same to keep their existing system useful for an extra year or three.)
- deleted 15y ago[deleted]
- sigil 15y ago"Numbers everyone should know", from Google's Jeff Dean, has part of the answer: http://julianhyde.blogspot.com/2010/11/numbers-everyone-should-know.html http://julianhyde.blogspot.com/2010/11/numbers-everyone-shou... Where do SSDs fit in? Not sure, but I've heard SSD read latency can be as low as 30,000 ns (compare to HDD seek time of ~10,000,000 ns), while SDD sequential read rates are still within one order of magnitude of HDD read rates. YMMV depending on your access patterns. Lots of random access? SDDs a clear win over HDDs because of the seek time penalty. (I'd guess lots of random access is almost always the norm, except for certain specialized server workloads.)
- ahaslam 15y agoI also agree that spending on RAM will get you more bang for the buck - speeding up the inherently slow paging process before trying to prevent it in the first place doesn't really make sense, especially considering that a RAM upgrade will likely be cheaper. I recently spec'd and built a new machine including a 110Gb PCIe SSD. As expected, it's pretty impressive for the low latency but it is also expensive and there's a couple of points worth mentioning about the general experience: What I have noticed is that at these limited sizes, it's not long before your SSD volumes are maxed out and you end up having to choose and manage the datasets that reside on it - so a new PITA to deal with. What also surprised me is that the technology was still a bit flaky - I had to tweak not only my BIOS but Windows 7 to use it reliably. Even when that was sorted out, the flaky impression was reinforced when I tried some conservative RAM overclocking on the i7 Extreme - to find that I was starting to get FS corruption issues. So I now have a bank of fast RAM running at some fraction of their potential in deference to retaining FS integrity. I'm not sure whether these issues are a result of the engineering required to address the SSD over PCIe - maybe SSD's accessed over SATA don't suffer the same issues. So SSD is promising but not there yet.
- drallison 15y agoPaging is not necessarily bad. It enables an address space larger than physical memory at some overhead cost. If the working set for all running programs fits in RAM, the cost of paging is small. Paging from a HDD or a SDD is not going to have much impact if it is done infrequently and can be overlapped with useful fork.
- SoftwareMaven 15y agoI've run a 13" aluminum MacBook with 4gb RAM and a normal HDD for quite a while, in using with Xcode, Emacs, Chrome, and background servers running without feeling painful swapping. If you are constantly jumping between more apps than these (or use Eclipse ;), you might run into problems. If you aren't, I think you would be fine. FWIW, I am very seriously considering buying a new MacBook Air. Now, i5 or i7?
- fleitz 15y agoPaging is workload is generally dominated by random IO. In general paging will be much faster on an SSD than a spindle because random IO destroys throughput in MB/sec on a spindled disk. Memory is the new disk and in general what will kill you performance-wise between the Pro and the Air is the CPU cache. You're only going to notice the difference between 4 GB and 8 GB if your working set exceeds 4 GB. On 8GB I run Photoshop, XCode, Chrome, a couple VMs, and some other memory hungry processes, however, at any given time I'm generally only using a couple of those processes, eg. Chrome / Photoshop, or XCode / Photoshop, or Vim / VMs, or Vim / Chrome. It sometimes takes a few seconds for the VMs to start performing properly or XCode to become responsive but it's only when I switch tasks that I notice it. I'd recommend against switching to the Air for increased performance. If you really want to know what it's like with 4GB why not just take 4GB out of your Pro and see if you can live with it?
- gcp 15y agoSeek latency is 50x faster and transfer rates are 2 to 5x faster for SSD vs HD. Paging on the SSD is faster. Situations where you would have trashing (i.e. seeking during paging) are noticeably faster. If your working set doesn't fit in 4G, it's still going to be too slow.