• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

is this kind of lag normal?

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Spector_306

Registered
Joined
Mar 15, 2002
Location
OR
Well, i've been using Linux for quite a while, about a year, so I'm not a newbie; feel free to fling all the linux knowledge you can at me and if I need help, i'll ask. :D :cool:

The lag I refered to in the title is some serious stuff. It happens when i'm copying a file or doing something CPU and disk IO intesive. My machine 'locks up', by that I mean its totally frozen. Nothing will respond, press num lock and the light won't even change. However, about 2 to 20 seconds later it will spring back into life and be totally normal. Sometimes it lags differently, small amount of lag that causes me to not be able to work at all. Its like the machine does the 'locking up' but its only for about .40 of a second with half a second in between. Its all really annoying when listening to music.

Some things I have noticed about it:
*The lag is different in kernel 2.6, however it is still there and quite strong.
*It only happens when my memory is full (I understand linux caches all the file movements)
*It lags even if I am copying over the network at 2.2 MB/s
*Its not my computer hardware, as the lag is not there in windows.

Has anyone ever delt with lag this serious before? If so, how do I get rid of it (or am I stuck). If not, do I get to name it? I wanna call it spec-lag or something like that. :p

BTW- here are sys specs.
*(cat /proc/version):
Linux version 2.4.21 (root@debian) (gcc version 3.3.2 20030831 (Debian prerelease)) #1 Mon Sep 15 17:01:48 PDT 2003
*I am using a fully updated Debian SID
*I have 768 MB of RAM, and a 1.6a @ 2.2 GHZ.

if you need to know anything else, just post what it is. I hope I can get this problem fixed.
 
i think it is because when the memoty is full linux numbers the processes to most importance so if you are listning to music or what ever it might stop that untill it finishes the other processes
but you have lots of ram so i don't know exactly.

i have only 256mb and i use red hat ( red hat is very slow)
and it only happens every once in a while mostly when i am copping large files.
 
No, it's not normal.
Is your swap space enabled, and how big/full is it? It sounds like your kernel might be thrashing, ie running out of memory and going nuts until it manages to free some. I haven't had any experience with thrashing kernels, though, so this is just a guess.
Have you tried using the preemptible kernel option in the 2.6.0 test kernels?
 
Here, I induced the lag by copying a file; entered the 'free' command and got this:
Code:
debian:~# free -m
       total       used       free     shared    buffers     cached
Mem:     757        752         4          0          12         619
-/+ buffers/cache:  120        636
Swap:    972         1         971

It looks to me that I have a little memory free, and a whole buttload of swap space free. (I set it up when I had 512 MB, using the old ram*2 idea) I ran this command when the lag was really bad.

I have not set that option up in the 2.6 test kernels, do you have a link to some documentation so I can figure out what the heak it does?
 
The lag is probably from hitting the swap, and the kernel locks until it has resolved that operation.

What version of 2.6 are you using? Test6 is supposed to have the latest scheduler, I can notice quite a difference when I'm grinding my laptop into dust.

Also, if your swap is on an ide drive, what are the hdparm settings for it? If you haven't manually configured it with hdparm, then it is likely running in PIO mode.
 
Here is what I get for hdparm on /dev/hdb (the linux hard drive with swap)
---------------CODE--------------------
debian:~# hdparm /dev/hdb

/dev/hdb:
multcount = 16 (on)
IO_support = 3 (32-bit w/sync)
unmaskirq = 1 (on)
using_dma = 0 (off)
keepsettings = 0 (off)
readonly = 0 (off)
readahead = 1 (on)
geometry = 7297/255/63, sectors = 117231408, start = 0
--------------/CODE----------------------

I am currently using kernel 2.4.21, as stated in my first post. I have downloaded kernel 2.6.0-test6, and last tested with test3 so hopefully something has changed.
I will work on getting this new kernel config'd and installed tomarrow(sp?) as i'm quite tired right now.

BTW - here is the command I used in hdparm:
hdparm -m16 -c3 -d1 -X34 /dev/hdb
it gives this error:
HDIO_SET_DMA failed: Operation not permitted. (I'm guessing that either I cant have DMA on this hard drive, or that its a BIOS setting. I'll look into the latter tomarrow also)
 
I've never had any problems like this in Linux that I can remember. I'm using Debian Sid as well. I have noticed some slowdowns when things are busy, but all that did was made dragging windows in Gnome a bit sluggish. Everything was pretty responsive.

What is running that is using all that RAM? If it is the disk cache that is using the RAM, that shouldn't cause you to swap (AFAIK).

Run top and watch your processes when this happens. I've had a runaway process that ate up all my CPU and made my machine sluggish until I killed the process.

DMA not working is very suspect. I think that would imply that your CPU is being used during disk I/O, which could be the reason for this issue. You definitely want to get DMA working. Have you tried changing the hdparm settings in single user mode? I found this article useful for hdparm:

http://linux.oreillynet.com/pub/a/linux/2000/06/29/hdparm.html

BTW, kernel 2.4.22 is in Debian Sid.
 
That is odd that you can't turn on dma. It would help if you could. You should check your kernel settings under the ATA Devices category.
 
In the test5 kernel, the preemptible kernel option is under "Processor Type and Features" right under symmetric multi-processing support.

XWRed1, could you clarify? I've had my swap usage up to 53% during a firebird compile and didn't experience anything like that for disk writes (although my system was slower). How is this different?

BTW nil_esh. Thanks for the link. My hd performance went up from ~2.7 MB/s to ~42.3 MB/s. What's your paypal addy?


















..jk, but thanks again. ;)
 
Last edited:
Just a quick reply telling you what I did.

I updated to the 2.6.0-test6, grappled with sound and graphics and got it up to what I had with the 2.4 kernel. :D Forgot to mention: I found and enabled the preemptible kernel option.

Sadly, the lag persists.:(

I tried running top while I was copying a file, and cp never used over 50% of the CPU time. However, for no reason at all, XFree86 shot up to over 70% (not at the same time) :eek:

What was even wierder about that is that I was not using X, I did this from a virtual terminal (though I had X started).

Checked BIOS, I have a few options for DMA settings. All of the options have a 'auto' and a 'disabled' setting. All of them were already on auto. I tried running HDPARM again, just in case I fixed something without knowing it. I got the same error message.

So here I am, on a 2.6 kernel with the same lag problems and still no DMA. But atleast I have something to do over the weekend. :cool:

Oh, here is a last minute adition. (runing command "hdparm -Tt /dev/hdb")
---------------CODE----------------
debian:~# hdparm -Tt /dev/hdb

/dev/hdb:
Timing buffer-cache reads: 1084 MB in 2.00 seconds = 541.27 MB/sec
Timing buffered disk reads: 22 MB in 3.01 seconds = 7.31 MB/sec
-------------/CODE-----------------

I dont know about you guys, but that seems pretty fast to me.
 
XWRed1, could you clarify? I've had my swap usage up to 53% during a firebird compile and didn't experience anything like that for disk writes (although my system was slower). How is this different?

The difference is that without dma, when you hit that swap the drive access will be slower and the drive access will devour cpu time.
 
Back