News-Feeds

Münchner McDonald's-Massaker: Mitverantwortung der Polizei?

Telepolis - Mi, 2016-07-27 22:00
Einem Bericht der Süddeutschen Zeitung nach reagierte man auf Mobbing-Anzeigen lediglich mit "Ausgleichsbemühungen"
Kategorien: Politik + Kultur

Friedensgebet in Kiew mit zehntausendenTeilnehmern

Telepolis - Mi, 2016-07-27 22:00
Nach unterschiedlichen Angaben beteiligten sich 10.000 bis 80.000 Menschen am Friedensgebet in Kiew. Wegen einer Bombenwarnung musste die Gläubigen das letzte Stück der Prozession mit dem Bus fahren
Kategorien: Politik + Kultur

Monitoring MongoDB with Nagios

MySQL High Performance - Mi, 2016-07-27 14:08

In this blog, we’ll discuss monitoring MongoDB with Nagios.

There is a significant amount of talk around graphing MongoDB metrics using things like Prometheus, Data Dog, New Relic, and Ops Manager from MongoDB Inc. However, I haven’t noticed a lot of talk around “What MongoDB alerts should I be setting up?”

While building out Percona’s remote DBA service for MongoDB, I looked at Prometheus’s AlertManager. After reviewing it, I’m not sure it’s quite ready to be used exclusively. We needed to decide quickly if there are better Nagios checks on the market, or did I need to write my own?

In the end, we settled on a hybrid approach. There are some good frameworks, but we need to create or tweak some of the things needed for an “SEV 1-” or “SEV 2-” type issue (which are most important to me). One of the most common problems for operations, Ops, DevOps, DBA teams and most engineering is alert spam. As such I wanted to be very careful to only alert on the things pointing to immediate dangers or current outages. As a result, we have now added pmp-check-mongo.py to the GitHub for Percona Monitoring Plugins. Since we use Grafana and Prometheus for metrics and graphing, there are no accompanying Catci information templates. In the future, we’ll need to decide how this will change PMP overtime. In the meantime, we wanted to make the tool available now and worry about some of the issues later on.

As part of this push, I want to give you some real world examples of how you might use this tool. There are many options available to you, and Nagios is still a bit green in regards to making those options as user-friendly as our tools are.

Usage: pmp-check-mongo.py [options] Options: -h, --help show this help message and exit -H HOST, --host=HOST The hostname you want to connect to -P PORT, --port=PORT The port mongodb is running on -u USER, --user=USER The username you want to login as -p PASSWD, --password=PASSWD The password you want to use for that user -W WARNING, --warning=WARNING The warning threshold you want to set -C CRITICAL, --critical=CRITICAL The critical threshold you want to set -A ACTION, --action=ACTION The action you want to take. Valid choices are (check_connections, check_election, check_lock_pct, check_repl_lag, check_flushing, check_total_indexes, check_balance, check_queues, check_cannary_test, check_have_primary, check_oplog, check_index_ratio, check_connect) Default: check_connect -s SSL, --ssl=SSL Connect using SSL -r REPLICASET, --replicaset=REPLICASET Connect to replicaset -c COLLECTION, --collection=COLLECTION Specify the collection in check_cannary_test -d DATABASE, --database=DATABASE Specify the database in check_cannary_test -q QUERY, --query=QUERY Specify the query, only used in check_cannary_test --statusfile=STATUS_FILENAME File to current store state data in for delta checks --backup-statusfile=STATUS_FILENAME_BACKUP File to previous store state data in for delta checks --max-stale=MAX_STALE Age of status file to make new checks (seconds)

There seems to be a huge amount going on here, but let’s break it down into a few categories:

  • Connection options
  • Actions
  • Action options
  • Status options

Hopefully, this takes some of the scariness out of the script above.

Connection options
  • Host / Port Number
    • Pretty simple, this is just the host you want to connect to and what TCP port it is listening on.
  • Username and Password
    • Like with Host/Port, this is some of your normal and typical Mongo connection field options. If you do not set both the username and password, the system will assume auth was disabled.
  • SSL
    • This is mostly around the old SSL support in Mongo clients (which was a boolean). This tool needs updating to support the more modern SSL connection options. Use this as a “deprecated” feature that might not work on newer versions.
  • ReplicaSet
    • Very particular option that is only used for a few checks and verifies that the connection uses a replicaset connection. Using this option lets the tool automatically find a primary node for you, and is helpful to some checks specifically around replication and high availability (HA):
      • check_election
      • check_repl_lag
      • check_cannary_test
      • chech_have_primary
      • check_oplog
