Sunday, May 19, 2013

I/O schedulers and performance

I/O schedulers and their impact on performance 

Performance logo
(part -1-)
see part-2- ; see part-3- ==> experience based on Motorola MotoG (Falcon)

Experience based on the Xperia X10mini (robyn/e10) running Jelly-Bean based MiniCM10

this post is a fork of my own post @XDA

  • for a start, what are I/O schedulers ? 

I/O means input&output, I/O scheduling is a method used by the operating system to decide I/O operations order and access to storage volume

main purposes are the following : 

  • minimize time wasted by hard disk seeks.
  • prioritize certain 'processes' I/O requests.
  • give a share of the disk bandwidth to each running process.
  • guarantee that certain requests will be issued before a particular deadline.

taken from : here

there are a lot of I/O schedulers, only some are available in MiniCM ROMS : 

NOOP:- The NOOP scheduler inserts all incoming I/O requests into a simple, unordered FIFO queue and implements request merging.

The scheduler assumes I/O performance optimization will be handled at some other layer of the I/O hierarchy; e.g., at the block device; by an intelligent HBA such as a Serial Attached SCSI (SAS) RAID controller or by an externally attached controller such as a storage subsystem accessed through a switched Storage Area Network.

DEADLINE:- The goal of the Deadline scheduler is to attempt to guarantee a start service time for a request. It does that by imposing a deadline on all I/O operations to prevent starvation of requests. It also maintains two deadline queues, in addition to the sorted queues (both read and write). Deadline queues are basically sorted by their deadline (the expiration time), while the sorted queues are sorted by the sector number.

Before serving the next request, the Deadline scheduler decides which queue to use. Read queues are given a higher priority, because processes usually block on read operations. Next, the Deadline scheduler checks if the first request in the deadline queue has expired. Otherwise, the scheduler serves a batch of requests from the sorted queue. In both cases, the scheduler also serves a batch of requests following the chosen request in the sorted queue.

SIO:- scheduler is based on the deadline scheduler but it's more like a mix between no-op and deadline.In other words, SIO is like a lighter version of deadline but it doesn't do any kind of sorting, so it's aimed mainly for random-access devices (like SSD hard disks) where request sorting is no needed (as any sector can be accesed in a constant time, regardless of its physical location).
ANTICIPATORY:- Anticipatory scheduling is an algorithm for scheduling hard disk input/output.
It seeks to increase the efficiency of disk utilization by "anticipating" synchronous read operations.
CFQ:-CFQ, also known as "Completely Fair Queuing", is an I/O scheduler for the
Linux kernel which was written in 2003 by Jens Axboe.

CFQ works by placing synchronous requests submitted by processes into a number of per-process queues and then allocating timeslices for each of the queues to access the disk. The length of the time slice and the number of requests a queue is allowed to submit depends on the IO priority of the given process. Asynchronous requests for all processes are batched together in fewer queues, one per priority.

