Posts Tagged ‘Kernel 2’

linux-3.1.x power regression issues i915 core-i5,i7

Saturday, November 5th, 2011

there’s been a lot of talk about the power regression issues with the linux-3.x kernel on the new intel sandy bridge core i3,5,7 chipsets.

after spending several hours with this issue on a new thinkpad x220 laptop, i’ll share a solution thanks to the peeps over at #fedora-qa

***UPDATE – Kernel patch now available at LKML – https://lkml.org/lkml/2011/11/10/467 (i’ll report my results with this when I get a chance to build the patch rpm, i’ll post) As of now I’m still having issues with the iwlagn module.

fyi , i’m running fedora 16 RC5 x86_64 but these kernel parameters apply to any distro

you’ll want to pass the following parameters at runtime or at boot, however you like :

pcie_aspm=force power_save=3 i915.i915_enable_fbc=1 i915.i915_enable_rc6=1 i915.lvds_downclock=1

then generate a new grub2 (or 1.xx) config file and reinstall grub to your mba on the disk.

my results were pretty good. idle 70% lcd brightness from 16W to 7.5W average and 5.76W baseline. I’ve yet to tell but it seems at about 16 hour battery life.

you’ll also want irqbalance installed to take best advantage of power management balance, distribution and usage over the processors

finally, i use this bash script at runtime so further fine tune my acpi power usage

#!/bin/bash
echo 1 > /sys/module/snd_hda_intel/parameters/power_save

for i in /sys/class/scsi_host/host?/link_power_management_policy; do
echo min_power > $i
done

for i in /sys/bus/usb/devices/*/power/autosuspend; do
echo 1 > $i
done

for i in /sys/bus/{pci,i2c}/devices/*/power/control; do
echo auto > $i
done

echo 1 > /sys/devices/system/cpu/sched_mc_power_savings

echo 5 > /proc/sys/vm/laptop_mode
echo 0 > /proc/sys/kernel/nmi_watchdog
#echo Y > /sys/module/snd_ac97_codec/parameters/power_save
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo 60 > /proc/sys/vm/dirty_ratio
echo 20 > /proc/sys/vm/dirty_background_ratio
echo 1500 > /proc/sys/vm/dirty_expire_centisecs
for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 1 > $i; done
# those sysctl’s are only available if you have an AHCI compatible SATA
# controler and use kernel > 2.6.24-rc2 (or use Kristen ALPM patchset) :
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
echo min_power > /sys/class/scsi_host/host1/link_power_management_policy
echo 1 > /sys/module/snd_hda_intel/parameters/power_save
echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller
ifconfig em1 down
ifconfig virbr0 down
/etc/init.d/libvirtd stop
rmmod bluetooth
hdparm -B 1 -S 12 /dev/sda > /dev/null
echo 1 > /proc/sys/vm/swappiness
service atd stop &> /dev/null
service cron stop &> /dev/null
service anacron stop &> /dev/null

Want to monitor your power usage with dstat? Try this

dstat -t -c –power –top-cpu –top-io –top-bio –top-latency –top-cputime –power –battery-remain 10

apache/mod_wsgi vs. uwsgi

Tuesday, August 3rd, 2010

Quick note to self. I was blown away by siege tests this afternoon.

Two servers, identical
Server Hardware
linux kernel 2.6.32-12
512MB RAM

siege -c 90 –time=120s
server 1= running apache 2.2 with mod_wsgi with nginx 0.7.35 as front end wwwsvr.
Lifting the server siege… done.
Transactions: 2735 hits
Availability: 100.00 %
Elapsed time: 120.21 secs
Data transferred: 9.17 MB
Response time: 3.38 secs
Transaction rate: 22.75 trans/sec
Throughput: 0.08 MB/sec
Concurrency: 77.00
Successful transactions: 2735
Failed transactions: 0
Longest transaction: 11.08
Shortest transaction: 0.16

vs.
siege -c 90 –time=120s
no apache, nginx 0.7.35 with uwsgi
Lifting the server siege… done.
Transactions: 20605 hits
Availability: 100.00 %
Elapsed time: 120.06 secs
Data transferred: 74.51 MB
Response time: 0.03 secs
Transaction rate: 171.62 trans/sec
Throughput: 0.62 MB/sec
Concurrency: 4.82
Successful transactions: 20605
Failed transactions: 0
Longest transaction: 9.02
Shortest transaction: 0.01

Who said you need apache?

siege -c 250 –time=30s
apache/mod_wsgi
Lifting the server siege… done.
Transactions: 185 hits
Availability: 100.00 %
Elapsed time: 30.01 secs
Data transferred: 0.62 MB
Response time: 7.69 secs
Transaction rate: 6.16 trans/sec
Throughput: 0.02 MB/sec
Concurrency: 47.42
Successful transactions: 185
Failed transactions: 0
Longest transaction: 27.10
Shortest transaction: 0.15

nginx/uwsgi
Lifting the server siege… done.
Transactions: 8147 hits
Availability: 100.00 %
Elapsed time: 29.60 secs
Data transferred: 29.46 MB
Response time: 0.39 secs
Transaction rate: 275.24 trans/sec
Throughput: 1.00 MB/sec
Concurrency: 108.68
Successful transactions: 8145
Failed transactions: 0
Longest transaction: 21.02
Shortest transaction: 0.01

uwsgi was able to serve 8147 requests to 250 concurrent connections in the same time mod_wsgi could only serve 185