Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-24-2017, 02:19 PM   #16
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142

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, 05:05 PM   #17
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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, 01:31 AM   #18
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

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.


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

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration