forums.xandros.com Forum Index forums.xandros.com
Xandros User Forums
 
 FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to Fix Sluggish Performance on X4 with Certain CPU's
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    forums.xandros.com Forum Index -> Tips & Tricks
View previous topic :: View next topic  
Author Message
cprise
Xandrosian
Xandrosian


Joined: 26 Dec 2003
Posts: 592

PostPosted: Wed Mar 28, 2007 2:36 pm    Post subject: How to Fix Sluggish Performance on X4 with Certain CPU's Reply with quote

Many people have been commenting about Xandros 4 (and a couple other debian distros like Knoppix 5.x) running extremely slow on their recent Intel-based desktop systems (Pentium 4 and later).

There is a bug in the /etc/init.d/acpid script, where a malformed if-statement turns on CPU frequency-scaling by mistake. On many recent Intel CPUs, the default allowable frequencies go all the way down to 400MHz. And with the CPU put into 'ondemand' mode that's where your system will stay 95% of the time, at 400MHz, and will rarely go any higher unless you throw somewhat prolonged CPU-intensive tasks at your system. The result is that 'lightweight' tasks like web browsing that have short bursts of activity will feel very slow because the CPU runs them at 400MHz.

If Firefox, Openoffice or the file manager seem especially slow after upgrading to X4, you should check your current CPU speed with:
Code:
# less /proc/cpuinfo

If the line that says cpu mhz: seems abnormally low (400 on a system that supports 3200) then you have the frequency problem.

The short solution is to edit /etc/init.d/acpid and change this line:
Code:
echo ondemand > $1/cpufreq/scaling_governor

...so that ondemand reads performance instead, then reboot.

(Note that the if-statement controlling the above command appears to be nonsensical: what is '-a' doing there??)

You also have another option by changing the scaling_min_freq to some acceptable minimum speed such as 1600000 (1.6Mhz):
Code:
# echo 1600000 >/sys/devices/system/cpu/cpuX/cpufreq/scaling_min_freq

...where the list of acceptable frequencies can be shown with:
Code:
# cat /sys/devices/system/cpu/cpuX/cpufreq/scaling_available_frequencies


(Replace cpuX with cpu0, cpu1, etc. as appropriate.)


Any system that goes from running at 400MHz to 3200MHz will make a world of difference in responsiveness for your desktop and applications. My experience with different Intel systems running on a combination of ASUS and Intel motherboards shows that frequency-scaling isn't nearly sensitive enough to keep a desktop system at an acceptable level of responsiveness. I can see it being used for laptops, but even so, 400MHz is going too far in an attempt to save battery power and I would expect a minimum clock frequency higher than that.
_________________
"We need the computer power you're not using." Join ClimatePrediction.net at the BBC.
Back to top
View user's profile Send private message Yahoo Messenger
Arne Anka
Xanscended
Xanscended


Joined: 21 Mar 2004
Posts: 4183
Location: Stockholm, Sweden

PostPosted: Wed Mar 28, 2007 3:43 pm    Post subject: Re: Sluggish performance (and fix for cpufreq BUG) Reply with quote

cprise wrote:

(Note that the if-statement controlling the above command appears to be nonsensical: what is '-a' doing there??)


I don't have the '-a' on my laptop running X4 Pro. It says '-d'. Never the less, freq scaling works like a charm on my laptop (perhaps it works well because my CPU can't go below 800 MHz).

Have you tried to configures the parameters found under
/sys/devices/system/cpu/cpu0/cpufreq/ondemand/ ?

Here is a list of them:

ignore_nice_load
sampling_rate_max
up_threshold
sampling_rate
sampling_rate_min

You could for instance changing up_threshold from 80% CPU load (default) to something less e.g. 50%:

echo 50 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold

or change the sampling rate.

If you have the kerne source installed, check /usr/src/dcc-kernel-source-2.6.18/Documentation/cpu-freq/governors.txt
for more info.
Back to top
View user's profile Send private message
cprise
Xandrosian
Xandrosian


Joined: 26 Dec 2003
Posts: 592

PostPosted: Thu Mar 29, 2007 10:08 pm    Post subject: Reply with quote

Arne Anka wrote:

I don't have the '-a' on my laptop running X4 Pro. It says '-d'. Never the less, freq scaling works like a charm on my laptop (perhaps it works well because my CPU can't go below 800 MHz).

Thanks Arne. On the three desktop systems I tried to get X4 Pro (SP1) working properly, they all exhibited a terrible insensitivity re: frequency scaling and ran dog-slow.

Its good to hear X4 works better on laptops. However, the difference in the if-statement in your acpid and the if-statement in mine leads me to believe the X4 installer is installing different logic at install time, and may be making more intelligent decisions about scaling when installing to a laptop.

Quote:
Have you tried to configures the parameters found under
/sys/devices/system/cpu/cpu0/cpufreq/ondemand/ ?

Here is a list of them:

ignore_nice_load
sampling_rate_max
up_threshold
sampling_rate
sampling_rate_min

You could for instance changing up_threshold from 80% CPU load (default) to something less e.g. 50%:

echo 50 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold

or change the sampling rate.

If you have the kerne source installed, check /usr/src/dcc-kernel-source-2.6.18/Documentation/cpu-freq/governors.txt
for more info.

I haven't tried it, as I am not that interested in CPU scaling for a desktop system. But if lowering the threshold does a good job I may switch to using ondemand.

In any case, the defaults used when installed to a desktop system are pretty awful. Knoppix has the same problem, so it could be a DCC core thing, or a Debian thing. Actually, Fedora Core 6 seemed to have the same problem. Ubuntu, however, did NOT have the problem and it does set the scaling_governor to 'performance'.
_________________
"We need the computer power you're not using." Join ClimatePrediction.net at the BBC.
Back to top
View user's profile Send private message Yahoo Messenger
redrum
Xandros Community Moderator
Xandros Community Moderator


Joined: 05 Apr 2004
Posts: 2758
Location: Rapid City, South Dakota

PostPosted: Fri Mar 30, 2007 2:59 am    Post subject: Reply with quote

Wow... That makes a HUGE difference.. Thanks for the tip cprise Smile
_________________


Beware of the man who would deny you access to information,
for in his heart he dreams himself your master.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
geekydude
Xendrosian
Xendrosian


Joined: 29 May 2005
Posts: 2511
Location: Portland, OR

PostPosted: Fri Mar 30, 2007 11:06 am    Post subject: Reply with quote

Just to be clear...

This is only Intel base CPU's and NOT AMD based CPU's, right?
_________________
geekydude
registered Linux user number 410045.

The source will be with you...always....
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Arne Anka
Xanscended
Xanscended


Joined: 21 Mar 2004
Posts: 4183
Location: Stockholm, Sweden

PostPosted: Fri Mar 30, 2007 12:08 pm    Post subject: Reply with quote

geekydude wrote:

This is only Intel base CPU's and NOT AMD based CPU's, right?


Its same for AMD (same code is executed) if frequency scaling is supported (not all does).
Back to top
View user's profile Send private message
cprise
Xandrosian
Xandrosian


Joined: 26 Dec 2003
Posts: 592

PostPosted: Sat Mar 31, 2007 12:23 am    Post subject: Reply with quote

Arne Anka wrote:
geekydude wrote:

This is only Intel base CPU's and NOT AMD based CPU's, right?


Its same for AMD (same code is executed) if frequency scaling is supported (not all does).

The faulty acpid code specifically looks for "Genuine Intel" so that makes me think it applies to Intels only. Also I have some older Athlons that have never shown a speed problem with X4 or any other Linux.

But I'm not 100% sure that its limited to Intel.

Readers: If you are unsure whether this problem may be affecting you, the telltale sign is a low "cpu mhz" reading. You can check this in Control Center>> Hardware Info>> System>>CPU, or by typing the command "less /proc/cpuinfo".
_________________
"We need the computer power you're not using." Join ClimatePrediction.net at the BBC.


Last edited by cprise on Sat Mar 31, 2007 12:32 am; edited 1 time in total
Back to top
View user's profile Send private message Yahoo Messenger
redrum
Xandros Community Moderator
Xandros Community Moderator


Joined: 05 Apr 2004
Posts: 2758
Location: Rapid City, South Dakota

PostPosted: Sat Mar 31, 2007 12:29 am    Post subject: Reply with quote

The way to know is to go into the control panel and see if your cpu is being detected as a 400 mhz processor. If it is, you have the bug.
_________________


Beware of the man who would deny you access to information,
for in his heart he dreams himself your master.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Arne Anka
Xanscended
Xanscended


Joined: 21 Mar 2004
Posts: 4183
Location: Stockholm, Sweden

PostPosted: Sat Mar 31, 2007 6:30 am    Post subject: Reply with quote

cprise wrote:
The faulty acpid code specifically looks for "Genuine Intel" so that makes me think it applies to Intels only.


That is partly true. If you have a stationary PC, then ondemand is used only for processors recognized as GenuineIntel. For laptops
ondemand is always used no matter what CPU it is.

