Tag-Archive for » fast «

Wednesday, June 23rd, 2010 | Author:

eth0If you read this blog you may know I daily use puppet at $WORK. Puppet is made to maintain configuration on machines, but not for one shot actions. For a couple of month I used to work with fabric for this but It had a few drawbacks, mainly because you need to maintain the list of hosts you want to act on and that it hates dead hosts, even if ghantoos dropped a link showing how to get rid of this. So I replaced it with mcollective : not exactly the same (it uses an agent instead of SSH) but it dynamicaly knows which hosts are up, allows to filter on facts (from facter, the puppet companion).

You could think that needing an agent is a drawback but it allows much complex actions, fine grained logic. Moreover it does not require much work to be installed if you already have puppet running. If you have a high number of machines you gain scalability with real parallel actions : it does not take longer to run on 5 machines than on 100.

One more point is the active development : R.I. Pienaar released 2 versions recently, improving access control, adding DDL to create interfaces easily. You can give your unprivileged staff some power through a web interface in less than 100 lines of code.

A tool for sysadmins that appreciate the devops spirit and want to do more in less time !

I’ll be publishing my agent and related tools on my github account.

Category: BOFH Life, SysAdmin, Tech  | Tags: , , ,  | Comments off
Wednesday, February 25th, 2009 | Author:

eth0Au boulot j’ai remplacé cacti par munin. Munin c’est choupi, la conf est en flat file mais ça a deux défauts, ou un selon le point de vue : le munin-cgi-graph est tout simplement moisi car d’une lenteur sans nom, et générer les images lors du poll c’est long. Sauf quand on tombe sur ce petit hack convivial qui permet de lancer en parallèle la génération pour X nodes. Malheureusement, l’exemple donné en lien n’est valable que pour la version du trunk (au moment ou j’écris ceci) et pas pour la version 1.2.6 livrée avec lenny. J’ai donc modifié mon munin-graph en “portant” le hack disponible. Résultat : 2min30s au lieu de 9min pour la génération de 80 machines (dont certaines avec beaucoup d’infos)

Le code en question :

# Add this to munin-graph
sub myforked_processnode {
        my ($domain, $code) = @_;
 
        my $max=24;
        my $counter = 0;
 
        for my $key ( keys %{$config->{domain}->{$domain}->{node}}) {
                wait unless ++ $counter >= $max;
                #print "Processing ".$key."\n";
                die "Fork failed: $!\n" unless defined (my $pid = fork);
                exit $code -> ($domain,$key,$config->{domain}->{$domain}->{node}->{$key}) unless $pid;
        }
        1 until -1 == wait;
}
 
# Modify process_domain to get :
sub process_domain {
    my ($domain) = @_;
    myforked_processnode($domain, \&process_node);
}

Et voila !

Category: BOFH Life, SysAdmin, Tech  | Tags: , , , , ,  | 3 Comments