martes, 14 de septiembre de 2010

Centos 5.x: MySQL Tools

Vamos viendo que herramientas podemos usar para saber el desempeño de MySQL, vamos empezando por: msqlreport.

Lo bajamos del site: http://hackmysql.com/mysqlreport

Descomprimimos y empezamos a trabajar sobre el:

#./mysqlreport
./mysqlreport
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at (eval 7) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge.
at ./mysqlreport line 249

Bien, vamos a ver necesitamos instalar los siguientes paquetes antes de continuar:

yum install perl-DBD-mysql

Ahora ejecutamos ahora si el programa con los parametros del servidor:

./mysqlreport --user username --password mipassword

Use of uninitialized value in multiplication (*) at ./mysqlreport line 829.
Use of uninitialized value in formline at ./mysqlreport line 1227.
MySQL 5.1.50-community- uptime 0 6:19:10 Tue Sep 14 23:30:32 2010

__ Key _________________________________________________________________
Buffer used 28.00k of 384.00M %Used: 0.01
Current 71.85M %Usage: 18.71
Write hit 35.75%
Read hit 94.88%

__ Questions ___________________________________________________________
Total 3.05k 0.1/s
Com_ 1.64k 0.1/s %Total: 53.82
QC Hits 630 0.0/s 20.66
DMS 458 0.0/s 15.02
COM_QUIT 327 0.0/s 10.72
-Unknown 7 0.0/s 0.23
Slow 10 s 1 0.0/s 0.03 %DMS: 0.22 Log: OFF
DMS 458 0.0/s 15.02
SELECT 395 0.0/s 12.96 86.24
INSERT 33 0.0/s 1.08 7.21
DELETE 27 0.0/s 0.89 5.90
UPDATE 2 0.0/s 0.07 0.44
REPLACE 1 0.0/s 0.03 0.22
Com_ 1.64k 0.1/s 53.82
set_option 611 0.0/s 20.04
show_tables 232 0.0/s 7.61
change_db 192 0.0/s 6.30

Scan 719 0.0/s %SELECT: 182.03
Range 0 0/s 0.00
Full join 0 0/s 0.00
Range check 0 0/s 0.00
Full rng join 0 0/s 0.00
Sort scan 18 0.0/s
Sort range 0 0/s
Sort mrg pass 0 0/s

__ Query Cache _________________________________________________________
Memory usage 165.27k of 32.00M %Used: 0.50
Block Fragmnt 1.70%
Hits 630 0.0/s
Inserts 197 0.0/s
Insrt:Prune 197:1 0.0/s
Hit:Insert 3.20:1

__ Table Locks _________________________________________________________
Waited 0 0/s %Total: 0.00
Immediate 536 0.0/s

__ Tables ______________________________________________________________
Open 35 of 512 %Cache: 6.84
Opened 51 0.0/s

__ Connections _________________________________________________________
Max used 4 of 151 %Max: 2.65
Total 329 0.0/s

__ Created Temp ________________________________________________________
Disk table 143 0.0/s
Table 687 0.0/s Size: 16.0M
File 5 0.0/s

__ Threads _____________________________________________________________
Running 1 of 1
Cached 3 of 8 %Hit: 98.78
Created 4 0.0/s
Slow 0 0/s

__ Aborted _____________________________________________________________
Clients 0 0/s
Connects 10 0.0/s

__ Bytes _______________________________________________________________
Sent 1.80M 79.3/s
Received 245.42k 10.8/s

__ InnoDB Buffer Pool __________________________________________________
Usage 304.00k of 8.00M %Used: 3.71
Read hit 84.42%
Pages
Free 493 %Total: 96.29
Data 19 3.71 %Drty: 0.00
Misc 0 0.00
Latched 0.00
Reads 77 0.0/s
From file 12 0.0/s 15.58
Ahead Rnd 1 0.0/s
Ahead Sql 0 0/s
Writes 0 0/s
Flushes 0 0/s
Wait Free 0 0/s

__ InnoDB Lock _________________________________________________________
Waits 0 0/s
Current 0
Time acquiring
Total 0 ms
Average 0 ms
Max 0 ms

