Other Uses For The Linux RAM Disk? 320
Dante_J asks: "Recently I discovered an old Amiga DOS 1.3 Manual I had lying around. While thumbing through it I remembered all the joyful days of good fun hacking. One thing I particularly remembered was how anyone with 3Mb of ram was considered especially blessed with resources because they could copy all their system files into the ram disk and have a 'trans-warp' fast machine on their hands. In this age of more Ram than sense why are Ram Disks only used for Linux installation floppies? Sure buffers are great, but why not mount /tmp to a Ram Disk, and the cache directory for Web browsers too?
Does Linux support dynamically reseizing Ram Disks? Surely they would be vital in remote booting, diskless thin clients."
One problem... (Score:3)
So you'd be better off just using that memory to allow the OS to buffer disk accesses and your programs to do their own in-memory caching than to have it act as a ramdisk.
Doug
RAMdisk for netscape cache (Score:1)
Ram is usually needed elsewhere and is expensive (Score:1)
Dynamic Sizing of Ramdisks (Score:5)
Ram disk on Macs (Score:1)
This is why we hack kernels (Score:1)
Isn't that basically putting what's most important process into the ram disk to make it run extremely fast?
Good idea, but... (Score:1)
Maybe I'll try this at work, I've got over 300 megs there.
Too bad RAM prices aren't dropping like disk storage prices...
Resizable Ramdisk + Unix = trouble (Score:2)
That being said, in some respects, its a denial of service attack waiting to happen, though probably no more than a malloc() loop...
Don't use that, use this (Score:1)
--
Uhhm... (Score:1)
Or, you could simply increase the size of the Memory Cache in Netscape. Edit...Preferences, Advanced, Cache, Memory Cache Size.
I'm not enough of an expert on Linux's tmpspace to comment on that part of the proposal... but IMO, it seems like a really bad idea.
Ramdisk as browser cache (Score:2)
But it's harder than hell (Score:1)
seems to be pointless (Score:2)
Solaris already does (Score:5)
--
chroot jails (Score:1)
ramdisk vs. hard disk (Score:5)
The results of the performance test that I ran were somewhat surprising - it seems the machine with the hard disk actually performed _better_ than the machine with the ramdisk. I'm not a kernel hacker so I don't know exactly why this is the case, but I know that the buffer caching in the kernel really kicks ass (we're running 2.2.10) and I suspect having a ramdisk hampers the kernel's ability to manage the buffer cache (i.e., it takes up space that could be used for buffer cache). Just my $.02...
-VoR
The OS in ROM (Score:4)
Using an EEPROM would allow you to upgrade/patch the OS as necessary. Also, some clever engineering would make it all but immune to viruses (putting the OS in a true ROM would do wonders for virus protection, but make it difficult to upgrade you system software).
Hell, you could put Linux and X-Windows with the Window manager of your choice all on an EEPROM and have a superfast, instant booting machine.
I'm sure this is being done somewhere. Any ideas or links anyone cares to share?
Netscape cache (Score:2)
Re:Ram is usually needed elsewhere and is expensiv (Score:2)
that is serving thousands of httpd requests
from harddisk and your filesystem cache is
flushing itself over and over again, and you
still want netscapes cachefiles to be in a
speedy environment?
Of course, having more RAM than disk is a fine
solution when the OS buffers with your free mem,
but obviously everyone can't have that.
Having a dynamic ramdisk (like
and the aforementioned amiga-ramdisks) is quite
a big win speedwise for many kinds of situations.
As long as you have free mem, tempfilecreation
will go nearly as fast as ram allows, and whenever
it gets full, you get swapspeed, which is more or
less what you would have gotten in the first place
with the cache on local disk anyhow.
Reductio ad absurdum .... (Score:2)
- - - - - - - -
"Never apply a Star Trek solution to a Babylon 5 problem."
I am just waiting for... (Score:4)
Comment removed (Score:4)
Not as fast as you would think (Score:2)
I an effort to speed up some calculations I was doing I directed the I/O to/from a ramdisk, rather than the usual HDD. I figured, RAM is much faster than HDD, so I will remove any I/O blocking time. (This particular application was very I/O intensive. Basically, two programs communicating via files. I.e., program A runs a calculation, program B reads the output, generates new input for A, and so on. Very messy...)
Anyway... I found that there was NO speed up. None. My conclusion, the Linux file system caching whatever (I am a chemist, not a kernel hacker), was extremely good. I imagine that these smallish files were rarely ever actually written and/or read to disk. They were just stored in some cache. Essentially the normal use case and the ramdisk case were basically identical in that all of the I/O was in RAM anyway.
Now, these files were small, and updated frequently, and I have tonnes of RAM (0.5 GB), and what not (2xPIII450, SCSI disk,...) so YMMV... just my experience with ramdisks, for what it is worth.
dynamically resizing ramdisk (Score:2)
__
RAM disks would actually slow it down. (Score:2)
Type in "free" and you'll see that almost all your RAM is in use -- that's because it's got a RAM buffer of most recently accessed files so they can be accessed again faster. In fact, if you create a temporary file and then delete it, often that file will never touch the disk.
This, of course, is why you have to unmount disks - the unmounting writes the buffers to the disk so that the changes won't be lost.
So, it's already done for you, assuming you want a RAMdisk of your most frequently accessed files.
Sometimes, people want a rarely used file to be easily accessed to reduce load times, which is something that buffering won't help with. So, you just flip the sticky bit on the file, and it's done for you.
By making a RAMdisk, you're taking away from the available RAM that the kernel could be using for intelligent buffering, and actually slowing down the machine.
Sysadmin exercise (Score:2)
Heck, at cc.purdue.edu they put quotas on
---
Re:Ram disk on Macs (Score:3)
Mac, Windows, VMS, MVS, Amiga, et.al all do direct and/or syncronous writes to the disks. That's why a RAMdisk has such an effect.
Linux boot floopies use a RAMdisk because they can't put all the needed files onto a 1.44MB floppy without compressing the image. The RAMdisk is simply the "disk" to which the decompression runs its output. If the root filesystem could fit entirely onto a floopy, there'd be no need for a RAMdisk upon install. See Redhat verion 3.x
Re:seems to be pointless (Score:2)
Fun things to do with RAM disks (Score:2)
Maybe someone should do a dist that's optimized to use a 100 megabyte (or so) RAMdisk to speed up the loading of the most used and slowest loading apps. Netscape would probably qualify. All the gnome stuff... star office... The field's wide open.
Of course, that space might be better used as disk buffers...
Network block device (Score:2)
Re:But it's harder than hell (Score:2)
Unix/Linux does this for you automatically (Score:5)
This actually reflects the perfect way of doing this: add optimization, but don't bug the users about it -- it's not their problem.
--
Re:Ram disk on Macs (Score:2)
Re:But eterm is "pretty" (Score:2)
The last few versions of rxvt have "transparency" support. You may have to compile your own version if your distro doesn't compile it with that option...
"Free your mind and your ass will follow"
Re:Fun things to do with RAM disks (Score:2)
The problem with this approach is that on *every* boot you have to pre-stuff the ramdisk with files, regardless of whether you're about to use them or not.
And of course, the memory so allocated is tied up whether or not those programs are in use.
The tip-top way of achieving this effect is some uber-control over the disk caching mechanisms to allow pre-stuffing of the cache with known files at bootup / login.
Now's the time for someone to point me at a FAQ telling me how to do this....
Re:A secret fantasy of mine... (Score:2)
*everything* there! :) (Score:2)
Of course, given that batteries were only good for 1:40, and that some genious diddn't include a capacitor to back up ram while changing . . .
hawk, who still has the pieces of that machine
The "Traditional" Use Of Linux RAM Disks (Score:2)
The same is probably true, today. Simply because few people will be able to test and refine the code on extreme memory machines, RAM Disks will probably still be the way to go.
There is -one- other case for RAM Disks that I can think of. =VERY= Extreme RAM cases. Where the size of RAM is comparable to, or exceeds, the size of the HD(s), it is not efficient to keep swapping to and from drives. They're slow. It's much faster to simply dump the drive(s) to RAM and write-through to disk a you go. All actual read operations, after boot, would be to RAM.
Beyond that, fast IDE's or SCSI's, with decent on-board cache, are all-round a better idea than RAM disks.
Going back to the extreme memory case for a moment, this would be ideal for a laptop. Non-volatile RAM is going to eat batteries far less than a mechanical drive. (Especially on power-up, or where there is extensive disk activity.)
Virtual Memory (Score:2)
--
Re:Resizable Ramdisk + Unix = trouble (Score:2)
Each machine runs a number of message queue daemons. The 'bright spark' developer of these decided to store the queue state infomation in a scratch file in /tmp. They also havn't heard of shared libararies, so each queue process is enormous due to being statically linked against all bar the C library. And there's over a hundred of these processes per machine.
The system will run out of memory once a week or so, and when it does so the queue scratch files can't get updated. When the errant process is killed, all queues are corrupted.
The need a competant sysadmin. Unfortunatly their based in the SE of England where competant staff are thin on the ground, and they seem to employ anyone who knows a few buzzwords.
/tmp is there an easy way? (Score:2)
A machine with 512k that is a personal work station coul dhave 256k for memory, 128 for /tmp and 128 for swap. This could add in that necessary performance increas I need for video.
I don't want a lot, I just want it all!
Flame away, I have a hose!
Re:no benefits (Score:2)
Oh good grief. Of course the CPU usage was higher.
Hint: with a RAMdisk you don't have to wait for the disk.
Re:The OS in ROM (Score:3)
Re:The OS in ROM (Score:3)
So, loading from EEPROM would perhaps get you a faster bootup, but not much more than that.
There is a project I read about somewhere where people are actually putting a modified Linux kernel directly into the Flash to replace the system BIOS. This is neat because they boot in less than a second - so fast they have to explicitly wait for the hard drives to spin up before looking for them!
Other embedded systems use Linux on "Disc On Chip" hardware. Have a look at the September Linux Journal, which has a lot on the use of Linux in embedded applications.
Torrey Hoffman (Azog)
Paging should do this job (Score:2)
The only real place I can imagine where this might help is one where there is a lot of disk writing going on on a particular filesystem, and the system is so busy it never has a chance to flush it's cache without causing incoming requests to wait, such as a way overloaded mail server (I've seen this). Of course, the problem there is that it's not a night and day performance difference anyway when you're talking about modern disks with built in caches and OS's with decent lazy write techniques. And of course the little tiny issue that you're completely compromising your data integrity since if the system dies, everything in that file system goes with it. A far better solution, if you feel you must second guess the OS's caching/paging/vm system, is a controller card with on board cache and a battery backup. This maintains your data integrity, and will give you a little performance boost for busy disks with lots of writing. Of course, you'd still probably see just as much performance improvement by adding memory...
Re:ramdisk vs. hard disk (Score:5)
You're partly right. The other reason is that it forces more pages out to swap, since the RAM disk can't be paged out (I'm pretty sure). Placing your data in a traditional Linux RAM disk has two bad effects:
Even if the Linux ramdisk can be swapped out (I think the new ramfs may be capable of this), it will still likely be slower than a traditional filesystem if you push into swap, because swap gets fragmented over time. In contrast, ext2 resists fragmentation pretty well and so will perform better as a result.
My 0x02 cents...
--Joe--
Re:Solaris already does (Score:2)
This is a sensible strategy, and frankly I wouldn't expect to keep files in
You can limit the size of
The main reasons that we don't use it are DBAs...
We have had one DBA ask us to reduce the size of
Z.
Re:I am just waiting for... (Score:2)
which isn't such a bad idea if you use the slram patch on a computer where not all RAM is cached (e.g., some Pentium boards with more than 64M)
--
Re:The OS in ROM (Score:2)
Ummm... The iOpener [iopener.net]?
It has a 16MB flash disk, and it runs QNX. There have been various hacks reported on Slashdot about installing Linux, as well as attaching IDE drives, etc.
Sure, it boots fast, and for mobile or embedded applications the hardware can be more reliable. But flash is still way more expensive than magnetic storage. Eventually the speed and cost of solid state storage will fall below magnetic and optical, but that won't be for at least a decade.
Look elsewhere... (Score:2)
Sorry, no. You'll have to run Windows 98SE for that pleasure. Linux is unnecessarily stable for such a task.
If you have that much RAM... (Score:2)
All of the data stored on your disk is already proactively cached, most recently used is much more likely to be in cache longer.
Full blown RAM disks have limited applications, especially when the buffer cache can almost always do a better job. If you have gobs of RAM you're not using, increase the size!
Re:Good idea, but... (Score:4)
The stock A500 had 1/2Meg of RAM, so most stuff was designed to run in that memory space. Most word-pros and spreadsheets would run in this, but didn't have much room spare for file data, so more serious users got a 1/2Meg RAM upgrade for this (and even now, you can store a lot of text in a 1/2Meg file). If you had the money for a 2Meg (or more) expansion card, the world was your oyster. You could then run 2 or more heavy-duty programs simultaneously, and use any space left over to cache your frequently-used commands in a RAM-disk. Well cool at the time.
Now back to today. It's no longer strange to run several heavy-duty applications together - at any one time in Windows (sorry, but that's what I use at work), I may have Word, Excel, Access, DevStudio, Outlook, Matlab, Acrobat and IE all running together. At this point, the Amiga would have reached the "heavy heavy heavy, man" stage and died with a Guru Meditation error. We have vast stacks of RAM now, but our expectations have risen too, and so have the program sizes. You could still sit down and code a graphics app in Intel assembler if you really wanted to (as one Amiga developer did to get fastest performance and minimum code size), but I wouldn't recommend it.
Also, the purpose of a RAM-disk has pretty much vanished. When we used floppies, the disk access time was enormous and slowed things down considerably, but modern hard drives are so fast that disk access time isn't as big a deal as it was then. Even then, if you had a HDD (20Megs was state-of-the-art then!) then you didn't really need to use a RAM-disk.
Grab.
Re:The OS in ROM (Score:2)
What I'm curious about is why, once you have a good, stable boot configuration, you can't store an image of memory at the moment the first login screen comes up, and have a boot loader that just loads that image at startup. I realize that this would be undesirable on a lot of systems, but I sure would appreciate this near-instant-on with the ancient IBM Thinkpad I carry around for lightweight tasks -- mostly text editing and my private development projects.
--
What about hardware RAM disks? (Score:2)
I've seen some (don't remember where) that were designed to be used like a normal disk but on the insides they were a bunch of battery-backed RAM. I believe the high-end models even had the ability to automagically sync to a physical disk in the enclosure on power loss/off/shutdown and restore to RAM.
I think the advantage of these solutions over a conventional host-based RAM disk was that by treating the RAM disk as a SCSI device you could make it much faster than conventional host RAM (special controllers, interleaving, etc).
I don't remember the name of the company that was selling this and they don't appear to be around anymore. Maybe the cost of RAM relative to the sizes people needed just made it commercially impractical.
Re:The OS in ROM (Score:2)
What's the point? (Score:2)
Linux installation from floppy uses the RAMdisk to store the installation filesystem. This is not only quicker than running from a floppy, but allows the RAMdisk image to be compressed. Debian and Slackware do this, and I presume other do as well.
When I've used RAMdisks in the past on other systens, it has always been when other media was slow. A common one was under DOS on a floppy only 8086, copying COMMAND.COM and to a small (30K) RAM disk (stored in spare RAM on the non-standard video adaptor IIRC), and setting COMSPEC accordingly. Saved me having to swapp floppies just to load COMMAND.COM on program exit.
The only advantage I can see on a non-embedded Linux is if you have a some data or executable that you need to guarantee is in cache, and pre-load this into RAM disk before-hand. Faking benchmarks springs to mind here.
I Do This On the MacOS (Score:2)
It was even more of a task before I did just what you described and made a RAM Disk and told Netscape to use it. Sped it up by about 3 times.
Re:The OS in ROM (Score:4)
Read only media are a good idea though.
For security, if super fast boot time is not an issue, then you might consider booting from CD-ROM or othe read only medium on some machines. If your home page and apache configuration files are on CD-ROM, then your home page cannot be defaced no matter how clever the cracker. Likewise even if somebody does manage to use a root kit on your box they can't replace one of the regular utilities with a trojan if the directory it's in resides on a CD-ROM.
Anybody know a Linux how-to doing this? I've seen it done with the BSDs.
Re:The OS in ROM (Score:2)
access time of a HD and there is a nice
performance gain (theoretically).
Re:Solaris already does (Score:3)
Another rule of the game is : when memory-pigs applications are running, and swap grows too much, the
Here, we are using an operating system simulator which was designed like a fortran-77 app. That is, at startup, reserve as much memory you think you need (commonly around 100/200M), and then works with it (or die). When a sufficient number of those apps is running (around 5-7), even our 1G-memory entreprise servers began to stumble under the load.
Needless to say, when swap grows up to the point of crushing
Remember the ol'unix
/tmp is the place (filesystem) where any file that won't be needed next reboot should be placed, but _EVERYBODY_ should be able at least to write and read there.
It's funny how you re-discover the importance of this rule by noticing how many mundane tool need
So my
- either your system does not vitally needs
- or
Obviously, this is only needed when you run memory-hungry applications. But obviously indeed us modern designer are very carefull not to use to much memory
Amiga Memories (Score:2)
Yup. I did that too. A500, Workbench 2.1, 20 meg SCSI hard disk.
Even though the 880k of RAM could have been better used for program space, I found that the performance penalty of having the system files on a slow band-stepper hard drive was such that the memory hit was less obtrusive.
And, I had a later-revision A500, into which I'd plopped a Fat Agnes chip. With a little hacking, of course, it was possible to set up the memory expansion on the bottom of the A500 to become an extra 512k of Chip RAM; the 2 megs in my hard disk controller setup was the Fast RAM.
The only reason I bring this up is that, if nothing else, the Amiga is a great source of inside jokes, like "Guru Meditation Errors" and "volatile memory"...Or, if you've been downloading too much off the local high-speed (2400 baud!) Warez BBS, "Your Amiga is alive..."
Ya know, a Mac says, "Sorry, a System Error has occurred"; Windows tells you that "This program has performed an illegal operation" or any number of other nasty things.
But, besides Eudora 3.x ("Eudora is tired of waiting for the system to respond."), can anyone else think of any really nasty or sarcastic error messages like the Guru Meditation Error?
Linux and unused memory (Score:4)
By creating a RAM disk to do this, you would force a much smaller subset into memory, which would be great for what you are using there, but would hinder performance on other things which linux does not have the room to cache now.
So, unless there is something very specific that needs to be cached, there is no rationale for this, and the chances are that linux will cache it for you anyway if its that much of a performance hit.
Last but not least, the biggest reason RAM disks are slightly faster than average (when linux does cache) is because they never have to synch to a physical medium. If you dont care that all the data you have written there is gone *poof* once a crash occurs, or if the system is shutdown, then thats ok. If you have a file there, and 'oops' forgot to write it to disk, its gone.
Re:Network block device (Score:2)
Current state: It currently works. Network block device looks like being pretty stable. I originally thought that it is impossible to swap over TCP. It turned out not to be true - swapping over TCP now works and seems to be deadlock-free, but it requires heavy patches into Linux's network layer.
Looks like it can swap now. Pretty cool stuff.
Re:The OS in ROM (Score:2)
Part of the basic philosophy of the Amiga (Score:2)
If you can run it, it will run well. If an app _has_ to use lots of memory because of it's fundimental nature (such as image processing) it will intelegently do the swapping itself.
Because memory was not considered vitually unlimited people developed with an eye towards keeping memory requirements down.
The requirements of programs for OS's with swap files have rocketed over the last few years.
It's sad to see the Amiga style of operation disappear without any debate as to the merits of it. People made swap files because they could, not because they were essential.
Bill Gates reputedly once said '640k should be enough for anybody'. In my own mind I think that 64 meg should be enough for most people, yet I routinely do tasks on 64meg machines that are swapping merrily away. It's not because I'm not considering the possibilities of things that could be done (Like Bill did) but rather that I feel that those things could be done in 64Meg. I fell like my memory is going to waste.
I have ICQ running at te moment. It's using 6 meg, I haven't a clue what it actually puts in that 6 meg. If memory were not considered unlimited how much would it be using?
Re:Sysadmin exercise (Score:2)
Re:The OS in ROM (Score:2)
Re:The OS in ROM (Score:2)
My ProGen laptop did this. If you hit a certain key combination at any time, the BIOS would come to the forefront and copy the entire RAM contents to a 70-something Meg partition at the end of the drive. This did take awhile, though... waking the system up was a small bit faster than booting, but shutting down the system took a LOT longer.
All of that worked fine for windows, but last I tried it, Linux would begin acting very strangely shortly after waking up. I keep my laptop on all the time (it's only portable when I need it to be.
Re:Ah but we are talking about linux here (Score:2)
1. Works fine for me - under Linux.
2. Why are you using Windows?
3. Linux supports theoretically infinite ethernet devices.
4. Natalie Portman!
5. FUCK YOU AND YOUR WINDOWS BOX, YOU WHORE
Re:ramdisk vs. hard disk (Score:4)
This is exactly what I would suspect - I'm glad you posted this because I don't have time today to test it myself, but this is the result I would bet on.
The reason ramdisks aren't very useful with Linux is that the kernel has very good buffer/caching code - the effect is the same as having a ramdisk, except that the kernel can dynamically determine the contents based on actual usage. If you stick commonly used data on the ramdisk, you should be able to beat any caching algorithm, in theory, but this requires that there is certain data that you know will always be the most frequently accessed. In the real world, this rarely works out.
Say you put 16 megs of what you think is the most commonly used data on a ramdisk. Say further that you are right - over time, that 16 megs of data is the most frequently accessed data in your system, by far. If your box is hitting that data constantly, every bit of it, every few cycles, you might get a small performance boost. But more than likely some parts of it will not be hit all that frequently, and there are also likely to be times when it's not being hit at all. Put the same data on hard disk and let the kernel have the ram to manage, and it will manage things on the fly, responding to the actual demands of the system... it's very hard to beat.
Now, if the caching algorithm was more primitive, something like smartdrv for instance, then you can get a big performance boost out of the ramdisks. I used to play that game quite frequently. But this only worked because smartdrv really isn't very smart.
A Good Use for RAM Disks... (Score:3)
Ramdisks (Score:2)
The reason ramdisks were so useful on your old Amiga was the absence of a good disk caching program. Linux has excellent dynamic disk caching, you're better off letting the kernel have that memory to play with instead of locking it into a ramdisk.
Re:ramdisk vs. hard disk (Score:4)
There's one time ramdisks are good... If you have a small set of files (relative to your total ram) that you don't use very often, but when you do, you want them to load with as little delay as possible...
Not really something you'll run into with a webserver where a 10ms lag in HD access will be hidden under at least 50ms of network lag and probably 250ms of rendering lag.
But, if you run a machine who is doing realtime data sampling and you need to run various transforms on the data, you might want to keep some of the essential tools in ram. (Just a contrived example...)
The best way to do this though would be to ask the caching subsystem to keep some, higher priority (specified by you, and by overall usage patterns) in ram even when they might have been dumped, because they're either timing critical, or likely to be used a lot in the future. (The way an ASM programmer could hint to the CPU which branch will be taken by making a seldom taken loop fall-through when skipped and a often-taken loop fall-into when taken.)
Large files not a problem (Score:2)
Most admins bitching about the large files problem aren't aware of this option. (I wasn't for a while.)
Re:Unix/Linux does this for you automatically (Score:2)
--
Re: (Score:2)
Re:The OS in ROM (Score:2)
I can't find the damn manuals, though...could you point me to somewhere on the net where they can be found?
"If ignorance is bliss, may I never be happy.
Re:But eterm is "pretty" (Score:2)
Re:The OS in ROM (Score:2)
The HD-less network workstation (Internet and Citrix) that Larry Ellison (sp?) is pushing uses a CD-ROM to hold its Linux OS. Presumably the boot-up takes some time, but a good cache algorithm will handle things from there.
Do we need to push boot times? How often do you need to boot Linux?
Re:Unix/Linux does this for you automatically (Score:2)
Re:ramdisk vs. hard disk (Score:3)
That's what I wanted when I was playing Civ:CTP last year. I made a 300M swap file and copied parts of the graphics directory structure to the ramdisk, then pointed at it with symlinks.
This greatly improved game play. Of course, it was at the expense of slower access to other files, and caused the system to swap out some programs, but I didn't care, because I was planning to play the game for a while and didn't need the other programs in memory.
Of course, I turned the ramdisk off while I wasn't playing, and had to pay the start up cost of loading the ramdisk each time I turned it back on.
I don't see how a ramdisk would be a useful thing for a web server unless you could be sure you didn't cause anything you care about to be swapped out. That would require adding more memory, but adding more memory would give you more buffer cache, which would have the same (argueable better) effect as the ram disk in the first place.
It's a specialized tool, useful in some specific cases. A web server doesn't seem to be such a case.
Re:Unix/Linux does this for you automatically (Score:2)
True, to a point. Linux will use available ram as a disk cache. It won't choose to swap programs out in order to provide more space for the disk cache, even if you have programs you haven't used in a long time, and a little more disk cache would mean you could get everything you are using into the disk cache, instead of rotating a bunch of stuff through the cache.
This is because Linux gives higher priority to programs (even seldom used programs) than disk blocks (even frequently used disk blocks).
Using a RAM disk can give you a way around that by letting you dictate that the disk cache is more important than keeping other programs in memory, and allowing you to specify which programs should be cached.
This isn't a really common problem, which explains the fact that RAM disks aren't used all that often.
Disk caching is not unique (Score:3)
Actually, disk caching is NOT a unique idea at all.
Macs have supported a disk cache for performance since at least System 3.0, in 1986. You can see a history of the old Mac OS here. However, I'm not sure if this is a read cache only and what form of cache writing scheme it supports if any nowdays.
While I can't really say about the DOS-based Windows variants, the NT versions of the Win32 API has lots of support for asynchronous file I/O [foliage.com]. By default, all normal disk writes are written to a disk cache which is lazily flushed. You can specify certain options when opening a file handle with Cre ateFile() [leb.net] to force it to write straight through to disk rather than lazily cache it. In fact NT gets its asynchronous packet-based I/O subsystem design from VMS. (The designers of the NT kernel were ex-VMS designers. [win2000mag.com])
Finally, while I can't speak about the Amiga, I can speak about MVS's descendant OS, OS/390, which can handle asynchronous file I/O. I can't find you a good link, but most of the references I could find on this talk about OS/390's UNIX services. Apparently around release 2 of OS/390, they began to comply to the XOpen definition of a UNIX, so I guess that doesn't help that much.
Re:how about /dev (Score:2)
The purpose of this is to let the hard drive in a laptop spin down. It is one of several suggestions in an old Linux laptop power reduction list...which I can't find at the moment.
Re:BASIC interpreter in ROM! (Score:2)
I want my PIII to boot like a C64!!
Database Updates in RAM (Score:2)
Obviously this will be vulnerable to failure, but for something that collects massive quantities of statistics, such as Ifile, [mit.edu] it can be worthwhile.
With Ifile, an early edition stored stats in DBM files, and would do simply massive numbers of increments to entries. On disk, this meant that for a relatively small mail spool, the analysis would take hours.
Re:But eterm is "pretty" (Score:2)
Well, yes but all the fvwm code is long gone...
"Free your mind and your ass will follow"
Re:The OS in ROM (Score:2)
sig you!!
Re:Hacking a CD-ROM based web site (Score:2)
Of course the corollary to that is if you could create a ramdisk then you can write to it. So if you leave out ramdisks and all network filesystems - you'd be set. Just log everything remotely via syslog (or something better/custom) and you'd be pretty much defacement proof... won't stop 'em from bringing down the server - and because you're running on ROM you won't be able to fix the problem very quickly so they could just keep performing the same exploit over and over... haha!
Re:that's what cache is for (Score:2)
Why not LVM for /tmp? (Score:2)
But perhaps the real issue is filesystem-specific caching parameters - if you could configure the
Re:The OS in ROM (Score:2)
Re:Solaris already does (Score:2)
For reference, this is a SPARCstation 5/170 running Solaris 7 and the memory is pretty much full, so /tmp is probably using the disk swap by now.
--
Re:Resizable Ramdisk + Unix = trouble (Score:2)
The problem here is that there is no-one in overall control of the network of at least 7 high-end Solaris machines. Security is a joke - everyone logs in to the same machine as the same user, then rlogins to the rest of the network. They often run out of PTYs (due to constant use of login between machines without logging out) and have no idea who is consuming them, this results in either bling panic or a system reboot. They also have a nasty habit of rebooting whenever performance suffers, instead of performing preventative measures. They once rebooted one of these machines due to performance problems - all that had happene was someone had accidentally started a couple of huge web server daemons on this machine, and then not terminated it. And so on.....
When I here how much money some of these people are on, I get really angry.
Re:Solaris already does (Score:2)
Another rule of the game is : when memory-pigs applications are running, and swap grows too much, the /tmp shrinks accordingly.
I've been bitten by this (twice!) the other way round: When someone decides to do a 600-meg download into /tmp (because his quota is 20M), the virtual memory shrinks accordingly. After a while all you get at the prompt is this:
$ls
zsh: fork failed: Not enough memory
This symptom is usually followed by an email to the sysop, and a few minutes later everything is back to normal (except for the user who lost a few hundred megs of downloaded stuff :-).
Nothing is hack proof (Score:2)
Re:But eterm is "pretty" (Score:2)
I agree. fvwm2 is my wm of choice. I was just stating a fact.
BTW I AM Ed Gein, muahahaha.
"Free your mind and your ass will follow"
Re:One problem... (Score:2)
Doug
Re:Amiga Memories (Score:2)
Yeah. The strain of the virus that I caught didn't do anything overtly destructive. It just replicated.
Not that bad floppies were uncommon on the Amiga...How could you tell that you had a virus?
Re:Amiga Memories (Score:2)
Urk. I think that was something that I'd very carefully closed away into a little, isolated part of my mind, sealed up, and walked away from, hoping that it would never corrode its way out through the barriers that I had built...
And now look at what you've done.