martes, 11 de noviembre de 2008

Acelerando el Booteo

Leyendo el blog de mi amigo Agustin encontre una herramienta excelente como para depurar el proceso de arranque. Decidi probar cuanto podia mejorar el arranque de mi laptop (Acer Aspire 3003 LCi), aunque nunca lo habia cronometrado.
La herramienta en cuestion es bootchart
El proceso de instalacion en ubuntu no fue mas que:

pelin@valkyria:~$ sudo apt-get install bootchart


Una vez instalado reinicio la pc. Genera los graficos y los guarda en /var/log/bootchart con la fecha y hora.
Yo obtuve:




En el siguiente intento, depues de dar de baja algunas cosas que no utilizaba mejoro un poco y obtuve el grafico siguiente:



Mejora sustancial, decido una vez bajar algunas otras cosas y obtengo:


Listado de servicios que di de baja:
  • apache2 (cuando necesite el web server lo levanto)
  • nvidia-kernel (no se que hace instalado si no tengo esa placa de video...pero es parte del kernel :( )
  • vboxdrv (virtualbox)
  • apparmor
  • cupsys (cuando quiera imprimir lo arranco y listo)
  • avahi-daemon (solo tengo dos pc's en mi casa, no lo necesito)
  • clamav-freshclam (actualizacion de la base de datos de clamav)
  • vmware (cuando necesite levantar las maquinas virtuales lo arranco)
  • motion
  • winbind
  • y le saque la opcion splash del grub
Aca estaba bastante conforme con la mejora, pero la codicia pudo mas y busque alguna manera de bajar algunos segundos mas y encontre las siguientes tips, en particular copio los que utilice:

2. Run boot processes in parallel
This will make upstart to run the boot processes in parallel and speed up the boot process.
sudo kate /etc/init.d/rc
Find and change the line:
CONCURRENCY=none
to:
CONCURRENCY=shell

6. Swappiness
The default value for vm.swappiness is 60 in Ubuntu Feisty whic is a good default value but if you want to tweak the performance a little bit more you can change this value to a lower value to reduce the load of the swap. If you run the follwing command:
sysctl -q vm.swappiness
You will se that the value is set to 60. And by running:
sudo sysctl vm.swappiness=10
You will change the value from 60 to 10 which will make your system write to swap a lot less and I would recommend this to everyone that has 512 mb of memory or more. If you find that you have very little use of swap set the value to 0. This will not disable the swap but it will make your system write to the swap as little as possible and keep as much as possible in memory. This makes a huge improvment when switching between applications since they are now likley to be in physical ram instead of on the swap partition.

To set your value permanent you need to change the sysctl.conf file:
sudo kate /etc/sysctl.conf
Add the line
vm.swappiness=10
To the end of the file. This way it will be set upon boot.

I’ve found that the value of 5 works very good for my use and I have 1 GB of memory.

En mi caso esa entrada no existia, asi que la agregue y setee el valor a 5.

Por ahi encontre que la herramienta sysv-rc-conf ayudaria, pero solo es una interfaz ncurses para dar de baja demonios que arrancan con el sistema.

Para probarlo basta con

sudo apt-get install sysv-rc-conf
sudo sysv-rc-conf

Reinicio la pc y obtuve una leve mejora con la cual me quedo tranquilo.



Pero ojo!, hasta que obtengo mi escritorio totalmente cargado pasan casi 85 segundos.
Cuando ya se ha encontrado la configuracion optima se puede deshabilitar el bootchart con el comando:
sudo update-rc -f  stop-bootchart remove

No hay comentarios: