Posted by Vide on November 18, 2009
Probably this software existed for a quite long time but I didn’t know its existence ’til now: pbzip2
it’s basically a bzip2 algorithm implementation with pthreads support. This mean, in a always more SMP world, that you can greatly improve your bzipping perfomances (divide the zipping time by the number of cores you have et voilĂ !)
Compression syntax is totally compatible:
$ pbzip2 big.file
while to unzip you have to do
$ pbzip2 -d big.file.bz2
Use with caution (or with -l and -p switches) cause you can easily saturate your 4xSix-cores monster.
Posted in Linux, Performance, Tips, Unix | Tagged: copmpression, Linux, optimizations, Performance, smp, Tips, Unix | 2 Comments »
Posted by Vide on November 6, 2009
In an older post I explained how to create a bond interface in Debian Etch… now, this doesn’t work anymore due to some changes in Lenny.
So, long story short, first of all, install ifenslave
# apt-get install ifenslave-2.6
edit /etc/network/interfaces and add the bond0 config:
auto bond0
iface bond0 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.1.1
up /sbin/ifenslave bond0 eth0 eth1
down /sbin/ifenslave -d bond0 eth0 eth1
now edit /etc/modprobe.d/arch/x86_64 (change the filename depending on your architecture) and add these lines
alias bond0 bonding
options bonding mode=1 miimon=100 downdelay=200 updelay=200
Brief explanation:
- miimon N: check if the active interface(s) is alive every N milliseconds
- downdelay N: wait N milliseconds after a detected link failure to consider the link down
- updelay N: wait N milliseconds after a detected link restoration to consider the link up
- mode N: 1 means master/slave configuration, so there’s only one active master. If this link fails, then slave is used.
For a more complete description of all the possible parameters, refer to Linux Documentation/networking/bonding.txt
After this, you can restart networking or reboot if you are working remotely and it should work without a problem. It did for me :)
Posted in Debian, Howtos, Linux, Networking | Tagged: bonding, Debian, lenny, Linux, Networking | 4 Comments »
Posted by Vide on November 4, 2009
Just found out a bizarre feature of MySQL: you simply cannot create a table with a trailing space in a column name. Something like this, doesn’t work:
create table a (`a ` int);
ERROR 1166 (42000): Incorrect column name 'a '
There’s a thread in MySQL’s lists explaining it
Ok, it seems there’s a technical limitation but this solution seems like a lazy workaround to me.
The problem is with CREATE VIEW. In recent MySQL builds you cannot either create a view with a trailing space in a column name. But recent means, at least, greater than 5.0.51a, cause this version DOES let you create a view with a trailing space.
# mysql --version
mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (x86_64) using readline 5.2
mysql> create view b as select a `a ` from a;
Query OK, 0 rows affected (0.00 sec)
There’s a big problem here: 5.0.51a is the default and supported version in Debian Lenny! So, if you have Lenny as a master of a more recent MySQL installation, be careful cause a CREATE VIEW with a trailing space in a column name will break your replication. Grrrr. MySQL, I hate you, really.
Posted in Debian, Linux, Mysql, Rants | Tagged: bug, Mysql, Rants, replication | Leave a Comment »