__ InnoDB Data, Pages, Rows ____________________________________________
Data
Reads 25 0.0/s
Writes 3 0.0/s
fsync 3 0.0/s
Pending
Reads 0
Writes 0
fsync 0

Pages
Created 0 0/s
Read 19 0.0/s
Written 0 0/s

Rows
Deleted 0 0/s
Inserted 0 0/s
Read 0 0/s
Updated 0 0/s

Le toca el turno a mysqltuner, lo bajamos de:

http://blog.mysqltuner.com/

Lo ponemos en modo script:

chmod +x mysqltuner.pl

./mysqltuner.pl

>> MySQLTuner 1.0.1 - Major Hayden
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password:

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.1.50-community-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 924B (Tables: 9)
[!!] InnoDB is enabled but isn't being used
[OK] Total fragmented tables: 0

-------- Performance Metrics -------------------------------------------------
[--] Up for: 15m 18s (28 q [0.031 qps], 15 conn, TX: 26K, RX: 1K)
[--] Reads / Writes: 100% / 0%
[--] Total buffers: 1.4G global + 12.4M per thread (151 max threads)
[!!] Maximum possible memory usage: 3.3G (167% of installed RAM)
[!!] Slow queries: 10% (3/28)
[OK] Highest usage of available connections: 0% (1/151)
[OK] Key buffer size / total MyISAM indexes: 384.0M/120.0K
[!!] Query cache efficiency: 0.0% (0 cached / 14 selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 1 sorts)
[OK] Temporary tables created on disk: 0% (0 on disk / 8 total)
[OK] Thread cache hit rate: 93% (1 created / 15 connections)
[OK] Table cache hit rate: 82% (32 open / 39 opened)
[OK] Open file limit used: 5% (68/1K)
[OK] Table locks acquired immediately: 100% (18 immediate / 18 locks)
[!!] Connections aborted: 13%

-------- Recommendations -----------------------------------------------------
General recommendations:
Add skip-innodb to MySQL configuration to disable InnoDB
MySQL started within last 24 hours - recommendations may be inaccurate
Reduce your overall MySQL memory footprint for system stability
Your applications are not closing MySQL connections properly
Variables to adjust:
*** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
query_cache_limit (> 1M, or use smaller result sets)

Ahora le toca a innotop este lo bajamos de:

http://code.google.com/p/innotop/downloads/list

Descomprimimos y vemos que necesitamos:

perl Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite Term::ReadKey 2.1 not found.
Writing Makefile for innotop

Necesitamos instalar:

yum install perl-TermReadKey

Ahora si lo instalamos:

make install
cp innotop blib/script/innotop
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/innotop
Manifying blib/man1/innotop.1
Installing /usr/share/man/man1/innotop.1
Installing /usr/bin/innotop
Writing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/innotop/.packlist
Appending installation info to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod

Probando:

innotop --u root --password mi-password

When Load QPS Slow QCacheHit KCacheHit BpsIn BpsOut
Total 0.00 0.12 0 42.86% 100.00% 5.27 82.19

Cmd ID State User Host DB Time Query
Daemon 1 Waiting on empty q event_sc localhost 14:31

Listo.

Ahora le toca el turno a mysqlsla, este lo bajamos de:

http://hackmysql.com/mysqlsla

Lo mismo, descomprimimos y a instalar, leer el INSTALL ee.

perl Makefile.PL
Checking if your kit is complete...
Looks good

make
cp lib/mysqlsla.pm blib/lib/mysqlsla.pm
cp bin/mysqlsla blib/script/mysqlsla
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/mysqlsla
Manifying blib/man3/mysqlsla.3pm

make install
Installing /usr/lib/perl5/site_perl/5.8.8/mysqlsla.pm
Installing /usr/share/man/man3/mysqlsla.3pm
Installing /usr/bin/mysqlsla
Writing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/mysqlsla/.packlist
Appending installation info to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod

Probamos:

mysqlsla --log-type slow
Report for slow logs:
0 queries total, 0 unique
Sorted by 't_sum'
Grand Totals: Time 0 s, Lock 0 s, Rows sent 0, Rows Examined 0

Aun no tenemos nada listo, pero ahi esta corriendo.

Otro mas mytop y mtop.

super-smack.

