Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have read that there is no need for a SWAP partition on a computer with 1 GB RAM? Is this correct? What is the advantages/disadvantages with having such a partition? And how large should it be, if any?
Hardware: 1.83 GHz Intel Core 2 Duo (64-bits), 100 GB hard drive space, and 1 GB RAM.
Yes and no. Yes, you could get by with out swap. You will not last long with out swap. You can make 256 MB of swap and if you need more look up fly swapping.
SWAP is not (at least much) used as long as there is free RAM available; the moment RAM starts to get filled, SWAP is used. SWAP can be used, though, even if your RAM isn't full. But anyway if you ever do any tasks with your pc that consume memory resources, you probably want SWAP; it's a place on the harddisk where the kernel can -- without any actual defined filesystem -- store files temporarily, and that may (or may not, it depends) boost up the speed of your tasks.
With a 100GB harddrive you won't even notice having a SWAP partition as big as 1GB, and since it doesn't hurt you, I'd say it's good to have it there -- in case you find it useful one day. Another option would be to use a SWAP file instead of a partition, but I'd still pick up the partition way; 1G swap space should be big enough for you, and it's still only one percent of your whole HD space.
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251
Rep:
SWAP partition - is always a good thing to have
I would always have a SWAP partition, no questions asked! Like previous post, if you run out of ram then the system can use the SWAP file. If you are not hard up for space like having a 100GB HD then make a 1GB swap. The general rule has always been to double ram in the system. So if you have 1 GB I would make the system have a 2GB SWAP partition. Now this rule was probably meant more for the older systems and hardware but it would probably still be a very good idea to include in systems today!
There *is* no fixed rule as to whether you will or will not
need swap (to begin with or at some stage later in your linux
life). I've seen machines w/ 256MB never swap, and I've seen
machines w/ 2GB using lots of swap space. The only thing that's
always valid is that once your swap fills twice the amount of
your RAM you should go and buy more RAM :}
My current notebook has 1GB RAM and I have a 1GB swap-partition
(of which it currently only uses 0 MB).
My server has 256MB RAM and 756MB swap (of which it currently
only uses 90MB).
If I were to edit a video on my notebook things would change
dramatically, and so they would if I ran a complex query against
my PostgreSQL database on the server.
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251
Rep:
Sure you should probably buy more ram, but what is the point if you have a 100GB HD and can spare 2GB? It is not like this guy is running a huge database, unless I read something wrong and he has a Database that would require like 8GB of ram and two dual core processors.... just makes sense to double the swap size, especially if you have the space.... I think anyone who has worked with a Linux system professionally doubles there SWAP size.
YOU SHOULD DOUBLE YOUR SWAP SIZE, especially if you have a large database. At work we have a server that has 8GB of ram and we did double the SWAP size, mind we also have 1500 GB of space to work with. We have a large Database that requires POWER and MEMORY.
Sure you should probably buy more ram, but what is the point if you have a 100GB HD and can spare 2GB? It is not like this guy is running a huge database, unless I read something wrong and he has a Database that would require like 8GB of ram and two dual core processors.... just makes sense to double the swap size, especially if you have the space.... I think anyone who has worked with a Linux system professionally doubles there SWAP size.
If that's a response to my post you either didn't
read it or didn't understand what I am saying.
I never suggested that he use any given size. I
said if his SWAP exceeds double his RAM he should
get more RAM. And I'll stick with that: if you
use more that double your RAM for SWAP the
performance deteriorates DRASTICALLY.
Quote:
YOU SHOULD DOUBLE YOUR SWAP SIZE, especially if you have a large database. At work we have a server that has 8GB of ram and we did double the SWAP size, mind we also have 1500 GB of space to work with. We have a large Database that requires POWER and MEMORY.
And I'll bet it hardly uses half of that. If it
did your DBAs would be jumping up and down because
of the POOR PERFROMANCE.
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251
Rep:
No, may bad, I did not interpret your post the right way... sorry TINK. I couldn't agree more, never do more than double you swap size and 9 times out of 10 you won't use it but there has to be a reason why all linux people suggest it.
As for our work DB your right, it doesn't use the SWAP space or hardly at all. It never usually uses more than a few hundred MB's. I find that the SWAP is good for large HOT/COLD DB backups, thats when the SWAP is used most.
After 14 hours of use and counting, only 168 KB of swap is being used while folding@home and other programs are running. When I play a game like UT2004, swap gets used up to 8 MB even with out folding@home running.
The kernel comes with default parameters so use sysctl to adjust them to suit your setup. I have vm.swappiness set to 30 on my computer with 1 GB of RAM.
Is 1GB enough RAM to do without swap? Maybe, depending on what you do with your system. However, swap helps performance, among other things, so it's generally a good idea to have some, regardless of how much RAM you have.
If you don't want to commit an entire partition to swap, you can always use swap files. That would allow you to play with different sizes and see what works best for you.
I've got 1Gb RAM on this laptop, and 2Gb swap. As far as I know, "swap" has never been used, but I saw no harm in allocating a couple Gb from my 80Gb drive. "Just in case."
Swap is always good. The rule of thumb is twice your RAM, but you don't HAVE to do this. With 1GB of RAM, I think 1GB or even 512MB swap is good. You don't HAVE to...but I suggest it.
I read a bit of that thread on swapping. It got old after awhile, and I think the bit that I read must have been out of date as compared to current kernels. I don't buy the full memory theory. Things have simply changed. http://gentoo-wiki.com/FAQ_Linux_Mem...2.6_kernels.29
If you simply MUST have a swap space, then spend another $100 on a 1GB stick, and put your swap space on a RAMdisk. If that doesn't make sense to you, then you understand why the need to have a swapspace on disk makes no sense to me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.