Archive for the ‘Operations’ Category
Apache Hadoop Get Together Berlin
We would like to announce the December-2009 Hadoop Get Together in newthinking store Berlin.
When: 16. December 2009 at 5:00pm
Where: newthinking store, Tucholskystr. 48, Berlin, Germany
As always there will be slots of 20min each for talks on your Hadoop topic. After each talk there will be a lot time to discuss. You can order drinks directly at the bar in the newthinking store. If you like, you can order pizza. We will go to Cafe Aufsturz after the event for some beer and something to eat.
Talks scheduled so far:
Richard Hutton (nugg.ad): “Moving from five days to one hour.” – This talk explains how we made data processing scalable at nugg.ad. The company’s core business is online advertisement targeting. Our servers receive 10,000 requests per second resulting in data of 100GB per day.
As the classical data warehouse solution reached its limit, we moved to a framework built on top of Hadoop to make analytics speedy, data mining detailed and all of our lives easier. We will give an overview of our solution involving file system structures, scheduling, messaging and programming languages from the future.
Jörg Möllenkamp (Sun): “Hadoop on Sun”
Abstract: Hadoop is a well known technology inside of Sun. This talk want to show some interesting use cases of Hadoop in conjunction with Sun technologies. The first show case wants to demonstrate how Hadoop can used to load massive multicore system with up to 256 threads in a single system to the max. The second use case shows how several mechanisms integrated in Solaris can ease the deployment and operation of Hadoop even in non-dedicated environments. The last usecase will show the combination of the Sun Grid Engine and Hadoop. Talk may contain command-line demonstrations ;).
Nikolaus Pohle (nurago): “M/R for MR – Online Market Research powered by Apache Hadoop. Enable consultants to analyze online behavior for audience segmentation, advertising effects and usage patterns.”
We would like to invite you, the visitor to also tell your Hadoop story, if you like, you can bring slides – there will be a beamer. Thanks for Isabel Drost who is organizing this event and for Newthinking Store for providing Space. VZnet Netzwerke is sponsoring the video recording of the talks.
Registration:
Serving objects is more than plain delivery
On April 26th 2007 Steve Souders wrote:
The user’s proximity to your web server has an impact on response times. Deploying your content across multiple, geographically dispersed servers will make your pages load faster from the user’s perspective. [...] Remember that 80-90% of the end-user response time is spent downloading all the components in the page: images, stylesheets, scripts, Flash, etc. [...] A content delivery network (CDN) is a collection of web servers distributed across multiple locations to deliver content more efficiently to users.
Steve posted this approx. e^3.25809654 days after(!) we started to use a CDN for our web sites. Just some days later we noticed the desired effect. Our users started to make more and more traffic. The activity grew. Of course a CDN is some kind of luxury but it’s worth to invest into such a service at a special time. And from our point of view we thought it was time to. We were right.
Actually round about 286.356,421^2 objects will be requested per month by our users. More than the half of that (5,4E10 objects) are photos. Small, medium and big sized ones. So each of all photo files we store will be loaded round(pow(2,4.91)) times in a month. That makes a monthly traffic volume of more ore less 265.334.489.612.288 bytes only for these kind of objects. The total traffic of all delivered objects per month is something about 1,402939962446178 times higher.
At high traffic times there are over 110000110101000002 requests per second hitting our CDN and we are happy that our origin servers only get the (5^5)th part of it.

As a side effect we can learn something about the behaviour of our users because the performance graphs can show us for example what they do in the evening. Maybe the Schimanski serials on 26th of July was one of the reasons for the spikes after 8 pm (see graph above) which are nothing else than commercial breaks. Have a break, have a visit at studiVZ.
mckoy – [m]em[c]ache [k]ey [o]bservation [y]ield
We wanted to speed up our web-applications by alleviating our database-loads. So we decided to use the distributed memory object caching system, memcached. Due to the many requests of our memcached-systems (about 1.5 million requests per second), we built a tool (called mckoy), which is capable to perform statistics and debugging information about all memcache-requests in our network.
mckoy is a memcache protocol sniffer (based on pcap library) and statistics builder. It automatically detects and parses each key (and its value) and memcache-api methods. At the end of the sniffing session, the results are used to build the statisticis. mckoy was written to analyse our web application and its usage of memcache-api in PHP. For example: We wanted to know how many set() and get() methods were invoked in a given time. Based on these results, we had to make changes to improve the usage of memcache-api for PHP. You can run mckoy on any UNIX based systems. It was tested on many *BSD and Linux systems. mckoy is licensed under GPLv3 and completely published as opensource project!
You can run mckoy in various modes (see manpage!). For example, if you want to sniff pattern “foobar” for all memcache-api methods and with live capturing, use:
mckoy -i <interface> -e “port 11211″ -m 5 -k foobar -v
And this is, how it looks like:

