Seite wählen

NETWAYS Blog

Weekly Snap: Solr, gperftools & Rootkit Hunter

weekly snap2 – 6 September entered autumn with plenty of hardware and sys admin tips, as well as a follow-up OpenNebula webinar.
Blerim began by recommending Apache Solr for indexing and showed how to combine it with Zookeeper to build a SolrCloud.
Georg then gave the lowdown on our all-inclusive Icinga/Nagios voice alert packages covering Starface VoIP appliance, software and onsite setup.
He continued on a USB wave, introducing Xsensior Lite the economical temperature and humidity USB-sensor as well as USB extensions using CAT5e cables.
In the meantime, Markus looked for rootkits, backdoors and local exploits with Rootkit Hunter and Gunnar offered his alternative profiler to Valgrind – gperftools.
Finally, Christian reminded interested participants to join our first OpenNebula webinar and consoled those who missed it with a repeat webinar on 11 September.

Profiling mit gperftools

Eines der bekanntesten Profiling-Tools unter Linux ist wohl Valgrind. Valgrind instrumentiert die zu profilende Anwendung und kann so jeden einzelnen Funktionsaufruf nachverfolgen. Allerdings läuft die Anwendung dadurch um ein Vielfaches langsamer ab, als wenn sie ohne Profiling gestartet wird.
Abhilfe schaffen hier Sample-basierte Profiler wie z.B. gperftools. Anstatt jeden Funktionsaufruf mittels Instrumentierung „aufzunehmen“, erstellt gperftools in regulären Intervallen Stack-Snapshots der einzelnen Threads und erkennt so, welche Funktionen häufig aufgerufen werden.
Unter Debian kann gperftools per Paketmanager installiert werden:

# aptitude install google-perftools

Über die Environment-Variable CPUPROFILE können wir angeben, wo gperftools seine Profile-Dateien erstellen soll. Mit LD_PROFILE linken wir den Profiler zur Laufzeit in unser Programm:

$ CPUPROFILE=/tmp/profile LD_PRELOAD=/usr/lib/libprofiler.so ./bin/icinga2 -c ../master.conf

Mit google-pprof kann anschließend die Profile-Datei angezeigt werden:

$ google-pprof ./bin/icinga2 /tmp/profile