Actions and what they mean
  • check_connections
    • This parameter refers to memory usage, but beyond that you need to know if your typical connections suddenly double. This indicates something unexpected happened in the application or database and caused everything to reconnect. It often takes up to 10 minutes for those old connections to go away.
  • check_election
    • This uses the status file options we will cover in a minute, but it checks to see if the primary from the last check differs from the current found primary. If so, it alerts. This check should only have a threshold of one before it alarms (as an alert means an HA event occurred).
  • check_lock_pct
    • MMAP only, this engine has a write lock on the whole collection/database depending on the version. This is a crucial metric to determine if MMAP writes are blocking reads, meaning you need to scale the DB layer in some way.
  • check_repl_lag
    • Checks the replication stream to understand how lagged a given node is the primary. To accomplish this, it uses a fake record in the test DB to cause a write. Without this, a read-only system would look lagged artificially as no new oplog entries get created.
  • check_flushing
    • A common issue with MongoDB is very long flush times, causing a system halt. This is a caused by your disk subsystem not keeping up, and then the DB having to wait on flushing to make sure writes get correctly journaled.
  • check_total_indexes
    • The more indexes you have, the more the planner has to work to determine which index is a good fit. This increases the risk that the recovery of a failure will take a long time. This is due to the way a restore builds indexes and how MongoDB can only make one index at a time.
  • check_balance
    • While MongoDB should keep things in balance across a cluster, many things can happen: jumbo chunks, a disabled balancer being, constantly attempting to move the same chunk but failing, and even adding/removing sharding. This alert is for these cases, as an imbalance means some records might get served faster than others. It is purely based on the chunk count that the MongoDB balancer is also based on, which is not necessarily the same as disk usage.
  • check_queues
    • No matter what engine you have selected, a backlog of sustained reads or writes indicates your DB layer is unable to keep up with demand. It is important in these cases to send an alert if the rate is maintained. You might notice this is also in our Prometheus exporter for graphics as both trending and alerting are necessary to watch in a MongoDB system.
  • check_cannary_test
    • This is a typical query for the database and then used to set critical/warning levels based on the latency of the returned query. While not as accurate as full synthetic transactions, queries through the application are good to measure response time expectations and SLAs.
  • check_have_primary
    • If we had an HA event but failed to get back up quickly, it’s important to know if a new primary is causing writes to error on the system. This check simply determines if the replica set has a primary, which means it can handle reads and writes.
  • check_oplog
    • This check is all about how much oplog history you have. This is much like measuring how much history you have in MySQL blogs. The reason this is important is when recovering from a backup and performing a point in time recovery, you can use the current oplog if the oldest timestamp in the oplog is newer than the backup timestamp. As a result, this is normal three times the backup interval you use to guarantee that you have plenty of time to find the newest recovery and then do the recovery.
  • check_index_ratio
    • This is an older metric that modern MongoDB versions will not find useful, but in the past, it was a good way to understand the percentage of queries not handled by an index.
  • check_connect
    • A very basic check to ensure it can connect (and optionally login) to MongoDB and verify the server is working.
Status File options

These options rarely need to be changed but are present in case you want to store the status on an SHM mount point to avoid actual disk writes.

  • statusfile
    • This is where a copy of the current rs.status, serverStatus and other command data is stored
  • backup-statusfile
    • Like status_file, but status_file is moved here when a new check is done. These two objects can then be compared to find the delta between two checkpoints.
  • max-stale
    • This is the amount of age for which an old file is still valid. Deltas older then this aren’t allowed and exist to protect the system from will assumption when a statusfile is hours or days old.

If you have any questions on how to use these parameters, feel free to let us know. In the code, there is also a defaults dictionary for most of these options so that in many cases setting warning and critical level are not needed.

Nicht einmal eine symbolische Strafe für Defizitverstöße Spaniens und Portugals

Telepolis - Mi, 2016-07-27 12:50
Spanien bekommt sogar von der EU-Kommission erneut zwei Jahre Zeit für den Defizitabbau, doch Portugal ist weiter entsetzt über eine "wenig freundliche" Behandlung
Kategorien: Politik + Kultur

Der Attentäter von Ansbach war angeblich langjähriges Mitglied des IS

Telepolis - Mi, 2016-07-27 12:00
Laut einer Veröffentlichung der Terrororganisation war der Dschihadist aus Syrien schon vor Ausbruch des Bürgerkriegs im Land Mitglied der al-Qaida-Organisation ISI
Kategorien: Politik + Kultur

