Re: Perl and a Ramdisk



On Nov 30, 1:12 pm, smallpond <smallp...@xxxxxxxx> wrote:
On Nov 30, 12:46 pm, Bill H <b...@xxxxxxxxx> wrote:

I am working on a chat program and am thinking of using a ramdisk to
hold the chat data. Is there anything special I should know about
accessing ramdisk from perl or is it just another disk to perl? On my
development machine I don't have a ramdisk, so I will be using the HD
for storing while debuging, but on the machine it will run on there is
one, and it would be nice if I could just have a variable holding the
destination and only have to change that instead of changing any
routines that did any file i/o.

Bill H

"Premature optimization is the root of all evil."
-- C. A. R. Hoare

Your plan is good right up to the part where you actually
switch over to using the ramdisk. Every modern OS already
has excellent code to do secure and reliable caching of disk
data. I would see if the disk access is actually a problem
before changing, which should be just the filename that you
open or a symbolic link.

If you do create a ramdisk, you will need to create a
filesystem in it, unless you plan on using the raw disk.
You will also have to preload it and worry about saving
it on shutdown if it will contain any permanent data.
--S

I am not concerned about loosing the data with shutdown, since it is
chat the data is transient, only need what someone types for a few
seconds to echo it to the other chatters. I am more concerned with
speed and less disk accesses. I figure it will be a whole lot faster
open a file, reading, writing, closing files in a ramdisk than in on a
HD.

Bill H
.



Relevant Pages

  • Re: Perl and a Ramdisk
    ... accessing ramdisk from perl or is it just another disk to perl? ... development machine I don't have a ramdisk, so I will be using the HD ... Your plan is good right up to the part where you actually ...
    (comp.lang.perl.misc)
  • Re: RAMDisk and harddisk - Revisited
    ... but your constatation that driver load fails is not accurate in some amount based on info you gave us. ... Only if it is a cloned disk they can have same diskid, but this would be completely different error. ... the ATA Flash Disk was detectable and mountable from RAMDisk image as described. ... e.g. IDE ATA Flash or IDE hard drives. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Oops!
    ... Yes minimizing disk ... SSD with about 1.4 gigs free, at 9 blocks written per second (assuming ... Instead run it on a ramdisk. ... sudo chmod 777 rd/work ...
    (rec.games.corewar)
  • very large ramdisk setup problems
    ... I'm trying to set up a very large RAM disk -- 2 GB, ... We are looking at RAMDisk as a way to avoid having those temporary ... tmpfs -- seems to work, ... If I build a ramdisk in ext2 or some other regular file system will ...
    (comp.os.linux.misc)
  • Re: best distro to install on CF card?
    ... all the components I need and the plan is to install a Linux system onto ... the actual Linux files, not a ramdisk image that's loaded ... I would start off making everything in sight readonly except /tmp and /var/log using a disk, and gradually reconfiguring it and removing unwanted stuff till you get no errors...then transfer the moveable bits to ramdisk and the static bits to flash. ...
    (comp.os.linux.setup)