BFQ:- BFQ is a proportional share disk scheduling algorithm based on the slice-by-slice service scheme of CFQ. But BFQ assigns budgets, measured in number of sectors, to tasks instead of time slices. The disk is not granted to the active task for a given time slice, but until it has exhausted its assigned budget. This change from the time to the service domain allows BFQ to distribute the disk bandwidth among tasks as desired, without any distortion due to ZBR, workload fluctuations or other factors. BFQ uses an ad hoc internal scheduler, called B-WF2Q , to schedule tasks according to their budgets. Thanks to this accurate scheduler, BFQ can afford to assign high budgets to disk-bound non-seeky tasks (to boost the throughput), and yet guarantee low latencies to interactive and soft real-time applications.
V(R):- The next request is decided based on its distance from the last request, with a multiplicative penalty of `rev_penalty' applied for reversing the head direction. A rev_penalty of 1 means SSTF behaviour. As this variable is increased, the algorithm approaches pure SCAN. Setting rev_penalty to 0 forces SCAN.
thanks to dheeraj

  • Which one is the best?

nobody can answer this question, but i investigated to get the following chart : 

my settings are : 

  •  122~729MHz
  •  smartassH3
  •  undervolted
  •  KSM
  •  zram 18%
  •  swap file 128MB

the Benchmarks have been run several times, and these results are average (i know, i should have made a standard deviation to show accuracy...)

IO and SDcard Read write performances

  • what does the chart show us?

SIO is the more balanced scheduler, it has a good IO, and a good read/write Anticipatory has the best IO, but a bad SDwrite
Deadline has the best SDwrite, but is quite average for IO and SDread
NOOP, CFQ and VR are a bit behind

  • What can we conclude ?
For people using Swap on their SDcard, you need the highest SDcard read/write possible
Here the highest SDcard write is provided by Deadline, but Database I/O (IO in the chart) is important for a good and responsive system...
I think SIO is better since both write/read and IO speed are quite high

If you don't use swap, High SDcard speed is not much important, the highest I/O is better, here it would be Anticipatory or BFQ

All this might not be true on any other device (even with other robyn), to choose the best one for you, the best is to try ;)

Don't forget to read other I/O performances related posts : 

Saturday, May 18, 2013

Customizing Xfce (1)

Playing with Xfce : part 1, panels

Make sure to have a look to :

Contrary to Unity, you change nearly anything you want in the look of Xfce

for a start, we will only talk about panels customization (but there are also themes, icons... that could be changed)

here is a standard, brand new Xfce panel after a fresh install of Xubuntu :  (app panel is hidden)

now right clic on the top panel : 

and play with the available settings, here is what you get :
what you can do : 
  • autohide the panel 

  • set transparency : 

  • move icons/shortcuts using the arrows, add new one using the (+) : 

  • one potential result : 

so here we didn't change the look, but the position/behavior of the panels and their content; the aim is to get what fits most your needs!

one recommandation : play with the settings ;)

Monday, May 13, 2013

accessing an Android device with Linux :

In order to debug/access you android device : 

what to install / ce qu'il faut installer : 

  • openJDK6
  • ADT (android developpment tool)
  • FlashTool (smartphones Xperia) 

follow this tuto / suivre ce tuto :

for ADB, you can need a file called /etc/udev/rules.d/51-android.rules which contains
pour ADB, peut nécéssiter un fichier  /etc/udev/rules.d/51-android.rules contenant

For the xperia X10mini / Pour le xperia X10mini:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", ATTRS{idProduct}=="612e", MODE="0666"

or / ou :

SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0fce″, ATTRS{idProduct}==”e12e″, MODE=”0666"
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0fce″, ATTRS{idProduct}==”612e″, MODE=”0666″
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0fce″, ATTRS{idProduct}==”adde″, MODE=”0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", MODE="0666"

If ADB fails to run : change permission to at least 755 !
Making FlashTool run / faire fonctionner FlashTool:

first log as root / s'identifier comme root:
$sudo bash
then launch the flashtool / ensuite lancer FlashTool:

Do you want more about ADB? read this post then!

Sunday, May 12, 2013

A few Statistics: Who, Where, How

Here are this Blog stats : 

How many views until today? 
about 2300+ (on May 12th 2013, since April 21th), but not much a day : 

From where come the viewers?
Most people come from France, USA, Germany, Poland, Italy, Brazil, Russia, Malaysia, Greece and Hungary (these are the 10 first countries only)

With which Browser?

Using which Operating System?
that's all i can say, this Blog was never meant to be a Worldwide reference ( :-P ) so it does the Job it has been made for : being a simple reminder / note keeper for myself shared with anybody that could need it.

have a nice day ! 

Saturday, May 11, 2013

Linux Software, tweaks and others things

Little note about Linux 

Software, tweaks and others things i use : 

As written previously, i'm mostly using Linux Mint based OSs
here are software that i use that are not pre-installed on Mint13 Cinnamon, Mint13 Mate or Mint14 Xfce : 
Comme écrit précédemment, j'utilise majoritairement des OS basés sur Linux Mint
Voici des logiciels que j'utilise et qui ne sont pas pré-installé dans Mint13 Cinnamon, Mint13 Mate ou Mint14 Xfce : 

tweaks and related :
jupiter (for XFCE:)
Jupiter dev is stopped (source)
since Ubuntu 13.04 / Mint 15, jupiter is now available only via this unofficial ppa (source):
sudo add-apt-repository ppa:jolicloud-team/ppa
sudo apt-get update
sudo apt-get install jupiter
The problem is related to notify-send, it ignores the timeout parameter:

Jupiter uses notify-send to create the desktop notifications. As a workaround the Jupiter's notify script can be edited and all -t parameters removed:

sudo sed -i 's/-t [0-9]\+//g' /usr/lib/jupiter/scripts/notify

The notifications will be shown for a few seconds then they'll vanish.
taken from here 

psensor (with lm-sensors to be really useful / additionné de lm-sensors pour etre vraiment utile)
hddtemp (might need sudo chmod u+s /usr/sbin/hddtemp to work properly)
redshift (changer la température de l'écran pour le repos des yeux la nuit)
gtkhash (md5)
deb precise main
deb-src precise main
For Xfce it can be useful to create launchers / pour Xfce il est utile de creer des lanceurs : 

to turn the screen OFF / pour éteindre l'écran :
xset dpms force off

sleep 1 ; xset dpms force off

to launch redshift if it fails / pour lancer redshift si récalcitrant :
gtk-redshift -l lat:lon

web :

chat :
pidgin (plateforme IM multiprotocoles)

drawing/dessin :

audio :
pulse audio equalizer

games/jeux :
PPA : ppa:stk/dev

dépot :
deb RELEASE main

You can also add a deb-src line if you want.

Once that's done, download this public key then, directly as root or indirectly via sudo:
# apt-key add unvanquished-archive-key.gpg.asc
# apt-get update
# apt-get install unvanquished

Friday, May 10, 2013

New Blog Design

Template issues, and Blog main design

Due to some issues displaying the blog using Opera web browser, i decided to change the Blog's template to a more simple one.

This is why the design slightly changed, i'll work on it later in order to get the main theme back (which was simple ... i know)

I hope this time the Blog will be correctly displayed on any Browser (and not only Chrome for which it has been optimised)

The Whole Blog is under (re-)construction, and will be updated as soon as possible !

Have a nice day !