LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-13-2015, 09:58 PM   #1
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,067

Rep: Reputation: 147Reputation: 147
Question using loads of ram--loading Slackware and maybe other stuff into RAM


My PC has 64 GB RAM because for 10+ years I have used a PC for distributed computing, like BOINC, GIMPs, and I have other projects I thought potentially could have used a lot (even opening large art files, or maybe one day, programming).

Someone on FreeNode IRC ##slackware suggested with the amount of RAM I have, I should load Slackware (and maybe other stuff) into RAM. How would I go about doing this?

Last edited by dchmelik; 07-13-2015 at 10:01 PM.
 
Old 07-14-2015, 02:33 AM   #2
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,221

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
One part of the filesystem you can safely mount in RAM is /tmp, by changing it in /etc/fstab
Code:
tmpfs            /tmp             tmpfs       defaults,nodev,nosuid         0   0
I think by default it allows for half of your RAM (but doesn't allocate it until something is actually put into /tmp). Some people talk about mounting /var into RAM as well, but this doesn't seem like a good idea since /var is expected to persist across reboots.
 
1 members found this post helpful.
Old 07-14-2015, 05:27 AM   #3
e5150
Member
 
Registered: Oct 2005
Location: Sweden
Distribution: Slackware and Alpine
Posts: 132

Rep: Reputation: 100Reputation: 100
Have a look at http://www.linuxquestions.org/questi...2/#post4482138 although it's almost been four years, I reckon it should still work roughly the same.
 
1 members found this post helpful.
Old 07-14-2015, 06:25 AM   #4
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
Quote:
Originally Posted by dchmelik View Post
My PC has 64 GB RAM because for 10+ years I have used a PC for distributed computing, like BOINC, GIMPs, and I have other projects I thought potentially could have used a lot (even opening large art files, or maybe one day, programming).

Someone on FreeNode IRC ##slackware suggested with the amount of RAM I have, I should load Slackware (and maybe other stuff) into RAM. How would I go about doing this?
makes not that much sense, you need to read the distro and load it into ram,
there can you start the program directly also, might be faster

the view milliseconds you gain when starting binaries, ...
dlls are in the ram
hd has super fast chace
ssd is fast ..

and if you have persistent data you need to sync it anyway

no, makes onlly senes if you load from a slow medium like sdcars ...have spezial requirements...
 
Old 07-14-2015, 08:53 AM   #5
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,221

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
I don't think it's a good idea to load the entire system into RAM if it's solely for a performance boost (check this post from TobiSGD). As he says, it makes more sense to run the system from a decent SSD and do disk intensive stuff in /tmp (mounted in RAM). If it's just for fun or to set up some kind of non-persistent system then I guess so.
 
1 members found this post helpful.
Old 07-14-2015, 09:01 AM   #6
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
Quote:
Originally Posted by drgibbon View Post
One part of the filesystem you can safely mount in RAM is /tmp, by changing it in /etc/fstab
Code:
tmpfs            /tmp             tmpfs       defaults,nodev,nosuid         0   0
I think by default it allows for half of your RAM (but doesn't allocate it until something is actually put into /tmp). Some people talk about mounting /var into RAM as well, but this doesn't seem like a good idea since /var is expected to persist across reboots.
You can specify how much space tmpfs will use also, some programs like icecat will need to be compiled elsewhere for being fat though.

Code:
tmpfs		 /tmp		  tmpfs	      size=4G,nodev,nosuid	       0   0
 
Old 07-14-2015, 11:02 AM   #7
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 528

Rep: Reputation: 272Reputation: 272Reputation: 272
Well, I experimented with zram a while ago...
I had a read-only "gold image" (in RAM) that was used in 6 or 7 VMs (windows server 2003)
They had a read-write snapshot where changes were recorded (on a HDD).
Needless to say that they went a lot faster

Unfortunately, zram is no longer present in Slackware64-14.1
 
Old 07-14-2015, 03:40 PM   #8
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
I would actually suggest not rebooting as a method and just suspending when you're done with the computer.
Linux already uses all that ram since every program, every file is automatically loaded into ram after you open it initially.

Run this command to see information about your ram:
Code:
free -m

Here's my output

Code:
             total       used       free     shared    buffers     cached
Mem:         15720      13737       1983       3283        569      10304
-/+ buffers/cache:       2863      12857
Swap:            0          0          0
out of 16gb, 12.8gb of it is being used for buffer.

See here for more info http://www.linuxatemyram.com/

So while you can setup something that loads everything into ram at bootup, the kernel is already doing a lot of this automatically. If you work with a diverse amount of stuff and not rebooting (resetting the ram usage), you've probably already been making use of a lot of your total capacity.

This secondary page to linuxatemyram makes the point pretty well.

Code:
$ time python hello.py
Hello World! Love, Python

real	0m1.026s
user	0m0.020s
sys	0m0.020s

$ time java Hello
Hello World! Regards, Java

real	0m2.174s
user	0m0.100s
sys	0m0.056s

$ 

Wow. 1 second for Python, and 2 seconds for Java? That's a lot just to say hello. However, now all the file required to run them will be in the disk cache so they can be fetched straight from memory. Let's try again:

$ time python hello.py
Hello World! Love, Python

real    0m0.022s
user    0m0.016s
sys     0m0.008s

$ time java Hello
Hello World! Regards, Java

real    0m0.139s
user    0m0.060s
sys     0m0.028s

$ 

Yay! Python now runs in just 22 milliseconds, while java uses 139ms. That's 45 and 15 times faster! All your apps get this boost automatically!

Last edited by Sefyir; 07-14-2015 at 03:53 PM.
 
1 members found this post helpful.
Old 07-14-2015, 05:17 PM   #9
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,067

Original Poster
Rep: Reputation: 147Reputation: 147
I do not normally shut off, reboot, or suspend my computer, and will not start doing the last since I never seem to be able to come out of it. Ok, maybe I will not load Slackware to RAM, since I already have a SSD. The '/tmp' directory is something I wanted to not load to RAM, because if I build packages with SBo, forget, reboot, then they will all be gone.
 
Old 07-15-2015, 07:04 AM   #10
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,221

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
Quote:
Originally Posted by dchmelik View Post
The '/tmp' directory is something I wanted to not load to RAM, because if I build packages with SBo, forget, reboot, then they will all be gone.
You can have sbopkg build your source code in /tmp with the resulting packages stored elsewhere. For that you want to edit /etc/sbopkg/sbopkg.conf and change
Code:
export OUTPUT=${OUTPUT:-/tmp}
to somewhere outside of /tmp
 
1 members found this post helpful.
Old 07-15-2015, 08:38 AM   #11
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Have a look at this thread for more information.

https://www.linuxquestions.org/quest...sk-4175527521/
 
1 members found this post helpful.
  


Reply



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
Why size of swap space is 2x of RAM??? Why not 1.5x of RAM or 2.5x of RAM??? Saurav Ghosh Linux - Newbie 7 11-01-2011 03:49 AM
Does LD_LIBRARY_PATH variable loads all shared libraries in the directory to ram babu198649 Linux - Newbie 5 06-27-2008 08:24 AM
Hacking an Ubuntu CD so that it loads to RAM win32sux Ubuntu 2 04-29-2008 10:17 PM
Distro LiveCD that loads entirely to ram. Spiff1333 Linux - Distributions 9 01-19-2006 10:32 PM
linux that loads into the ram qennster Linux - Distributions 9 09-06-2002 03:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:45 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration