LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 12-30-2014, 03:46 PM   #1
!! hack-back !!
Member
 
Registered: Nov 2009
Posts: 183

Rep: Reputation: 2
modify swap space


hello,
after finish installing debian server
i found that there is 8GB swap space and now i want to increase them for 30GB
the default i found is
Code:
swapon -s
Filename                                Type            Size    Used    Priority
/dev/sdf5                               partition       9526268 0       -1

Code:
df -h
Filesystem                                              Size  Used Avail Use% Mounted on
rootfs                                                  212G  1.6G  199G   1% /
udev                                                     10M     0   10M   0% /dev
tmpfs                                                   3.2G  256K  3.2G   1% /run
/dev/disk/by-uuid/bfae05ad-9281-447b-9640-89c8f9047536  212G  1.6G  199G   1% /
tmpfs                                                   5.0M     0  5.0M   0% /run/lock
tmpfs                                                   8.1G     0  8.1G   0% /run/shm

how i can increase the size ?
 
Old 12-30-2014, 04:12 PM   #2
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 528

Rep: Reputation: 78
Hi,

Here is a prety well detail how to, to do so:
http://www.linux.com/learn/tutorials...th-a-swap-file

But let me be curious and ask you why would you do such thing?

Usually, when your os is swapping, this is bad.

So I don't even imagin with 30G of SWAP. Unless you really want to kill the performances of your machine.
But if you got the choice, add some RAM... Really.

Angel.

Last edited by angel115; 12-30-2014 at 04:13 PM.
 
Old 12-30-2014, 04:15 PM   #3
!! hack-back !!
Member
 
Registered: Nov 2009
Posts: 183

Original Poster
Rep: Reputation: 2
i have 32gb ram, and am using squid server so at some point squid will eat all the ram thats why i need that swap area , what you say ?
 
Old 12-30-2014, 04:32 PM   #4
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 528

Rep: Reputation: 78
I say => DO NOT SWAP (At least I wouldn't do.)
Limit your squid cache size, but do not swap.

swapping will kill the performances of your server.


If you don't believe me, try it, and you will understand my words.

Squid is like a child, the more you'll give him the more it will take.
Show him who is the BOSS.
 
Old 12-30-2014, 05:05 PM   #5
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by angel115 View Post
I say => DO NOT SWAP (At least I wouldn't do.)
Limit your squid cache size, but do not swap.
I can't tell whether that advise is based on what you might know about squid (which I will assume is more than I know) or based on what you think you know about swapping (which I'm quite confident is more than you actually know).

Servers using swap space is not generally a bad thing. Even major use of swap space in not necessarily a performance problem. Limiting swap space or swappiness to less than your system should have, can significantly reduce performance.

I have quite a lot of swap space configured, and in some cases used, on the Linux systems for which I make those decisions. My decisions in those cases are quite well supported by evidence, unlike the common bias against swapping seen in this forum. I would not extrapolate from my experience to a server on which the major memory usage is squid, because I don't know enough. So I won't claim to know you are wrong. I just think the OP should be warned that you sound like you are repeating commonly held incorrect views.
 
1 members found this post helpful.
Old 12-31-2014, 04:29 AM   #6
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 528

Rep: Reputation: 78
Hi Johnsfine,

Thank you for your well formulated contribution to this answer.

Few years back I did experience this issue as well, and I notice that squid swapping was making the IO going up as hell.
After tuning up squid on "what should be cached" and what should not, I reduce the cache size.
Doing so, I've seen a significant performance improvement.
Tuning squid cache is not easy but you'll get much better performances at the end.


But you are right with one point here, I do not have enough information to say that hack back shouldn't use SWAP. Maybe he got some SSD, in that case it might not heart too much (although I never tried this configuration).

But at the end of the day (in my opinion "and by experience", and it seems that by the squid team as well) SWAP usage should be use with caution as performances WILL suffer. (see my quote below)


Quote:
If you have a low memory server, and a large disk, then you will not necessarily be able to use all the disk space, since as the cache fills the memory available will be insufficient, forcing Squid to swap out memory and affecting performance. A very large cache_dir total and insufficient physical RAM + Swap could cause Squid to stop functioning completely. The solution for larger caches is to get more physical RAM; allocating more to Squid via cache_mem will not help.
Ref: http://wiki.squid-cache.org/SquidFaq/SquidMemory

Regards,
Angel.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
is swap space needed when RAM is greater than hard drive space ? ron7000 Linux - General 9 11-13-2014 09:56 PM
What if tmpfs space is full? Written to swap space? pstein Linux - Newbie 8 11-18-2012 07:51 AM
[SOLVED] what the difference swap space and swap file dundu Linux - Newbie 4 07-29-2012 01:03 PM
how much swap space is needed; how to increase swap space? johnpaulodonnell Linux - Newbie 5 03-23-2007 04:20 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 02:23 AM


All times are GMT -5. The time now is 08:21 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration