You are not logged in.
What jiggery pokery have you done to your Arch system to make it faster? I've just devised and implemented a cunning plan to make pacman/abs faster by using a ramdisk.
/etc/fstab:
#
# /etc/fstab: static file system information
#
none /dev/pts devpts defaults 0 0
none /dev/shm tmpfs defaults 0 0
#/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0
#/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0
#/dev/fd0 /mnt/fd0 vfat user,noauto 0 0
/dev/sda1 /mnt/media jfs defaults 0 0
/dev/sdb1 /boot ext2 defaults 0 1
/dev/sdb2 swap swap defaults 0 0
/dev/sdb3 / ext3 defaults 0 1
/dev/sdb4 /home ext3 defaults 0 1
ramfs /mnt/ramdisk ramfs defaults 0 0/etc/rc.local:
#!/bin/dash
#
# /etc/rc.local: Local multi-user startup script.
#
echo 0 > /proc/sys/vm/swappiness
echo 1 > /proc/sys/kernel/sysrq
# Ramdisk Magic!
touch /etc/ramdisk.sh
echo "#!/bin/dash" >> /etc/ramdisk.sh
echo "mkdir /mnt/ramdisk/var/" >> /etc/ramdisk.sh
echo "mkdir /mnt/ramdisk/var/cache/" >> /etc/ramdisk.sh
echo "mkdir /mnt/ramdisk/var/lib/" >> /etc/ramdisk.sh
echo "mv /var/abs /mnt/ramdisk/var" >> /etc/ramdisk.sh
echo "mv /var/cache/pacman /mnt/ramdisk/var/cache" >> /etc/ramdisk.sh
echo "mv /var/lib/pacman /mnt/ramdisk/var/lib" >> /etc/ramdisk.sh
echo "ln -s /mnt/ramdisk/var/abs /var/abs" >> /etc/ramdisk.sh
echo "ln -s /mnt/ramdisk/var/cache/pacman /var/cache/pacman" >> /etc/ramdisk.sh
echo "ln -s /mnt/ramdisk/var/lib/pacman /var/lib/pacman" >> /etc/ramdisk.sh
echo "rm /etc/ramdisk.sh" >> /etc/ramdisk.sh
chmod +x /etc/ramdisk.sh
/etc/ramdisk.sh &/etc/rc.local.shutdown:
#!/bin/dash
#
# /etc/rc.local.shutdown: Local shutdown script.
#
# Ramdisk Magic!
echo "Saving contents of ramdisk to harddrive"
rm /var/abs
rm /var/cache/pacman
rm /var/lib/pacman
mv /mnt/ramdisk/var/abs /var
mv /mnt/ramdisk/var/cache/pacman /var/cache
mv /mnt/ramdisk/var/lib/pacman /var/libThe only downsides are that shutdown takes a bit longer, which doesn't bother me as long as it doesn't take ages, and abs/pacman aren't available straight after booting as there is a slight delay, however as I don't sync abs or update pacman immediately that's not a problem. has anyone else done something interesting with ramdisks? I have 2GB of RAM and am rarely using over 512MB or so, so I have plenty of room to experiment in.
Last edited by Barrucadu (2008-06-29 13:15:11)
Offline
My fstab:
none /dev/pts devpts defaults 0 0
none /dev/shm tmpfs defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
/dev/sda1 / ext3 defaults,noatime 0 1
/dev/sda3 /var ext3 defaults,noatime 0 1
/dev/sda4 /home ext3 defaults,noatime 0 1
/dev/sda2 swap swap defaults 0 0The third line makes the system use RAM for storing temp files. What with a gigabyte of swap space, this is not a problem.
Offline
I just checked my disk usage on /tmp, and it's not that much. I think I'll stick than on my ramdisk too ![]()
However, free doesn't seem to report the RAM taken up by these files I'm sticking in it. It possibly is, but it's such a small fraction I'm not noticing. Oh well, I can always manually check the size of /mnt/ramdisk if unsure.
Last edited by Barrucadu (2008-06-29 13:35:19)
Offline
You guys get a giant thumbs up from me! Once I get a little more RAM I'll try this out.
Offline
What jiggery pokery have you done to your Arch system to make it faster? I've just devised and implemented a cunning plan to make pacman/abs faster by using a ramdisk ... [lots of text]
Seems nice, however you can change:
echo 0 > /proc/sys/vm/swappiness
echo 1 > /proc/sys/kernel/sysrq
To:
kernel.sysrq = 1
vm.swappiness=0
In /etc/sysctl.conf so it's permanent. At least I think they are equivalent to what you are doing.
We met up with the aliens and guess what? They have no word for fluffy!
Offline
What does kernel.sysrq = 1 do?
arch(3) adj amused because you think you understand something better than other people ;P
Offline
Oooh. Sweet stuff, I gotta do this with my most used programs, pacman, tmp...I got 2 gigs to play in, and hardly ever exceed 300 megabytes when I'm doing quite a bit of stuff. Muchas gracias for the info, Barracadu. You should add it to the wiki.
Stop looking at my signature. It betrays your nature.
Offline
Muchas gracias for the info, Barracadu. You should add it to the wiki.
I didn't know I was that helpful ![]()
Added: http://wiki.archlinux.org/index.php/Ramdisk
Offline
What does kernel.sysrq = 1 do?
Enables the magic sysrq button (usuallly on your print screen button). Check wiki for info:
http://en.wikipedia.org/wiki/Magic_SysRq_key
If your computer locks up you can do a safe reboot.
We met up with the aliens and guess what? They have no word for fluffy!
Offline
If your computer doesn't shutdown properly due to power outage or the like, will you lose your pacman cache? Or am i missing somthing?
I'm very interested in finding some use for the 75% of my ram that never gets touched. What else is useful to copy to a ramdisk?
Last edited by czar (2008-06-29 18:12:23)
Offline
Yes, which is why backing up is important. I added three lines to backup /var/abs, /var/lib/pacman, and /var/cache/pacman before moving them to RAM.
Offline
Why do you move it and not copy it? Isn't the disk usage the same since it's different partitions?
And at shutdown you could check for duplicates, maybe if it's one archive or loopback device.
e.g.
tar cf /var/abs.tar /var/abs
rm -R /var/abs
in rc.local:
cp /var/abs.tar /mnt/ramdisk/
tar xf /mnt/ramdisk/abs.tar
ln -s /mnt/ramdisk/abs /var/abs
in rc.shutdown:
tar cf /mnt/ramdisk/newabs.tar /mnt/ramdisk/abs
md5sum /mnt/ramdisk/newabs.tar
md5sum /mnt/ramdisk/abs.tar
(insert auto compare script... probably, just du might be enough, not md5sum)
if different; then cp /mnt/ramdisk/newabs.tar /var/abs.tar; fi
Last edited by Procyon (2008-06-29 19:05:58)
Offline
Just out of curiosity, why do you have the whole thing in rc.local, then echo it into ramdisk.sh? Wouldn't it just be easier to maintain it seperately, rather than creating/deleting it at every boot?
Stop looking at my signature. It betrays your nature.
Offline
I like my system being neat - rc.local is for things happening after boot, so I want to only have to look in there to edit things relating to that.
Offline
Ok, just making sure that it was not something that was going over my head somehow. I prefer to have clean config files, with each complex task residing in it's own space, but to each his own. I gotta try this out.
Stop looking at my signature. It betrays your nature.
Offline
i edited my fstab but i don't seem to get a ramfs on reboot. Where am i going wrong?
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
none /dev/pts devpts defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0
/dev/cdrom1 /mnt/cdrom1 iso9660 ro,user,noauto,unhide 0 0
/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0
/dev/dvd1 /mnt/dvd1 udf ro,user,noauto,unhide 0 0
/dev/sda2 /boot vfat defaults 0 1
/dev/sda3 / ext3 defaults 0 1
/dev/sda4 swap swap defaults 0 0
/dev/sda1 /mnt/windows ntfs-3g defaults,locale=en_PH.utf8 0 0
ramfs /mnt/ramdisk ramfs defaults 0 0Offline
Did you make the folder /mnt/ramdisk? If you did, and if you can write to it, it worked.
Offline
Perhaps instead of using rm and mv for the backups, just use rsync. It should be faster for this.
[git] | [AURpkgs] | [arch-games]
Offline
Hi, I tried to set ramfs type for /tmp
If I save my fstab with something like :
none /tmp ramfs defaults 0 0my files-manager (pcmanfm) doesn't load.
There is no error output when launched from urxvt, but the window isn't display, and there's no process running.
I also have HAL started on boot to auto-mount disks.
Do you think pcmanfm fail because is trying to browse /tmp ?
I can reproduce it, tell me if you need extra information.
Offline
You need to chmod /tmp to 777, otherwise graphical programs probably won't work.
Offline
Offline
I like my system being neat - rc.local is for things happening after boot, so I want to only have to look in there to edit things relating to that.
It would be a lot more readable to use 'heredoc's though:
cat <<EOF > /etc/whereever.sh
<code for the script>
EOFNice work though, thanks for that.
Last edited by Asgaroth (2008-07-04 16:41:42)
Offline
May be a stupid question....
Whats the advantage of using ramfs with pacman? for me the only thing that takes some time is downloading file (75kbps connection :-( and they sell it as broadband here) ....after that its pretty quick ....
Offline
Searching for packages is much faster off of ramfs. Just about instant.
Offline
Searching for packages is much faster off of ramfs. Just about instant.
Depending on your harddisk that's pretty fast anyway, so no real speed benefit for me.
With reiserfs and luks hdd-encryption(and pacman-cage, the "device-file" is formatted with ext2):
$> time pacman -Ss pacman
...
pacman -Ss pacman 0,21s user 0,16s system 97% cpu 0,375 totalLast edited by Asgaroth (2008-07-06 22:22:07)
Offline