Debemos copear el archivo /usr/share/smack/select-key.smack ahi mismo con el nombre select-key-mysql.smack.

Editarlo a nuestros parametros.

Y por ejemplo ejecutarlo asi:

super-smack -d mysql select-key-mysql.smack 10 1000

Query Barrel Report for client smacker1
connect: max=203ms min=0ms avg= 43ms from 10 clients
Query_type num_queries max_time min_time q_per_s
select_index 20000 0 0 38950.44

Aqui genera una tabla myisam.

Le toca el turno a sysbench, Centos 5.5 tiene la 0.4.10, del sitio podemos descargar la 0.4.12, es lo que vamos hacer e instalar.

Leyendo el INSTALL del src dice que debemos hacer esto:

1; Desempaquetar el archivo .tar.gz.
2; Entrar a el directorio creado.
3; Ejecutar:
./configure
4; Ejecutar
make ---->Pero antes de instalar libtool,autocof,gcc,gcc-c++ con yum.
5; make install

Listo ya tenemos a sysbench operable.

Vamos a generar una tabla de nombre sbtest como dice el manual con




lunes, 13 de septiembre de 2010

FreeBSD 8.x: Modulo coretemp

Tengo problemas con un servidor supermicro 1U que tiene un Xeon dual core CPU: Intel(R) Xeon(R) CPU E3110 @ 3.00GHz (2999.68-MHz K8-class CPU).

Este servidor tiene la funcion de spam filter. Sus uptimes no han sido revasados:

bsdsar
Time % User % Sys % Nice % Intrpt % Idle
00:00 0 0 0 0 100
01:00 0 0 0 0 100
02:00 0 0 0 0 100
03:00 0 0 0 0 100
04:00 0 0 0 0 100
05:00 0 0 0 0 100
06:00 0 1 0 0 99
07:00 0 0 0 0 100
08:00 0 0 0 0 100
08:45 0 0 0 0 100
08:50 0 0 0 0 100
08:55 0 0 0 0 100
09:00 0 0 0 0 100
09:45 0 0 0 0 100
09:50 0 0 0 0 100
09:55 0 0 0 0 100
10:00 0 0 0 0 100
10:45 0 0 0 0 100
10:50 0 0 0 0 100
10:55 0 0 0 0 100
11:00 0 0 0 0 100
11:45 0 0 0 0 100
11:50 0 0 0 0 100
11:55 0 0 0 0 100
12:00 0 0 0 0 100
12:45 0 0 0 0 100
12:50 0 0 0 0 100
12:55 0 0 0 0 100
13:00 0 0 0 0 99
13:45 3 4 0 0 94
13:50 3 3 0 0 94
13:55 2 4 0 0 94
14:00 3 3 0 0 94

Por alguna razon turbia se me congela cada 2 o 3 semanas, no es nuevo pero quiero pensar que algo hace que se caliente y le pase esto, la desventaja es que no lo tengo en mi oficina, sino en las oficinas centrales que solo visito 1 vez a la semana.

Solo una vez me toco estar presente cuando se congelo, cuando entre a el cuarto de servidores los abanicos estaban trabajando al maximo parecia que iba a despejar, el teclado no respondia, asi que no tuve otra manera mas sana de resetearlo que de botonazo, lo que nunca se debe hacer.

Bien en cuanto lo hice, los abanicos empezaron a trabajar de manera normal, se reinicio el servidor y el raid-1 no sufrio dano alguno.

Los servidores cada vez son mas inteligentes y tienen mas electronica integrada, ellos mismos balancean la velocidad de los abanicos de acuerdo a la temperatura del nucleo, la gran desventaja que siempre hacen las aplicaciones encargadas o para windows o para linux redhat.

Los otros como el caso de FreeBSD no tiene esas comodidades, por ello los programadores tienen que hacer utilerias que hagan estas tareas.

Para esto alguien en el foro de freebsd comento del modulo coretemp:

man coretemp
CORETEMP(4) FreeBSD Kernel Interfaces Manual CORETEMP(4)

NAME
coretemp -- device driver for Intel Core on-die digital thermal sensor

SYNOPSIS
To compile this driver into the kernel, place the following line in your
kernel configuration file:

device coretemp

Alternatively, to load the driver as a module at boot time, place the
following line in loader.conf(5):

