LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-10-2005, 05:06 PM   #1
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Rep: Reputation: 30
Swap memory is not being used when needed


Hi,
I just installed fedora 2 and for whatever reason, the swap is activated but never gets used, this system just gets slower and slower, I can't even run up2date without it freezing. Also, I find that the web server takes forever to load dynamic pages, I believe that the swap memory is the culprit here as well. When I do free I get:

Mem: 515956 510844 5112
Swap 771112 0 771112

Plus some other stuff about buffers etc, but this shows that the swap just isn't being used. At 510mb out of 512, I would think that swap would kick in, but it doesn't matter what I do, it is never used. Any ideas on how to fix this?

Thanks.
 
Old 01-10-2005, 05:34 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
What is output of:
$ cat /proc/sys/vm/swappiness

if it is low you can:
$ echo "60" > /proc/sys/vm/swappiness

where '60' is a arbitrary number between 1-100 that describes how much memory the kernel will swap out...
 
Old 01-11-2005, 12:58 AM   #3
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
Linux manages memory much differently than Windows, and this article does a great job of explaining it. As you know, the only time swap ever gets used is when the demand on the system pushes RAM past its capacity, and the system is forced to write memory pages to the hard drive. That's not a good thing in terms of performance (consider that access times within RAM are measured in nanoseconds while access times for a hard drive are measured in milliseconds) and therefore, you want your swap usage to be minimal.

If you are experiencing performance degradation, then I'd suggest checking both "top" and "ps ax" to see what else is running. It may be that you've got unnecessary processes running that are eating up CPU cycles, or alternatively, depending on the speed of your Internet connection, the freezing that you describe may just be a function of the traffic on the server you're visiting or the data transmission speed. Either way good luck with it. -- J.W.
 
Old 01-11-2005, 09:42 AM   #4
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Original Poster
Rep: Reputation: 30
I understand that swap is only used when needed, and I'm thinking that it is needed and that the memory is being maxed out constantly. `cat /proc/sys/vm/swapiness` reveals a 60. There really isn't anything unecessary running on the box, I have xwin open, but we need that, and I'm not talking about a major thing, just viewing a webpage that uses mysql db, this takes over a minute to load, my network connection is not the issue, I am within a campus network on the same segment as the server itself, so the traffic shouldn't ever go past the switch since the mac address of the server is local to the switch I'm plugged into.

Top doesn't show much running, and the load average is around .64. Nothing points to poor performance, but up2date will not complete successfully, and my pages take forever to load, I am baffled. Thanks for your help.
 
Old 01-11-2005, 09:50 AM   #5
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Original Poster
Rep: Reputation: 30
It looks like it might just be a huge database causing the problem, the pages aren't taking as long as they used to, but it's kinda wierd that it cannot complete an up2date update at all, it just freezes, and never uses swap, or anything, but the system slows down dramatically. Thanks for the help.
 
Old 01-11-2005, 10:42 AM   #6
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
Linux always keeps as much as possible in memory, so you SHOULD see the memory maxed out, even when very little of it is being actively used.

What does "free -m" show? If you've got lots cached and/or buffered, your memory isn't maxed out, it's just being used effectively.
 
Old 01-11-2005, 05:10 PM   #7
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Original Poster
Rep: Reputation: 30
okay, so swap was finally used, and it looks like memory is fine. However, this system is slower than it should be and I have no idea why. 512mb ram, PIII 6xx (not sure exactly), it just took 5 minutes for the system to respond to a "shutdown -r now", mozilla takes longer than 5 minutes to open, openoffice will not open, when I am trying to open mozilla it only uses 10% CPU and 4% memory, yet is unusable cause it's so slow. Everytime I search for something similar the responses are "switch desktop environment, stop services" etc... I have minimal services running, I am running KDE, but it should run fine on this system, and the fact that the cpu spends most of its time below 10% suggests to me that something really wierd is going on. Any other ideas in figuring this one out? There are no errors being shown in the log files except this:

"xf86AllocateGARTMemory: allocation of 1024 pages failed (Cannot allocate Memory).

All help is greatly appreciated.

Mike.
 
Old 01-11-2005, 05:56 PM   #8
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Original Poster
Rep: Reputation: 30
even "telinit 3" takes over 5 minutes.
 
Old 01-11-2005, 06:41 PM   #9
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
You might want to check your memory. Create a memtest86+ boot disk or on some distros there might be a file called memtest86+*** in your /boot file. If it there add it to grub like this. Example from my /boot/grub/grub.conf file. (hd0,1) is reference to /dev/hda2 where my /boot directory is mounted. Yours my be differnet.

Memtest86+ at http://www.memtest86.com/

# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,1)
# kernel /vmlinuz-version ro root=/dev/hda8
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
title Custom Kernel (2.6.10-rc2) Cdfs, Ntfs, Udf, Ufs, Acpi, Hermes
root (hd0,1)
kernel /vmlinuz-2.6.10-rc2 ro root=/dev/hda8 vga=793
initrd /initrd-2.6.10-rc2.img
title Memtest86+ (3.2)
root (hd0,1)
kernel /memtest86+-v3.2 ro root=/dev/hda8 vga=793
title Winblows XP Amateur
rootnoverify (hd0,0)
chainloader +1


Brian1
" Google the Linux way @ http://www.google.com/linux "
 
Old 01-12-2005, 02:51 AM   #10
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
May be worth checking the hard drive settings - if disk access is slow, then it'll take forever to start up software.

hdparm is a good app for this
 
Old 01-12-2005, 09:25 AM   #11
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Original Poster
Rep: Reputation: 30
Haven't tested mem yet but this is hdparms report:

Timed buffer-cache reads: 416Mb in 2.00 seconds = 207.82Mb/sec
Timed buffered disk reads: 36Mb in 3.03 seconds = 11.89Mb/sec

Doesn't look too bad to me. Thanks for the ideas guys!

Mike.
 
Old 01-12-2005, 11:04 AM   #12
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
Humm. . . my HD is a pretty standard IDE drive. My hdparm results are:

Timing cached reads: 1592 MB in 2.00 seconds = 795.72 MB/sec
Timing buffered disk reads: 136 MB in 3.04 seconds = 44.80 MB/sec

You may want to check if DMA is on. What does just "hdparm [device]" show?
 
Old 01-12-2005, 12:16 PM   #13
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Original Poster
Rep: Reputation: 30
First, I should correct that this isn't a 6xx processor its a Gig processor PIII.

hdparm shows:

/dev/hda:
multcount = 8 (on)
IO_support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 1 (on)
keepsettings = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
geometry = 19885/16/63, sectors = 20044080, start = 0

Wierd thing I got when doing a service --status-all:

Squid Cache (Version 2.5.STABLE5): Terminated abnormally.
CPU Usage: 0.016 seconds = 0.007 user + 0.009 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
/etc/init.d/squid: line 162: 3212 Aborted $SQUID -k check

Notice the page faults, any relevency? Also, the memory tested fine.

Thanks.
 
Old 01-12-2005, 12:42 PM   #14
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
I'm not sure how much this will help, but I would at least turn on 32 bit i/o support:
Code:
# hdparm -c2 /dev/hda
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Swap Memory xbill311x Linux - Newbie 2 04-11-2005 01:58 PM
no memory swap os2 Programming 2 06-11-2004 12:32 PM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 07:58 PM
memory swap - still needed ??? xen_chris Linux - Newbie 8 04-08-2003 03:48 PM
Swap Memory in use or not? Qebex Linux - Hardware 5 09-21-2002 07:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:53 AM.

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