But then, frequency scaling is perhaps only a problem on stationary PC running Intel CPUs.

Could you paste the whole content of the command

cat /proc/cpuinfo

I curious to see exactly what it says.
Back to top
View user's profile Send private message
iHateWindows
Xandrosian
Xandrosian


Joined: 21 Dec 2006
Posts: 237
Location: Wisconsin, USA

PostPosted: Sat Mar 31, 2007 9:26 pm    Post subject: Reply with quote

I checked the freq that my CPU was running at. It showed 600Mhz and I have a 1.6Ghz CPU in this laptop. So, I changed the code as per above and now I'm off to reboot.
Back to top
View user's profile Send private message Send e-mail
iHateWindows
Xandrosian
Xandrosian


Joined: 21 Dec 2006
Posts: 237
Location: Wisconsin, USA

PostPosted: Sat Mar 31, 2007 9:44 pm    Post subject: Reply with quote

OK. That didn't work. So, I played around a little more. My code had the -d in it, too. So, I changed both -d's to -a's and that fixed me up. I didn't have the other code with cpuX in the line and I wasn't brave enough to try adding that anywhere. Anyway, if you don't have -a's, I'd say change them and you should be all set.
Back to top
View user's profile Send private message Send e-mail
cprise
Xandrosian
Xandrosian


Joined: 26 Dec 2003
Posts: 592

PostPosted: Sun Apr 01, 2007 12:25 pm    Post subject: Reply with quote

iHateWindows wrote:
OK. That didn't work. So, I played around a little more. My code had the -d in it, too. So, I changed both -d's to -a's and that fixed me up. I didn't have the other code with cpuX in the line and I wasn't brave enough to try adding that anywhere. Anyway, if you don't have -a's, I'd say change them and you should be all set.

My advice here is meant for desktop systems. Laptops are a different matter, where one expects to see frequency scaling used a lot. If 600MHz seems to be responding too slow for you, I'd try one of Arne's suggestions instead (raising the min frequency or lowering the threshold) though it will affect your battery life.
_________________
"We need the computer power you're not using." Join ClimatePrediction.net at the BBC.
Back to top
View user's profile Send private message Yahoo Messenger
cprise
Xandrosian
Xandrosian


Joined: 26 Dec 2003
Posts: 592

PostPosted: Sun Apr 01, 2007 12:29 pm    Post subject: Reply with quote

Arne:
Code:
processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Pentium(R) 4 CPU 3.20GHz
stepping        : 9
cpu MHz         : 3200.000
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl cid cx16 xtpr lahf_lm
bogomips        : 6400.39

Same for cpu0. It's a P4 with HT. I don't have the Pentium-D systems at hand now to post their cpuinfo.
_________________
"We need the computer power you're not using." Join ClimatePrediction.net at the BBC.
Back to top
View user's profile Send private message Yahoo Messenger
bigiron45
Xplorer


Joined: 19 Jan 2004
Posts: 138
Location: TN

PostPosted: Sun Apr 01, 2007 12:31 pm    Post subject: Reply with quote

I can't even find all my old posts on the problem I was having dealing with what I was calling " screen lag", though this thread, way back early on has one of them from me. It was on my Toshiba laptop and I tried, what I thought was everything, some of it 2 or 3 times!
Well, I spotted this thread and decided, what the heck, install ONE more time and see what happens.


And... THIS FIXED IT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I can't even begin to tell you how incredible this is!!! I installed, went to that # less/cpu thing and saw it listed as 274mhz. It is actually a 2.2 GHZ so I thought, could this really be it , after all this time???
I went through the edit and restarted and TADA!!! Now showing as 1700 or something and no longer have the lag!!! Windows just pop open!

I am now charging the laptop battery and will do a clean fresh install when it is done ( I did a dual boot on this first to test it).


Cprise, you deserve a medal!!! Thanks for posting this!!
I just have one question, though....

What took so long?!?!?!?!?!
Laughing

JUST KIDDING!! Very Happy

Thanks, seriously, I can hardly believe I am going to be able to use Xandros on this laptop now!!
A great start to the week!!

Thanks again!!!!

Kevin
Back to top
View user's profile Send private message
TekMate
Xendrosian
Xendrosian


Joined: 20 Feb 2003
Posts: 1092
Location: MA

PostPosted: Sun Apr 01, 2007 12:50 pm    Post subject: Reply with quote

This didn't work for me through reboots. Now I am on a laptop so it is not a huge deal but thought I would let you know.
_________________

If you were offered the chance to learn the truth…would you take it?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.xandros.com Forum Index -> Tips & Tricks All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group