LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 01-21-2009, 09:42 PM   #1
tyggna
LQ Newbie
 
Registered: Jul 2007
Posts: 14

Rep: Reputation: 0
I want get Linux to see an HD as ram, but without using swap


I had an idea, and I want to bounce this off of the Linux community at large.

I've done a lot of work with NFS, and I find the best way to improve NFS is to give it more cache to work with on the server. As expected, Linux only caches data off the hard drive until it has filled available ram.

Normally, it seems absurd to use the swap file to cache things off the hard drive, but that is what I want to do.

My idea was to use a SSD Raid array as my swap partition and keep the bulk of user data on platters. That, unfortunately, won't help to speed up NFS response times, because it'll only expand the cache to fill available ram proper.

So my question is, where would I start looking to have Linux see my SSD as ram? Any ideas?

I'm hoping for a cool hackish solution using Linux tools and the /dev or /proc directories, but I'm not opposed to digging in and altering kernel code if needs be.
 
Old 01-21-2009, 10:06 PM   #2
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
So in other words, you want the kernel to address a physical device as if it where RAM, not just as a swap device?
 
Old 01-21-2009, 10:12 PM   #3
tyggna
LQ Newbie
 
Registered: Jul 2007
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by MS3FGX View Post
So in other words, you want the kernel to address a physical device as if it were RAM, not just as a swap device?
Exactly, any ideas?
 
Old 01-21-2009, 10:25 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
You are describing something similar to a layered filesystem such as unionfs, but you have it backwards. That last thing you want to do is use an ssd for swap. The ssd drive has a limited number of writes. Reads may be faster but writes aren't. The main advantage of ssd over hard drives is if you have your hard drives spin down when inactive.

A better idea would be to layer a hard drive's partition over an ssd if you have a read-mainly partition. That would enable quicker reads but use platters for writes.

Last edited by jschiwal; 01-21-2009 at 10:27 PM.
 
Old 01-21-2009, 11:18 PM   #5
tyggna
LQ Newbie
 
Registered: Jul 2007
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jschiwal View Post
The ssd drive has a limited number of writes. Reads may be faster but writes aren't. The main advantage of ssd over hard drives is if you have your hard drives spin down when inactive.
I get what you're saying, but I'm not particularly concerned about the health or life of the SSD drive. If it's trashed in a year or two, I won't cry. My main concern is speed--just delivering the data off the hard drive to the client. The caching system is adequate to do this, but it's hard to stick all the ram required to handle several hundred NFS clients.

That's kinda why I'm looking for this hackish solution, because it'll spare us the financial pain of going with 15k rpm SCSI drives.

Also, we're looking at holding several dozen terrabytes of data storage on this machine, so it really isn't practical to put that amount of data on a SSD.

If we hosted programs over NFS, then I'd use that setup in a heartbeat.
 
Old 01-22-2009, 11:20 PM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
An ssd drive will have worse write performance unless the system caches writes in ram. There are battery backed-up ram cache cards for raid-5 arrays.
 
Old 01-23-2009, 08:44 AM   #7
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 11,221
Blog Entries: 3

Rep: Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437
Hi,
Quote:
Originally Posted by jschiwal View Post
An ssd drive will have worse write performance unless the system caches writes in ram. There are battery backed-up ram cache cards for raid-5 arrays.
Where are you getting the information on 'SSD'?

Quote:
The ssd drive has a limited number of writes. Reads may be faster but writes aren't. The main advantage of ssd over hard drives is if you have your hard drives spin down when inactive.
'SSD' are faster read/write than a hdd. Non-destructive R/W for a 'SSD', most have battery backup. If the 'SSD' had a limited number of writes then your RAM will have the same. I think your confusing the situation with a 'Flash'. 'SSD' is not a 'Flash' which does have limited writes. The big problem with 'SSD' is the limited size available but the density will be changing in the near future.

The speed advantage with 'SSD' is that no mechanical latency or propagation due to the rotating platter or the head seek that must be performed by a hdd subsystem. We've been using 'SSD' as ramdisk for years, the size of the memory was the restricting limitation not the R/W to the device. Why do you think that most distro use a initrd? Speed!
 
Old 01-23-2009, 10:36 AM   #8
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 163Reputation: 163
Quote:
Originally Posted by tyggna View Post
I had an idea...<SNIP>... but I'm not opposed to digging in and altering kernel code if needs be.
Even better... http://techreport.com/articles.x/16255
 
Old 01-23-2009, 04:18 PM   #9
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 11,221
Blog Entries: 3

