Linux ssd as hdd cache

What are the advantages/disadvantages of different SSD to HDD cacheing options (dm-cache, flashcashe. )?

Are there any noteworthy differences in the various implementations? Which one is best for regular desktop PC use — to increase performance of usual programs such as web browsers or games?

To increase performance I found that the installation of 64bit ubuntu, worked great, my machine got even faster than before! Also, about cache you should use ram compressed cache with this package zram-config that will get priority on swap usage. And, store the game on the SDD and test it up. Some games wont work much faster, others will work great! I prefer to not use SDD as cache because of its writes limit but SDDs are getting cheaper so thats not so much concern anymore 🙂

2 Answers 2

I really don’t know where to start, since all this is excellent information. I will start with some info about SSD’s, then a description of all the different caching methods, and just go from there. I hope that you

  • Price: SSDs are somehow expensive
  • Maximum and Common Capacity: High capacity SSD’s are very rare and expensive
  • Speed: This is where SSDs gets the edge
  • Durability: An SSD has no moving parts

Best to have a hybrid system, to have the best of both worlds (capacity, reliability, speed, etc.)

The Linux 3.9 kernel (made available on April 28, 2013) introduces SSD caching. The kernel’s Device mapper now includes a cache target called dm-cache that enables SSDs or other storage device to be used as a cache for a hard drive. It essentially speeds up data writes and reads as it allows the faster SSD to first cache data and then transfer it to the slower hard drive.

Flashcache is a module originally written and released by Facebook(Mohan Srinivasan, Paul Saab and Vadim Tkachenko) in April of 2010. It is a kernel module that allows Writethrough caching of a drive on another drive. This is most often used for caching a rotational drive on a smaller solid-state drive for performance reasons. This gives you the speed of an SSD and the size of a standard rotational drive for recently cached files. FlashCache is a general purpose writeback block cache for Linux.

Bcache is a Linux kernel block layer cache. It allows one or more fast disk drives such as flash-based solid state drives (SSDs) to act as a cache for one or more slower hard disk drives.

Hard drives are cheap and big, SSDs are fast but small and expensive. Wouldn’t it be nice if you could transparently get the advantages of both? With Bcache, you can have your cake and eat it too.

Bcache patches for the Linux kernel allow one to use SSDs to cache other block devices. It’s analogous to L2Arc for ZFS, but Bcache also does writeback caching (besides just write through caching), and it’s filesystem agnostic. It’s designed to be switched on with a minimum of effort, and to work well without configuration on any setup. By default it won’t cache sequential IO, just the random reads and writes that SSDs excel at. It’s meant to be suitable for desktops, servers, high end storage arrays, and perhaps even embedded.

The design goal is to be just as fast as the SSD and cached device (depending on cache hit vs. miss, and writethrough vs. writeback writes) to within the margin of error. It’s not quite there yet, mostly for sequential reads. But testing has shown that it is emphatically possible, and even in some cases to do better — primarily random writes.

Bcache has a big disadvantage, and that it takes away memory from the system to implement the cache.

EnhanceIO is a solution that runs beneath the application layer, enabling applications to utilize the performance benefits of SSDs without major IT infrastructure changes. An SSD cache can yield most of the benefits of switching from HDDs to SSDs at a fraction of the cost of an all-SSD system. A cached system typically operates on less power than an HDD-based system of similar performance, and that creates a side benefit by reducing cooling requirements.

An SSD cache can also extend the useful life of an existing system by improving performance to meet growing demands through an incremental investment, rather than through a wholesale upgrade/replacement of the existing system.

Caching also enables faster access to the data without the extra storage administration overhead to acquire and install new disk shelves, configuring new LUNs and migrating data to the new LUNs. Caching is almost transparent and requires little if any downtime. EnhanceIO is based upon Flashcache.

bcache is the most worthless of all because it requires specially prepared (formatted) data partition. This makes it difficult (if possible) to attach cache to existing partition with data as one would need 200% capacity and to perform long data-moving in order to activate/deactivate caching.

The brilliance of EnhanceIO is that it doesn’t need intermediate device at all and can be attached to any block device on-the-fly even when device is already mounted. Another super-cool thing is that you can attach EnhanceIO cache not just to partition but to partitioned block device to cache all its partitions at once. Just like flashcache enchanceio modules are built with DKMS and can be used with older kernels.

DM Cache Advantages

DM caches use a simplified architecture, which makes them adaptable and easy to customize. Users can adjust the block size and the cache capacity based on the amount of data it will have to handle or on the value of the data. If a particular application needs to store a great deal of data in sequence, users can configure the cache for that purpose. If a user wants to record information in a database simultaneously with the cache, that won’t interfere with the cache’s operations.

DM Cache Dis-Advantages

One drawback to using a DM cache is that the Linux operating system has limited space for storing metadata. If the cache is large, and includes lots of small blocks, that adds up to a lot of metadata for the stored information. To solve this problem, the user must increase the block size. Another possible problem is that, after a server crash, the cache metadata may no longer match the cache contents, though it is possible to restore the correct configuration eventually.

Source: Complements of Fraser Sherman

Читайте также:  Cpu stress testing linux

So from the above information it’s clear that EnhanceIO is the way to go, but in my opinion since it’s based on Flashcache, I would go with flash cache. But I will definitely try both of them before making a final decision.

Источник

Ssd как кэш к hdd, дабы не скрипело

Есть шум винта, который бесит и не очень частая потребность хранить/доставать большие файлы.

Сейчас делаю как — монтирую терабайтник вручную когда нужно, делаю делишки, размонтирую, кладу винт в сон hdparm’ом.

Как хотелось бы — индекс ФС винта и наиболее часто требуемые данные хранятся в разделе(часть хочется использовать на отдельном разделе как обычный ssd) ssd. Если обращений к винту нет — он именно, что засыпает. Если есть кэш мисс — диск просыпается, происходит lru вытеснение данных с заменой на файл к которому происходит обращение. Скорость обращения к данным не из кэша — значения не имеет. Но, важно, что если были обращения к данным которые не умещаются в кэш, а потом файл был закрыт — диск должен автоматом уснуть. Ну, и, всё это хозяйство монтируется как некая FS что бы работать с данными можно было без дополнительных телодвижений.

UPD: на скорость по факту действительно начхать, т.е. хотелось бы ФС которая хранила бы метаданные на одном диске, а сами данные на втором. Т.е. пока происходят всякие listdir и fstat не было обращений к харду и он мог сладко спать.

Забей, с любой технологией оно будет теребить диск гораздо чаще, чем хочется при таком кейсе.

Копать в сторону продажи и SDD, и HDD. И покупке 1ТБ SSD.

Читайте также:  Linux скриншот части экрана

Сам пользуешься хоть чем то из этого? Или просто решил погуглить за меня?

Если пользуешься, то чем именно и как часто просыпается hdd?

Я за 28к себе могу хранилку без обязательств и шума в ближайшем датацентре на n лет снять.

На 1ТБ и со скоростью нормальной?

Источник

How to set up an SSD as a cache for the big Hard Drive?

I want to order https://www.fdcservers.net/order-1-w.php?plan_id=538 According to http://arstechnica.com/information-technology/2013/04/linux-3-9-brings-ssd-caching-and-drivers-to-support-modern-pcs/ linux have built in capability to allow using SSD to cache hard drive. How to do so? Where is the tutorial? This feature is already in the standard kernel right? WOuld it work on centosh? Can I just upgrade existing kernel?

2 Answers 2

Check out bcache, which is integrated into the mainline kernel from 3.10, but which should also work with older kernels with a bit of effort — you’ll have to compile your own, using the patches provided. (It’s not as scary as it sounds!)

There is also a minimal comparison of dm-cache and bcache here.

Okay, this is 11/6 now. 3 months have passed. Which one is right? Dm-cache or bcache? Which one is integrated into the mainline kernel? If it’s integrated why do I have to patch?

you have to patch due to your kernel version. centos is on 2.6 while the main version now is 3.x. you can check the change log of centos kernel and verify if they added the solutions provided or if you have to patch your kernel.

A little of google search based on your initial link, led to this.

Answering the kernel update, from what I see the latest version has kernel 2.6.32-358. So the kernel will not have this feature in it. Cent OS version and Kernel versions

Читайте также:  Получить версию linux команда

You can try and patch the device-mapper check here and also install the dm-cache (includes patching of the kernel, I did not did into it so not sure if it will work with 2.6 )check here

You must log in to answer this question.

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.14.43533

Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group.
This site is not affiliated with Linus Torvalds or The Open Group in any way.

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

Оцените статью
Adblock
detector