SliTaz SliTaz Forum

You are not logged in.

#1 2013-03-25 17:46:51

jjk
Member
Registered: 2012-09-22
Posts: 82

cpu lag out

my cpu lags out at random times, I can't see which process it is because task manager doesn't update process information while its lagging...

I've come up with two idea's to fix this:

1. view some kind of process log to see which process was causing the lag.

2. install a package which limits cpu usage of single processes to 90% or so.

does anyone have any idea which package i could use and how to configure it for one of the above methods? (or come up with another method of fixing this...)

thx for helping

JJK

Offline

#2 2013-03-25 18:12:38

subreptice
Member
Registered: 2013-03-10
Posts: 54

Re: cpu lag out

hello

Perhaps top comand in xterm would been less affected by lag and let you see what process is guilty ?

Offline

#3 2013-03-25 19:53:57

rerivero
Member
Registered: 2012-06-18
Posts: 235

Re: cpu lag out

try in xterm as root

# top

can see the resources used by processes and identify the problem...

Offline

#4 2013-03-28 04:54:06

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: cpu lag out

I prefer htop myself - it looks a little better than top and uses human readable numbers.

Offline

#5 2013-03-30 08:55:38

jjk
Member
Registered: 2012-09-22
Posts: 82

Re: cpu lag out

I ran top for a while, and strange thing is there isn't one process that uses very much cpu. sometimes klogd takes 100% but thats only a couple of seconds. I saw that system processes take most of the cpu (98.8% usr: 1.2%) . but top only shows user processes for as far as I know.

how can i show the system processes?

Offline

#6 2013-03-30 12:30:51

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: cpu lag out

what is your configuration ?

Offline

#7 2013-03-31 11:02:00

jjk
Member
Registered: 2012-09-22
Posts: 82

Re: cpu lag out

i don't know what you mean by configuration, could you please be a bit more specific, where do i find that configuration?

i made a picture of the interesting part of the screen while it was stuck.

it should be below.

as you can see the usr part is not using very much cpu, but the sys and the io part are.

and you can't see which processes are running there.

sorry for the bad quality i made it with my ipod.

Offline

#8 2013-03-31 14:58:23

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: cpu lag out

cpu/ram/disk

cpu lag could be swapping in/out....

Offline

#9 2013-03-31 16:15:13

jjk
Member
Registered: 2012-09-22
Posts: 82

Re: cpu lag out

Thx for the quick response christophe,

I dont know what you mean, swapping in/out... Anyway how do i check if thats the problem, and if so how do i fix it?

Please keep in mind that im a bit of a newbie on the linux scene.

Offline

#10 2013-03-31 21:56:59

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: cpu lag out

check wikipedia to understand swap

htop will tell you if there is some swap at all (line 4)

you need to install it from the repository. I assume you know how to do that.

you can paste a copy of you screen here (instead of using an ipod)

(there is a tool in slitaz which allows for screen copy, check i think in "graphic" menu)

People here are extremely helpful and willing to help so dont worry for asking

By the way what is your machine / config ?

Offline

#11 2013-04-01 08:06:44

jjk
Member
Registered: 2012-09-22
Posts: 82

Re: cpu lag out

i understand a bit what swap is, normally, the swap is not used. During lag the cpu is on 100%

but the memory isn't, so my swap is very less used, I don't think that's the problem.

i know i can make a screenshot, but that isn't very easy when your cpu is working overtime, thats why i made the picture with my ipod.

machine/config? lspci? what do you mean?

my laptop is a "hp compaq nc6120".

Offline

#12 2013-04-01 13:41:58

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: cpu lag out

Do the same with htop so that we know what is happening instead of guessing

The output of eg "vmstat 2" may tell some insight also.

Offline

#13 2013-04-01 13:57:32

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: cpu lag out

Processing large amount of data that fills the swap, it WILL cause the CPU percentage to spike high, especially if the program lags because of it. It happens with a certain game client I use (ManaPlus) when my Swap space gets filled which it uses for saving cache data. Incidentally, it also doesn't show up in top under Memory usage persentage hmm