Kakerlakenmilch als Ersatz für Kuhmilch und als Vollernährung?

Telepolis - Mi, 2016-07-27 10:00
Die Milchkristalle einer außergewöhnlichen Kakerlakenart sind nährreicher als Kuhmilch und lösen sich nach Bedarf zeitversetzt auf
Kategorien: Politik + Kultur

Bundesregierung hält Akten zur Diktatur in Argentinien unter Verschluss

Telepolis - Mi, 2016-07-27 09:00
Dokumente in Archiven von BND, Kanzleramt und Außenamt. Hunderte Akten über Rüstungsgeschäfte. Kritik von Opposition und Journalisten
Kategorien: Politik + Kultur

Demokraten küren Hillary Clinton zur Kandidatin

Telepolis - Mi, 2016-07-27 09:00
Die ehemalige Außenministerin setzt auf Identitätspolitik und ein Frau- und Mutter-Image
Kategorien: Politik + Kultur

Grenze zwischen Venezuela und Kolumbien soll wieder geöffnet werden

Telepolis - Mi, 2016-07-27 08:00
Schmuggel und Sicherheitsprobleme hatten zu Schließung geführt. Caracas kämpft weiterhin mit schwerer Wirtschaftskrise
Kategorien: Politik + Kultur

Thailand: Lächeln auf Eis?

Telepolis - Mi, 2016-07-27 08:00
Zwei Jahre nach der Machtübernahme durch das Militär soll ein Referendum das Land wieder unter demokratische Regeln bringen
Kategorien: Politik + Kultur

Zwinker Zwinker, Knips Knips

Telepolis - Mi, 2016-07-27 06:19
Wer drückt denn heutzutage noch auf einen Auslöser? Es geht doch viel ... galanter
Kategorien: Politik + Kultur

Rückkehrer als "potenzielle Terroristen"

Telepolis - Mi, 2016-07-27 06:00
Europol konstatiert einen bedrohlichen Anstieg "nationalistischer und rassistischer Gefühlslagen"
Kategorien: Politik + Kultur

"Jedes Polizeiauto sollte eine Mini-Antiterroreinheit mit schweren Waffen, Schusswesten und Helmen sein"

Telepolis - Di, 2016-07-26 22:00
Die Polizei von New York wird mit militärischen Schusswesten und Helmen ausgestattet, die Polizisten fordern zudem Gewehre
Kategorien: Politik + Kultur

Dobrindt: Oberstes Ziel der Bahn nicht Gewinnmaximierung

Telepolis - Di, 2016-07-26 22:00
Der Bundesverkehrsminister verabschiedet sich von einem Dogma aus der Schröder- und Mehdorn-Zeit
Kategorien: Politik + Kultur

Testing Samsung storage in tpcc-mysql benchmark of Percona Server

MySQL High Performance - Di, 2016-07-26 18:00

This blog post will detail the results of Samsung storage in tpcc-mysql benchmark using Percona Server.

I had an opportunity to test different Samsung storage devices under tpcc-mysql benchmark powered by Percona Server 5.7. You can find a summary with details here https://github.com/Percona-Lab-results/201607-tpcc-samsung-storage/blob/master/summary-tpcc-samsung.md

I have in my possession:

  • Samsung 850 Pro, 2TB: This is a SATA device and is positioned as consumer-oriented, something that you would use in a high-end user desktop. As of this post, I estimate the price of this device as around $430/TB.
  • Samsung SM863, 1.92TB: this device is also a SATA, and positioned for a server usage. The current price is about $600/TB. 
  • Samsung PM1725, 800GB: This is an NVMe device, in a 2.5″ form factor, but it requires a connection to a PCIe slot, which I had to allocate in my server. The device is high-end, oriented for server-side and demanding workloads. The current price is about $1300/TB.

I am going to use 1000 warehouses in the tpcc-mysql benchmarks, which corresponds roughly to a data size of 100GB.

This benchmark varies the innodb_buffer_pool_size from 5GB to 115GB. With 5GB buffer pool size only a very small portion of data fits into memory, which results in intensive foreground IO reads and intensive background IO writes. With 115GB almost all data fits into memory, which results in very small (or almost zero) IO reads and moderate background IO writes.

All buffer pool sizes in the middle of the interval correspond to resulting IO reads and writes. For example, we can see the read to write ratio on the chart below (received for the PM1725 device) with different buffer pool sizes:

We can see that for the 5GB buffer pool size we have 56000 read IOPs operations and 32000 write IOPs. For 115GB, the reads are minimal at about 300 IOPS and the background writes are at the 20000 IOPs level. Reads gradually decline with the increasing buffer pool size.

The charts are generated with the Percona Monitoring and Management tools.

Results

Let’s review the results. The first chart shows measurements taken every one second, allowing us to see the trends and stalls.

If we take averages, the results are:

In table form (the results are in new order transactions per minute (NOTPM)):

bp, GB pm1725 sam850 sam863 pm1725 / sam863 pm1725 / sam850 5 42427.57 1931.54 14709.69 2.88 21.97 15 78991.67 2750.85 31655.18 2.50 28.72 25 108077.56 5156.72 56777.82 1.90 20.96 35 122582.17 8986.15 93828.48 1.31 13.64 45 127828.82 12136.51 123979.99 1.03 10.53 55 130724.59 19547.81 127971.30 1.02 6.69 65 131901.38 27653.94 131020.07 1.01 4.77 75 133184.70 38210.94 131410.40 1.01 3.49 85 133058.50 39669.90 131657.16 1.01 3.35 95 133553.49 39519.18 132882.29 1.01 3.38 105 134021.26 39631.03 132126.29 1.01 3.38 115 134037.09 39469.34 132683.55 1.01 3.40 Conclusion

The Samsung 850 obviously can’t keep with the more advanced SM863 and PM1725. The PM1725 shows a greater benefit with smaller buffer pool sizes. In cases using large amounts of memory, there is practically no difference with SM863. The reason is that with big buffer pool sizes, MySQL does not push IO subsystem much to use all the PM1725 performance.

For the reference, my.cnf file is

[mysqld] datadir=/var/lib/mysql socket=/tmp/mysql.sock ssl=0 symbolic-links=0 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES # general thread_cache_size=2000 table_open_cache = 200000 table_open_cache_instances=64 back_log=1500 query_cache_type=0 max_connections=4000 # files innodb_file_per_table innodb_log_file_size=15G innodb_log_files_in_group=2 innodb_open_files=4000 innodb_io_capacity=10000 loose-innodb_io_capacity_max=12000 innodb_lru_scan_depth=1024 innodb_page_cleaners=32 # buffers innodb_buffer_pool_size= 200G innodb_buffer_pool_instances=8 innodb_log_buffer_size=64M # tune innodb_doublewrite= 1 innodb_support_xa=0 innodb_thread_concurrency=0 innodb_flush_log_at_trx_commit= 1 innodb_flush_method=O_DIRECT_NO_FSYNC innodb_max_dirty_pages_pct=90 join_buffer_size=32K sort_buffer_size=32K innodb_use_native_aio=0 innodb_stats_persistent = 1 # perf special innodb_adaptive_flushing = 1 innodb_flush_neighbors = 0 innodb_read_io_threads = 16 innodb_write_io_threads = 8 innodb_purge_threads=4 innodb_adaptive_hash_index=0 innodb_change_buffering=none loose-innodb-log_checksum-algorithm=crc32 loose-innodb-checksum-algorithm=strict_crc32 loose-innodb_sched_priority_cleaner=39 loose-metadata_locks_hash_instances=256

Bergbau: Nach dem Kohle-Boom

Telepolis - Di, 2016-07-26 12:47
In Australien versuchen sich Bergbau-Konzerne, ums Aufräumen herum zu mogeln. Im Land gibt es rund 50.000 verlassene Gruben
Kategorien: Politik + Kultur

Normandie: Anschlag auf eine christliche Gemeinde während der Messe

Telepolis - Di, 2016-07-26 12:00
Laut Präsident Hollande handelt es sich um einen Terrorakt des IS. Der Priester wurde getötet, ein Opfer schwebt in Lebensgefahr
Kategorien: Politik + Kultur

Terrorverdacht in Polen

Telepolis - Di, 2016-07-26 11:00
Die Spur des Sprengstoffs: Iraker wurde in Polen verhaftet, wo ab heute der katholische Weltjugendtag beginnt
Kategorien: Politik + Kultur

Fethullah Gülen: Der Schulmeister

Telepolis - Di, 2016-07-26 10:00
Die AKP macht Fethullah Gülen für den Putschversuch in der Türkei verantwortlich. Wer ist der Mann, der lange Erdogans Wegbegleiter war?
Kategorien: Politik + Kultur

"Moldawischer Maidan" und Verbindungen nach Deutschland

Telepolis - Di, 2016-07-26 08:00
Droht ein gescheiterter Staat am Rande Europas?
Kategorien: Politik + Kultur