coretemp_load="YES"

DESCRIPTION
The coretemp driver provides support for the on-die digital thermal sen-
sor present in Intel Core and newer CPUs.

The coretemp driver reports each core's temperature through a sysctl node
in the corresponding CPU device's sysctl tree, named
dev.cpu.%d.temperature.

SEE ALSO
sysctl(8)

HISTORY
The coretemp driver first appeared in FreeBSD 7.0.

AUTHORS
The coretemp driver was written by Rui Paulo as part
of a Google Summer of Code project. This manual page was written by
Dag-Erling Smorgrav .

FreeBSD 8.0 August 23, 2007 FreeBSD 8.0

Preguntando me comentaron que aplica a los chips nuevos, en mi caso parece que Xeon es parte de ellos, aqui un ejemplo de mi salida:

sysctl -a | grep temperature
dev.cpu.0.temperature: 41.0C
dev.cpu.1.temperature: 40.0C

Ahora necesito un script que me mande cada 5 minutos un correo con la temperatura actual, asi podre saber si en realidad la temperatura del cpu este llegando a un nivel que provoca esto, tengo que dar con el problema, este es el script con cron:

#crontab -e
*/5 * * * * /sbin/sysctl -a | grep temperature | mail -s "Temperatura Actual" root

Esto es lo que me llega:

Subject: Temperatura Actual

dev.cpu.0.temperature: 41.0C
dev.cpu.1.temperature: 40.0C

No soy un experto en scripts, pero ya vere como hacerle para que cuando llegue a cierta temperatura me mande un aviso de "Peligro" y prevenir que se congele el equipo.

Para activar este modulo tenemos 2 opciones o lo incluimos en el kernel o lo cargamos como modulo, yo prefiero lo 1ro.

device coretemp

Hacen todos los pasos para compilar el kernel, instalarlo y arrancarlo.

O si prefieren lo segundo, abren el /boot/loader.conf y agregan esta linea:

coretemp_load="YES"

Esto es para que cada que reinicien se cargue el modulo, si lo quieren cargar en tiempo real ya saben besederos:

kldload coretemp

Listo.

Si existen mas maneras de llevar a cabo esto me avisan!!!

lunes, 6 de septiembre de 2010

FreeBSD 7/8: apache cgi-bin test

Necesitamos correr unos cgi-bin para apcupsd en FreeBSD, segun husmeando el directorio de apache tenemos esto:

/usr/local/www/apache22/cgi-bin

Ahi aparecen 2 archivos de prueba:
  • printenv
  • test-cgi
Ahora si nos vamos aun navegador a ejecutarlos nos dice que:

****************************************************************

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

****************************************************************

Bien vamos viendo que dicen los logs de apache:

[Mon Sep 06 11:58:59 2010] [error] [client 192.168.90.31] (13)Permission denied: exec of '/usr/local/www/apache22/cgi-bin/printenv' failed
[Mon Sep 06 11:58:59 2010] [error] [client 192.168.90.31] Premature end of script headers: printenv

mmmm permiso denegado, ahora los archivos cgi-bin son alfinal de cuentas scripts hechos por lo comun en perl.

Vamos dondo los permisos de ejecucion como cualquier script perl, bash, sh, etc.

chmod +x test-cgi

Probamos:

CGI/1.0 test script report:

argc is 0. argv is .

SERVER_SOFTWARE = Apache/2.2.16 (FreeBSD) mod_ssl/2.2.16 OpenSSL/0.9.8e DAV/2 PHP/5.3.3 with Suhosin-Patch
SERVER_NAME = 192.168.90.3
GATEWAY_INTERFACE = CGI/1.1
SERVER_PROTOCOL = HTTP/1.1
SERVER_PORT = 80
REQUEST_METHOD = GET
HTTP_ACCEPT = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
PATH_INFO =
PATH_TRANSLATED =
SCRIPT_NAME = /cgi-bin/test-cgi
QUERY_STRING =
REMOTE_HOST =
REMOTE_ADDR = 192.168.90.31
REMOTE_USER =
AUTH_TYPE =
CONTENT_TYPE =
CONTENT_LENGTH =

Listo, ya se que puedo crear mis scripts y subirlos a mi servidor, saludos!!!