Trust me, you need swap or this will become a common occurrence with process heavy programs and even with some that is not. You'd only need about 450MB of swap though.

Offline

#14 2013-04-01 17:45:38

jjk
Member
Registered: 2012-09-22
Posts: 82

Re: cpu lag out

ill try to take a picture of the htop screen, and post the output of vmstat 2.

I'm waiting for the cpu to start lagging again....

I do have a swap partition, which is 1.4 gb.

btw. cpu starts to use 100% even when i'm doing nothing, but it occurs more frequently when i'm actively using the laptop.

Offline

#15 2013-04-02 13:14:37

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: cpu lag out

you can

vmstat 2 | tee vmstat.log

when you exit with ctrl+c then vmstat.log contains a copy of the screen output

just copy the few bottomlines at the time of cpu lag (instead of taking a pic)

Offline

#16 2013-04-04 17:10:02

jjk
Member
Registered: 2012-09-22
Posts: 82

Re: cpu lag out

here's the picture of my htop.

photo%281%29.JPG?dl=1

I hope you can understand what's wrong.

I haven't been able to log vmstat yet, will try next time.

Offline

#17 2013-04-04 19:47:23

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: cpu lag out

it does not give an answer to the perf issue. There are 7 threads running, so obviously there is contention for the cpu. It is not the swap that is for sure. It could be disk output

Can you try/check 3 things

Make sure htop output gets sorted by cpu when you run vmstat (through F6, select cpu)

does the problem happen also when firefox is not running ?

And last, when there is contention, can you see.hear/see if the disk is being heavily (constantly) accessed.

firefox can require lot of resources under some conditions.

Offline

#18 2013-04-07 12:35:31

jjk
Member
Registered: 2012-09-22
Posts: 82

Re: cpu lag out

all foto's about this problem are here:

https://www.dropbox.com/sh/94qbskj1l2xl8vu/ypJxTrsAFB

Htop is sorted by CPU.

Problem does occur when firefox is not running, see most recent picture.

i can hear the cpu cooling spin very fast, i dont hear any peeps, beeps or anything.

a bit of extra information, usualy my cpu load is around 1-6% during lag it is at 98-100%.

Offline

#19 2013-04-07 13:27:14

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: cpu lag out

it is hard to tell without being in front of the screen and you provide little and static data where more dynamic data is required for a diag, so you will have to investigate a little bit more by yourself

On the data you provide, when that happens, vmstat shows 100% on system time;

at that specific time, you need to check htop and spot which is the process using most cpu (the information varies each second, you are looking for using your best guess).

Sometime the culprit will not appear as you would expect in htop; specially if the lag time is in system time, which from the little data you sent is what is happening (but the data is too little to decide).

You will have to check for it several time and decide if there is an overwhelming pattern and then an overwhelming process for that. Or a pattern with an application you are using (eg, firefox or midori, or listening to an online radio, or locally to music for example).

With system time lag i would suspect something tied to the network first, specially if you are using wifi.

Unless someone else has a better idea to suggest this is the route i would take first.

Offline

#20 2013-04-14 09:44:12

jjk
Member
Registered: 2012-09-22
Posts: 82

Re: cpu lag out

I think you're right, firefox and/or spotify were using the most cpu. (about 27% each). I haven't been using firefox and spotify for some time now and it is happening much less frequently.

the part i don't understand is that the programs are by far not using 100% cpu, but still htop tells me 100% cpu usage, any idea why the cpu goes higher than the program's cpu usage? is there something updating or so?

much thx for helping

JJK

Offline

#21 2013-04-14 19:36:23

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: cpu lag out

Hard to tell what is happening in your machine without being there.

It sometimes gets tricky to track down things once they happen in system time; plus it goes down to understand what 100% cpu really means, which may vary with each individual tool...

Offline

#22 2013-04-15 06:20:51

jjk
Member
Registered: 2012-09-22
Posts: 82

Re: cpu lag out

ok, I'd say it's solved, as long as i don't use firefox and spotify too much.

thx for helping.

JJK

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.017 seconds, 7 queries executed - Memory usage: 1.57 MiB (Peak: 1.77 MiB) ]