LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 04-24-2017, 01:19 PM   #16
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142

Quote:
Originally Posted by MadeInGermany View Post
Even a 1GB swap is a great improvement.
Because if the system starts to use swap, this is a hint that more RAM will speed it up.
I did quite a lot of tests with multiple databases during the last months and found out that this statement might indirectly be wrong respectively that under certain conditions it be couterproductive to have swap.

Meaning that on a server with a total of 32GB RAM, and 4GBs of really used RAM (for the executables of the DBs and some directly cached data, while I left the rest free to be used for the usual filesystem cache), and when doing a lot of I/O to&from disk for hours up to days, Linux started swapping tiny amounts of KBs quite early and kept on doing that for a loooong time (probably until it doesn't find "unused" execs & other stuff in RAM which is idle).
My workaround was to set swappiness to 0, but that's for sure not ideal... .

Summarized: the kernel might try to use swap even if there is plenty of "unused" RAM, with the scope to increase the available RAM to be used for filesystem read-cache, if there is a lot of I/O.
If under this condition a program is running which becomes active only rarely, having swap will slow down its execution (because when it executes it will probably be swapped out).
 
Old 04-24-2017, 04:05 PM   #17
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Quote:
Originally Posted by MadeInGermany View Post
Good point but shouldn't it be mkswap /swap ?
Correct. mkswap

So used to fs after all the "other" tools.

And perhaps override defaults to not favor using swap.

# echo 20 > /proc/sys/vm/swappiness

The default is 60 for many distros. Which can slow you down for things like gaming where playing it safe isn't much of a concern.
 
Old 04-25-2017, 12:31 AM   #18
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Smile

Quote:
Originally Posted by Shadow_7 View Post
You forgot $(mkswapfs -v1 /swap).

Perhaps the networking is set to the 10 side of 10/100. It depends on what you are considering "slow". Is it consistently slow? Or does it come and go?
I guess it must have been a while since I needed to add swap on the fly. Thank you.
 
  


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
Server + proxy server has become very slow? HDD? higgins909 Linux - Server 2 08-12-2016 08:35 AM
Server is slow GMCbris Linux - Server 14 01-07-2010 01:00 AM
X server slow response when connected to slow Wifi bluesmanu Linux - Software 0 04-09-2008 06:56 AM
Slow slow server PB0711 Linux - Server 5 10-12-2006 12:01 AM
getting mails from remote mail server is slow,so need an intermediate server Sleen Linux - Networking 5 09-30-2006 03:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:23 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