Unfortunately, there are some known bugs. :) For example: An SIGSEGV will encounter when ^C is sent from user. Also, we noticed that mckoy isn’t able to handle memcached-1.2.8 <= 1.4.* correctly. These bugs will be fixed in the next version as soon as possible! For the next version I also planned to build in udp and binary support.
You can offcially download mckoy from:
http://www.lamergarten.de/releases.html
or
http://sourceforge.net/projects/mckoy/
cheers.
MySQL DBA Tools
Als MySQL Datenbankadministrator ist man täglich damit beschäftigt, unzählige Datenbank-Server am Laufen zu halten. Hier eine Auswahl an Werkzeugen, die man unbedingt in der täglichen Arbeit braucht:
- myTop
- show innodb status
- DSH (Distributed SSH Shell)
- Maatkit (http://www.maatkit.org/)
Aus Maatkit eignet sich mk-query-digest besonders gut, um ein System nach einem Neustart der Datenbank “aufzuwärmen”.
mk-query-digest --processlist h=d-mm-05-1-svz --execute h=d-mm-05-2-svz \
--filter '$event->{fingerprint} =~ m/^select/
Außerdem kann man damit sehr elegant an einem Zweitsystem verschiedene Dinge testen und die Auswirkungen direkt beobachten.
Es bietet sich dazu an, dass man sein System damit immer genau im Blick hat:
- Ganglia (Distributiertes Grid Monitoring)

Ganglia ist eine Allzweckwaffe, um ein Gefühl dafür zu bekommen, wie eine Datenbank “lebt”. Es visualisiert quasi den Herzschlag des Systems. Durch gmetric bekommt man zudem die Möglichkeit mit wenig Aufwand alle möglichen Parameter vom System oder der Datenbank an Ganglia zu übergeben und damit zu visualisieren. Basics dabei sind die Queries per Second, Slave Lag und Slow Queries per Second.
- iostat -x
Was ist auf meinen Platten los? Wie verteilt sich das await auf die einzelnen Devices? Viel sieht man damit leider nicht, aber es gibt deswegen Erweiterungen für MySQL, die das IO bis auf Tabellen und Indizes runterbrechen können.
- Nagios – damit man den Fehler auch mitbekommt
Kristian Köhntopp hat dafür was Nettes gebaut. Man braucht an der Stelle also nicht mehr ganz so viel tun.
Nicht zu vergessen der Kommandozeilenclient mysql mit einem ordentlichen Prompt, damit man nicht bei mehreren Maschinen durcheinander kommt:
[mysql]
prompt = \u@hostname[\d]>\_
MySQL und INNODB_IO_PATTERN
Percona ist ein Consultingunternehmen für MySQL und hilft als remote DBA, bei Architekturplanungen, Trouble Shooting und Database Recovery. Percona wurde 2006 von Peter Zaitsev und Vadim Tkachenko gegründet.
Seit einiger Zeit nutzen wir auf unserer Plattform die MySQL-Version von Percona, weil es unheimlich praktische Patches gibt, die uns als DBA das Leben erleichtern.
- Session status to check fragmentation of the last InnoDB scan
- SHOW USER/TABLE/INDEX statistics
- SHOW PATCHES
- Adds additional information of InnoDB internal hash table memories in SHOW INNODB STATUS
- Information schema table of InnoDB IO counts for each datafile pages
- Adds INFOMATION_SCHEMA.PROCESSLIST with TIME_MS column
- Add locks held, remove locked records in SHOW INNODB STATUS
- Extended statistics in slow.log
- Patch allows redirect output of error.log to syslog-ng
- Information of fsync callers in InnoDB
- Show innodb buffer pool content
Mit show index_statistics sieht man z.B. sehr gut, wieviele Rows durch welchen Index gelesen wurden. Ideal, um nicht benutzte Indizes aufzuspüren.
Natürlich will man auch wissen, wie sich die IO auf einzelne Tabellen und Indizes verteilt. Dafür gibt es dann im Information-Schema die Tabelle INNODB_IO_PATTERN:
$ describe INNODB_IO_PATTERN; +------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+-------------+------+-----+---------+-------+ | SPACE | bigint(11) | NO | | 0 | | | OFFSET | bigint(11) | NO | | 0 | | | INDEX_ID | bigint(11) | NO | | 0 | | | TABLE_NAME | varchar(32) | NO | | NULL | | | INDEX_NAME | varchar(32) | NO | | NULL | | | N_READ | bigint(11) | NO | | 0 | | | N_WRITE | bigint(11) | NO | | 0 | | +------------+-------------+------+-----+---------+-------+ 7 rows in set (0.01 sec)
Bevor man Auswertungen starten kann, muss MySQL erstmal Daten sammeln:
$ set global innodb_io_pattern_trace = 1;
$ set global innodb_io_pattern_trace_running = 1;
$ set global innodb_io_pattern_trace_size_limit = 1;
-- Anzahl der Pages die gesammelt werden sollen
Man muss auch unbedingt darauf achten, dass man genug freien Hauptspeicher hat, bevor man das Tracing startet.
Auswertung des IO für jeden Index, getrennt nach Read und Write:
$ select sum(i.n_read) n_read, sum(i.n_write) n_write, index_name, table_name from information_schema.innodb_io_pattern i group by index_id
Dokumenation, Sourcen und Binaries finden sich im Wiki von Percona. Großes Lob also an die verschiedenen Entwickler, die dafür sorgen, dass auch die Datenbanken bei studiVZ unheimlich gut performen. Hier aus unserem Grid Monitoring die aggregierte Datenbanklast in Queries pro Sekunden:

Auf der Suche nach den verschwundenen Fotos
Am Dienstag, den 17.02., haben wir bei unserem Content Delivery/Distribution Network (CDN) ein sogenanntes “Referrer Checking” aktiviert. Wird also versucht ein Foto, das bei uns liegt, auf einer anderen Internetseite einzubinden (Stichwort Hotlinking), kommt nicht das gewünschte Foto sondern die nebenstehende Grafik.
Übrigens… In Spitzen laden VZ Nutzer mal locker über 1.000.000 neue Fotos am Tag bei uns hoch und es werden um die/über 70.000 Anfragen pro Sekunde an unser CDN gestellt. Das CDN schützt unsere Image Server (die Server, die die ganzen Fotos und anderen statischen Inhalte ausliefern) davor, sich dieser enormen Last selber stellen zu müssen.
Ich weiß nicht, was ich verbrochen habe, aber ich sehe seit einigen Tagen keine Fotos mehr im meinVZ, studiVZ oder schülerVZ. Hilfeee!
Dafür kann es verschiedene Gründe geben. Letztlich reduziert sich das darauf, dass euer Browser (Firefox, Internet Explorer, Safari, Opera usw.) keinen korrekten “Referrer” übermittelt. Daran muss nicht direkt der Browser schuld sein. Antiviren-, Firewall- oder Proxy-Software zum Beispiel beeinflussen die Übermittlung des Referrers bzw. verändern diesen dahingehend, dass anstelle des korrekten Referrers ein “Blocked by Firewall XYZ” übermittelt wird, sofern man dies nicht deaktiviert. Manche haben sich vielleicht das Firefox Add-on “RefControl” installiert. Dort und bei der anderen Software sollte zumindest das Senden eines leeren Referrers eingestellt sein. Dann müsste alles wieder funktionieren.
[UPDATE]
Wir haben uns unterdessen dazu entschieden, auch leere Referrer zu akzeptieren. Deshalb wurde der Artikel entsprechend angepasst und ist jetzt etwas übersichtlicher geworden.
[UPDATE]
Unterdessen sind leere Referrer wieder von der Whitelist gestrichen worden. Wer jetzt noch mit den Fotos ein Problem hat, schaue bitte in die entsprechenden Hilfegruppen:
http://www.meinvz.net/Groups/Overview/fbd443e298aee375
http://www.studivz.net/Groups/Overview/193b82ce5c44d2ba
http://www.schuelervz.net/Groups/Overview/f2d4f75f70701b0f
[UPDATE]
Leere Referer sind wieder erlaubt.
Wartungsarbeiten/Offline
Morgen früh (Dienstag, den 10.02.09) gehen wir mit meinVZ, studiVZ und schülerVZ von 01.00 bis ca. 08.00 Uhr offline aufgrund von Wartungsarbeiten an den Datenbanken.

Unter anderem sind wir dabei die Datensätze der Gruppenmitgliedschaften zu partitionieren, die vorher zusammen gespeichert waren. Es gibt von Flickr eine Präsentation über das Data Sharding die ziemlich gut beschreibt, was wir machen werden. Außerdem geht nach tagelanger Arbeit unser neuer LVS/ Heartbeat 2-Cluster mit einer neuen Version online. Mit dem LVS läuft im Backend die komplette Lastverteilung auf die Systeme, dank Direct Server Routing hält sich der Durchsatz auch in Grenzen, da nur die eingehenden Frames durch das System müssen.
Mehr dazu demnächst in einem anderem Blog-Post.
P.S. Der/das Blog bleibt online.