sábado, 28 de agosto de 2010

FreeBSD 7/8: Raid-1 agregando otro Raid-1

Buenas tardes, tengo un caso particular, mi servidor de respaldo tiene una cinta StorageWorks 232 SCSI externa que trono.

Ahi hacia mis Full backups con bacula, los respaldos diferenciales los hacia en disco, usando compresion en disco nos ahorramos muchos espacio.

Bien el problema es que estamos hablando de aprox. 140GB sin comprimir de datos, a lo mucho se alojan en 80GB, el disco duro no me da mucho espacio, y me es mas dificil reinstalar todo ya que el tiempo no me lo permite, necesito agregar mas discos ya que la placa madre me permite 4 en total, 2 ya los tengo en Raid-1 con gmirror.

Necesito agregarle 2 mas para hacer otro arreglo dentro del mismo servidor, mi duda era si era posible hacerlo, investigando esto, no hay limites con gmirror, podemos tener N numero de arreglos corriendo.

gm0, gm1, gm3, etc. Entonces vamos empezando.

Vamos a agregar 2 disco mas a el servidor, para esto apagamos el equipo, metemos los discos y comprobamos que el BIOS los detecte.

Una vez hecho esto, arrancancamos el servidor de nuevo y ahora verificar que arranque y que todos los servicios este operando sin problemas.

Como recomendacion, marquen los discos, nunca cambien de pocision los discos, es decir si tenemos el servidor con raid1 usando 2 discos y tenemos por asi decirlo:

sata-0 disco-1
sata 1 disco-2

Nunca cambien esta pocision, marquen los discos, creanme a veces uno se le pasan estos detalles y cuando arrancamos el sistema freebsd no tiene manera de detectar estos cambios y el solo abre el fstab para montar las particiones y nomas imagienese lo que pasa.

Bien, ahora que nuestro sistema esta operando, nuestros raid-1 que tenemos operando, vamos creando el otro raid-1.

sata-2 disco-3 /dev/ad5
sata-3 disco-4 /dev/ad7

Vamos empezando por ad5:

gmirror label -vb round-robin gm1 /dev/ad5

Metadata value stored on /dev/ad5.
Done.
Por que gm1? Bien el sistema ya tiene un sistema en operacion con Raid-1 y estamos usando gm0 por eso el que sigue.

Modficamos nuestro /etc/fstab quedando asi:

# Device Mountpoint FStype Options Dump Pass#
/dev/mirror/gm0s1b none swap sw 0 0
/dev/mirror/gm0s1a / ufs rw 1 1
/dev/mirror/gm0s1g /backups ufs rw,noatime 2 2
/dev/mirror/gm0s1f /tmp ufs rw 2 2
/dev/mirror/gm0s1d /usr ufs rw,noatime 2 2
/dev/mirror/gm0s1e /var ufs rw,noatime 2 2
/dev/mirror/gm1s1d /bacula ufs rw,noatime 2 2
/dev/acd0 /cdrom cd9660 ro,noauto 0 0

El marcado es el nuevo, debemos crear el directorio especifico antes de seguir. Una sola particion para este arreglo.

Una vez modificado el archivo es hora de reiniciar el servidor para que arranque el nuevo arreglo de discos.

Ya que reinicio el sistema, y no hubo problema alguna, que yo nunca los he tenido, procedemos a agregar el 2do disco a el arreglo.

# gmirror insert gm1 /dev/ad7

Nos aparece esto en la consola:

GEOM_MIRROR: Device gm1: rebuilding provider ad7.

Ya que termina el proceso de espejeo nos arroja la consola:

GEOM_MIRROR: Device gm1: rebuilding provider ad7 finished.

Verificamos el estatus:

gmirror status
Name Status Components
mirror/gm0 COMPLETE ad4
ad6
mirror/gm1 COMPLETE ad5
ad7

Todos los arreglos arriba, ahora con mas detalles:

gmirror list
Geom name: gm0
State: COMPLETE
Components: 2
Balance: round-robin
Slice: 4096
Flags: NONE
GenID: 0
SyncID: 1
ID: 707216250
Providers:
1. Name: mirror/gm0
Mediasize: 320072932864 (298G)
Sectorsize: 512
Mode: r6w6e7
Consumers:
1. Name: ad4
Mediasize: 320072933376 (298G)
Sectorsize: 512
Mode: r1w1e1
State: ACTIVE
Priority: 0
Flags: NONE
GenID: 0
SyncID: 1
ID: 1536139089
2. Name: ad6
Mediasize: 320072933376 (298G)
Sectorsize: 512
Mode: r1w1e1
State: ACTIVE
Priority: 0
Flags: NONE
GenID: 0
SyncID: 1
ID: 485083827

Geom name: gm1
State: COMPLETE
Components: 2
Balance: round-robin
Slice: 4096
Flags: NONE
GenID: 0
SyncID: 1
ID: 4278214118
Providers:
1. Name: mirror/gm1
Mediasize: 320072932864 (298G)
Sectorsize: 512
Mode: r1w1e3
Consumers:
1. Name: ad5
Mediasize: 320072933376 (298G)
Sectorsize: 512
Mode: r1w1e1
State: ACTIVE
Priority: 0
Flags: NONE
GenID: 0
SyncID: 1
ID: 1107909587
2. Name: ad7
Mediasize: 320072933376 (298G)
Sectorsize: 512
Mode: r1w1e1
State: ACTIVE
Priority: 0
Flags: NONE
GenID: 0
SyncID: 1
ID: 3972170277

Listo todo operando normalmente!!

viernes, 27 de agosto de 2010

Centos 5x: Benchamark Tools.

Empezando a probar Xen 3.0 que viene por default con Centos 5.5, la 1ra maquina virtual tiene 5 GB de ram disco duro 30 GB.

Las maquinas virtuales las tengo dentro de la particion /opt del Dom-O en Raid-5.
el servidor tiene un Raid-1 para su operacion asi que vamos empezando a ver numeros de Raid-1 vs Raid-5 en el mismo servidor.

1er herramienta

unixbench: yum la localizo pero no di como usarla, asi que mejor la baje del sitio:

http://code.google.com/p/byte-unixbench/

1er corrida:

Checking distribution of files
./pgms exists
./src exists
./testdir exists
./tmp exists
./results exists
make[1]: Leaving directory `/usr/app/bench/unixbench-5.1.2'
sh: 3dinfo: command not found

Version 5.1.2 Based on the Byte Magazine Unix Benchmark

Multi-CPU version Version 5 revisions by Ian Smith,
Sunnyvale, CA, USA
December 22, 2007 johantheghost at yahoo period com

1 x Dhrystone 2 using register variables 1 2 3
1 x Double-Precision Whetstone 1 2 3 4 5 6 7 8 9 10
1 x Execl Throughput 1 2 34 5 6 7 8 9 10
1 x File Copy 1024 bufsize 2000 maxblocks 1 2 3
1 x File Copy 256 bufsize 500 maxblocks 1 2 3
1 x File Copy 4096 bufsize 8000 maxblocks 1 2 3
1 x Pipe Throughput 1 2 3 4 5 6 7 8 9
1 x Process Creation 1 2 3
1 x System Call Overhead 1 2 3 4 5 6 7 8 9
1 x Shell Scripts (1 concurrent) 1 2 3
1 x Shell Scripts (8 concurrent) 1 2 3
2 x Dhrystone 2 using register variables 1 2 3 4 5 6 7 8 9 10
2 x Double-Precision Whetstone 1 2 3 4 5 6 7 8 9 10
2 x Execl Throughput 1 2 3
2 x File Copy 1024 bufsize 2000 maxblocks 1 2 3
2 x File Copy 256 bufsize 500 maxblocks 1 2 3
2 x File Copy 4096 bufsize 8000 maxblocks 1 2 3
2 x Pipe Throughput 1 2 3 4 5 6 7 8 9 10
2 x Pipe-based Context Switching 1 2 3 4 5 6 7 8
2 x Process Creation 1 2 3
2 x System Call Overhead 1 2 3 4 5 6 7 8 9 10
2 x Shell Scripts (1 concurrent) 1 2 3
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSCALL/SYSRET
CPU 1: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz (5987.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSCALL/SYSRET
16:22:15 up 1 day, 20 min, 1 user, load average: 0.00, 1.32, 2.32; runlevel 3

------------------------------------------------------------------------
Benchmark Run: Fri Aug 27 2010 16:22:15 - 16:50:38
2 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables 14343571.7 lps (10.0 s, 7 samples)
Double-Precision Whetstone 2706.6 MWIPS (9.5 s, 7 samples)
Execl Throughput 1103.3 lps (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 286790.7 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 68804.2 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 692436.7 KBps (30.0 s, 2 samples)
Pipe Throughput 390738.9 lps (10.0 s, 7 samples)
Pipe-based Context Switching 108240.3 lps (10.0 s, 7 samples)
Process Creation 3412.8 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 2697.0 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 742.3 lpm (60.1 s, 2 samples)
System Call Overhead 486911.1 lps (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 14343571.7 1229.1
Double-Precision Whetstone 55.0 2706.6 492.1
Execl Throughput 43.0 1103.3 256.6
File Copy 1024 bufsize 2000 maxblocks 3960.0 286790.7 724.2
File Copy 256 bufsize 500 maxblocks 1655.0 68804.2 415.7
File Copy 4096 bufsize 8000 maxblocks 5800.0 692436.7 1193.9
Pipe Throughput 12440.0 390738.9 314.1
Pipe-based Context Switching 4000.0 108240.3 270.6
Process Creation 126.0 3412.8 270.9
Shell Scripts (1 concurrent) 42.4 2697.0 636.1
Shell Scripts (8 concurrent) 6.0 742.3 1237.1
System Call Overhead 15000.0 486911.1 324.6
========
System Benchmarks Index Score 512.5

------------------------------------------------------------------------
Benchmark Run: Fri Aug 27 2010 16:50:38 - 17:19:11
2 CPUs in system; running 2 parallel copies of tests

Dhrystone 2 using register variables 28935337.8 lps (10.0 s, 7 samples)
Double-Precision Whetstone 5738.3 MWIPS (9.9 s, 7 samples)
Execl Throughput 2739.5 lps (29.5 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 193524.2 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 51916.1 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 670978.9 KBps (30.1 s, 2 samples)
Pipe Throughput 888673.8 lps (10.0 s, 7 samples)
Pipe-based Context Switching 222862.6 lps (10.0 s, 7 samples)
Process Creation 4855.8 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 5452.4 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 794.9 lpm (60.1 s, 2 samples)
System Call Overhead 946134.2 lps (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 28935337.8 2479.5
Double-Precision Whetstone 55.0 5738.3 1043.3
Execl Throughput 43.0 2739.5 637.1
File Copy 1024 bufsize 2000 maxblocks 3960.0 193524.2 488.7
File Copy 256 bufsize 500 maxblocks 1655.0 51916.1 313.7
File Copy 4096 bufsize 8000 maxblocks 5800.0 670978.9 1156.9
Pipe Throughput 12440.0 888673.8 714.4
Pipe-based Context Switching 4000.0 222862.6 557.2
Process Creation 126.0 4855.8 385.4
Shell Scripts (1 concurrent) 42.4 5452.4 1286.0
Shell Scripts (8 concurrent) 6.0 794.9 1324.8
System Call Overhead 15000.0 946134.2 630.8
========
System Benchmarks Index Score 776.7

maatkit.

Nos pide:

error: Failed dependencies:
perl(DBD::mysql) >= 1.0 is needed by maatkit-6839-1.noarch igual a perl-DBD-mysql
perl(Term::ReadKey) >= 2.10 is needed by maatkit-6839-1.noarch igual a
perl-TermReadKey

Listo con esto ya podemos instalarlo.

sysbench

Este ya viene listo de los repos, asi que un yum y listo.

Esta herramienta si es bien usando para probar el desempeño de MySQL, nosotros para iniciar vamos crear
2 bases de datos, una para el engine myisam y la otra para innodb:

sbmyisam
sbinnodb

Nos vamos a la consola de MySQL y las creamos:


mysql> create database sbmyisam;
Query OK, 1 row affected (0.00 sec)


mysql> create database sbinnodb;
Query OK, 1 row affected (0.00 sec)

Listo, lo que sigue es cargarla de datos con sysbench, vamos iniciando por Myisam, para esto nos tenemos que salir de la consola de mysql e irnos a nuestra consola.

Vamos a cargarle 100,000 registros:

sysbench --test=oltp --db-driver=mysql --mysql-db=sbmyisam --mysql-table-engine=myisam --mysql-host=127.0.0.1 --mysql-user=root --mysql-password=mysql --mysql-table-engine=myisam --oltp-table-size=100000 --mysql-socket=/var/run/mysqld/mysqld.pid prepare
sysbench 0.4.10:  multi-threaded system evaluation benchmark

Creating table 'sbtest'...
Creating 100000 records in table 'sbtest'...

El password es ficticio, ustedes ahi pongan el que esten usando, ahora viene para innodb:

sysbench --test=oltp --db-driver=mysql --mysql-db=sbinnodb --mysql-table-engine=innodb --mysql-host=127.0.0.1 --mysql-user=root --mysql-password=mysql --mysql-table-engine=myisam --oltp-table-size=100000 --mysql-socket=/var/run/mysqld/mysqld.pid prepare
sysbench 0.4.10:  multi-threaded system evaluation benchmark

Creating table 'sbtest'...
Creating 100000 records in table 'sbtest'...

En ambos casos crea la tabla con el mismo nombre "sbtest".

Corroboramos que ambas BD tenga los 10,000 registros creados:


mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| sbinnodb           |
| sbmyisam           |
| test               |
+--------------------+
5 rows in set (0.00 sec)

mysql> use sbmyisam;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select count(*) from sbtest;
+----------+
| count(*) |
+----------+
|   100000 |
+----------+
1 row in set (0.00 sec)

mysql> use sbinnodb;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select count(*) from sbtest;
+----------+
| count(*) |
+----------+
|   100000 |
+----------+
1 row in set (0.00 sec)

Ahi los tenemos en cada una.




jueves, 12 de agosto de 2010

FreeBSD 7/8: Error en Cinta.

Tengo un problema con la cinta, me aparece este error cuand quiero trabajar con ella:

mbx-bacula# mt -f /dev/nsa0 rewind
mbx-bacula# mt -f /dev/nsa0 weof
mt: /dev/nsa0: weof: Input/output error

Informacion del error:

mbx-bacula# tail messages
Aug 12 18:02:54 mbx-bacula kernel: (sa0:sym0:0:3:0): Medium format corrupted
Aug 12 18:02:54 mbx-bacula kernel: (sa0:sym0:0:3:0): Retries Exhausted
Aug 12 18:09:10 mbx-bacula kernel: (sa0:sym0:0:3:0): WRITE FILEMARKS(6). CDB: 10 0 0 0 1 0
Aug 12 18:09:10 mbx-bacula kernel: (sa0:sym0:0:3:0): CAM Status: SCSI Status Error
Aug 12 18:09:10 mbx-bacula kernel: (sa0:sym0:0:3:0): SCSI Status: Check Condition
Aug 12 18:09:10 mbx-bacula kernel: (sa0:sym0:0:3:0): MEDIUM ERROR info:1 asc:c,0
Aug 12 18:09:10 mbx-bacula kernel: (sa0:sym0:0:3:0): Write error
Aug 12 18:09:10 mbx-bacula kernel: (sa0:sym0:0:3:0): Retries Exhausted
Aug 12 18:32:45 mbx-bacula kernel: sym0:3:control msgout: 80 6.
Aug 12 18:33:47 mbx-bacula kernel: sym0:3:control msgout: 80 6.

Que nos dice la cinta?
mt -f /dev/nsa0 errstat
Last I/O Residual: 0
Last I/O Command: 08 00 00 FC 00 00 00 00 00 00 00 00 00 00 00 00
Last I/O Sense:

F0 00 03 00 00 FC 00 10 00 00 00 00 14 00 00 00
50 90 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Last Control Residual: 0
Last Control Command: 10 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
Last Control Sense:

F0 00 03 00 00 00 01 10 00 00 00 00 0C 00 00 00
75 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 00.

Vamos a ver qeue nos dice HP.

viernes, 6 de agosto de 2010

Centos 5.x Tips

Enviroment:

Agregar una variable global a el sistema:

export nombre_var="valor asignado"

Listo!!!