Rep: Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437
Hi,

Thanks for the link! Good review for the 'Acard'.
 
Old 01-23-2009, 05:28 PM   #10
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,536

Rep: Reputation: 178Reputation: 178
You have three different storage speeds, in descending order RAM, SSD, and disk. If you set up SSD as being RAM then the RAM access speed will drop significantly and the CPU will appear to run much slower. Years ago I watched a company trying to utilize a combination of fast RAM, slow RAM, and disk. They told the operating system that fast RAM and slow RAM were all the same and no matter what they did they got a slower running system than if they just left slow RAM out completely. The technology of the day was not such that they could try using the slow RAM as a fast disk.

If you set up SSD as being disk then the disk access speed will increase, perhaps significantly. You would try to arrange the file system so that the most active part of the file system (journal?) is on the fastest device (SSD).

With NFS the slowest part of the system is almost always the network. So I suggest that you set up the NFS by including SSD as part of the NFS. Then set up the NFS so that the most active part of the NFS is on the SSD.

Your next question is of course, How? I don't know. But I think jschiwal is on the right track when he suggests:

Quote:

A better idea would be to layer a hard drive's partition over an ssd if you have a read-mainly partition. That would enable quicker reads but use platters for writes.
----------------------
Steve Stites

Last edited by jailbait; 01-23-2009 at 05:30 PM.
 
Old 01-23-2009, 07:52 PM   #11
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 11,221
Blog Entries: 3

Rep: Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437
Hi,
Quote:
Originally Posted by jailbait View Post
You have three different storage speeds, in descending order RAM, SSD, and disk. If you set up SSD as being RAM then the RAM access speed will drop significantly and the CPU will appear to run much slower. Years ago I watched a company trying to utilize a combination of fast RAM, slow RAM, and disk. They told the operating system that fast RAM and slow RAM were all the same and no matter what they did they got a slower running system than if they just left slow RAM out completely. The technology of the day was not such that they could try using the slow RAM as a fast disk.

'SSD' are independent of the system DRAM. The 'SSD' is a subsystem that is treated independent. The nice thing about a 'SSD' is that the local memory controller takes care of the timing for the 'SSD DRAM' therefore it will be transparent to the system overhead. If you setup a portion of the system DRAM to be a ramdisk then you certainly would have more overhead. The gains of a modern 'SSD' would surpass the old style of ramdisks. One the speed for the access of the 'SSD' would be greater. Second the way the 'SSD' is interfaced to the system will ideally surpass any older style ramdisk. Our current memory technology will be efficient except for the density of the 'SSD' but that will be changing in the next generation of memory and controller.

Quote:
Originally Posted by jailbait View Post
If you set up SSD as being disk then the disk access speed will increase, perhaps significantly. You would try to arrange the file system so that the most active part of the file system (journal?) is on the fastest device (SSD).

With NFS the slowest part of the system is almost always the network. So I suggest that you set up the NFS by including SSD as part of the NFS. Then set up the NFS so that the most active part of the NFS is on the SSD.

Your next question is of course, How? I don't know. But I think jschiwal is on the right track when he suggests:
----------------------
Steve Stites
Most 'SSD' are designated as a drive on the system that it is installed in. Most are SATA but there are units that utilize EIDE.

As for how the 'SSD' utilization I would probably setup so the system activity for hdd would be maximized with the 'SSD'. Setup could be done at boot so the 'SSD' partitions are mounted to the proper mount points.

As for the transfer for 'SSD' it can be around 300MB/s, some manufactures claim speeds of at least 400MB/s. Of course the interface type would be SATA to get those speeds.

To use the 'SSD' for NFS would be one way but I wouldn't commit the whole drive. Your partition scheme would be important with a 'SSD' so as to provide a proficient drive.
 
  


Reply

Tags
hacks, ram, ssd, swap


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Linux: Should You Use Twice the Amount of Ram as Swap Space? LXer Syndicated Linux News 1 11-19-2008 05:02 PM
Why using swap when RAM is available? MasterOfTheWind Linux - General 3 10-06-2006 12:45 PM
telling linux to use not ram but swap ? supersucker Linux - Newbie 5 05-19-2005 05:28 PM
A how to: How much Swap to setup/Linux eats my RAM MasterC Linux - General 5 01-13-2004 06:30 AM
16 GB of RAM and Linux still uses over 1 GB of a 2 GB swap partition!? lumberjack77 Linux - Software 8 09-25-2003 01:07 PM


All times are GMT -5. The time now is 12:10 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration