<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Performance on Brave New Geek</title><link>https://bravenewgeek.com/tag/performance/</link><description>Recent content in Performance on Brave New Geek</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 11 Oct 2019 11:58:18 -0600</lastBuildDate><atom:link href="https://bravenewgeek.com/tag/performance/index.xml" rel="self" type="application/rss+xml"/><item><title>Building a Distributed Log from Scratch, Part 5: Sketching a New System</title><link>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-5-sketching-a-new-system/</link><pubDate>Tue, 23 Jan 2018 12:08:53 -0600</pubDate><guid>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-5-sketching-a-new-system/</guid><description>&lt;p&gt;In &lt;a href="https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-4-trade-offs-and-lessons-learned/"&gt;part four&lt;/a&gt; of this series we looked at some key trade-offs involved with a distributed log implementation and discussed a few lessons learned while building NATS Streaming. In this fifth and final installment, we’ll conclude by outlining the design for a new log-based system that draws from the previous entries in the series.&lt;/p&gt;
&lt;h3 id="the-context"&gt;The Context&lt;/h3&gt;
&lt;p&gt;For context, &lt;a href="https://nats.io/"&gt;NATS&lt;/a&gt; and &lt;a href="https://nats.io/documentation/streaming/nats-streaming-intro/"&gt;NATS Streaming&lt;/a&gt; are two different things. NATS Streaming is a log-based streaming system built on top of NATS, and NATS is a lightweight pub/sub messaging system. NATS was originally built (and then open sourced) as the control plane for Cloud Foundry. NATS Streaming was built in response to the community’s ask for higher-level guarantees—durability, at-least-once delivery, and so forth—beyond what NATS provided. It was built as a separate layer on top of NATS. I tend to describe NATS as a dial tone—ubiquitous and always on—perfect for “online” communications. NATS Streaming is the voicemail—leave a message after the beep and someone will get to it later. There are, of course, more nuances than this, but that’s the gist.&lt;/p&gt;</description></item><item><title>Building a Distributed Log from Scratch, Part 4: Trade-Offs and Lessons Learned</title><link>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-4-trade-offs-and-lessons-learned/</link><pubDate>Thu, 18 Jan 2018 16:01:13 -0600</pubDate><guid>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-4-trade-offs-and-lessons-learned/</guid><description>&lt;p&gt;In &lt;a href="https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-3-scaling-message-delivery/"&gt;part three&lt;/a&gt; of this series we talked about scaling message delivery in a distributed log. In part four, we’ll look at some key trade-offs involved with such systems and discuss a few lessons learned while building NATS Streaming.&lt;/p&gt;
&lt;h3 id="competing-goals"&gt;Competing Goals&lt;/h3&gt;
&lt;p&gt;There are a number of competing goals when building a distributed log (these goals also extend to many other types of systems). Recall from &lt;a href="https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-1-storage-mechanics/"&gt;part one&lt;/a&gt; that our key priorities for this type of system are performance, high availability, and scalability. The preceding parts of this series described at various levels how we can accomplish these three goals, but astute readers likely noticed that some of these things conflict with one another.&lt;/p&gt;</description></item><item><title>Building a Distributed Log from Scratch, Part 3: Scaling Message Delivery</title><link>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-3-scaling-message-delivery/</link><pubDate>Mon, 08 Jan 2018 16:10:40 -0600</pubDate><guid>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-3-scaling-message-delivery/</guid><description>&lt;p&gt;In &lt;a href="https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-2-data-replication/"&gt;part two&lt;/a&gt; of this series we discussed data replication within the context of a distributed log and how it relates to high availability. Next, we’ll look at what it takes to scale the log such that it can handle non-trivial workloads.&lt;/p&gt;
&lt;h3 id="data-scalability"&gt;Data Scalability&lt;/h3&gt;
&lt;p&gt;A key part of scaling any kind of data-intensive system is the ability to partition the data. Partitioning is how we can scale a system linearly, that is to say we can handle more load by adding more nodes. We make the system &lt;em&gt;horizontally&lt;/em&gt; scalable.&lt;/p&gt;</description></item><item><title>Building a Distributed Log from Scratch, Part 2: Data Replication</title><link>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-2-data-replication/</link><pubDate>Wed, 27 Dec 2017 12:26:55 -0600</pubDate><guid>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-2-data-replication/</guid><description>&lt;p&gt;In &lt;a href="https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-1-storage-mechanics/"&gt;part one&lt;/a&gt; of this series we introduced the idea of a message log, touched on why it’s useful, and discussed the storage mechanics behind it. In part two, we discuss data replication.&lt;/p&gt;
&lt;p&gt;We have our log. We know how to write data to it and read it back as well as how data is persisted. The caveat to this is, although we have a durable log, it’s a single point of failure (SPOF). If the machine where the log data is stored dies, we’re SOL. Recall that one of our three priorities with this system is high availability, so the question is how do we achieve high availability and fault tolerance?&lt;/p&gt;</description></item><item><title>Building a Distributed Log from Scratch, Part 1: Storage Mechanics</title><link>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-1-storage-mechanics/</link><pubDate>Thu, 21 Dec 2017 15:54:17 -0600</pubDate><guid>https://bravenewgeek.com/building-a-distributed-log-from-scratch-part-1-storage-mechanics/</guid><description>&lt;p&gt;The log is a totally-ordered, append-only data structure. It’s a powerful yet simple abstraction—a sequence of immutable events. It’s something that programmers have been using for a very long time, perhaps without even realizing it because it’s so simple. Whether it’s application logs, system logs, or access logs, logging is something every developer uses on a daily basis. Essentially, it’s a timestamp and an event, a &lt;em&gt;when&lt;/em&gt; and a &lt;em&gt;what&lt;/em&gt;, and typically appended to the end of a file. But when we generalize that pattern, we end up with something much more useful for a broad range of problems. It becomes more interesting when we look at the log not just as a system of record but a central piece in managing data and distributing it across the enterprise efficiently.&lt;/p&gt;</description></item><item><title>Fast Topic Matching</title><link>https://bravenewgeek.com/fast-topic-matching/</link><pubDate>Wed, 28 Dec 2016 17:52:30 -0600</pubDate><guid>https://bravenewgeek.com/fast-topic-matching/</guid><description>&lt;p&gt;A common problem in messaging middleware is that of efficiently matching message topics with interested subscribers. For example, assume we have a set of subscribers, numbered 1 to 3:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Subscriber&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Match Request&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;p&gt;forex.usd&lt;/p&gt;
&lt;p&gt;2&lt;/p&gt;
&lt;p&gt;forex.*&lt;/p&gt;
&lt;p&gt;3&lt;/p&gt;
&lt;p&gt;stock.nasdaq.msft&lt;/p&gt;
&lt;p&gt;And we have a stream of messages, numbered 1 to N:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Message&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Topic&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;p&gt;forex.gbp&lt;/p&gt;
&lt;p&gt;2&lt;/p&gt;
&lt;p&gt;stock.nyse.ibm&lt;/p&gt;
&lt;p&gt;3&lt;/p&gt;
&lt;p&gt;stock.nyse.ge&lt;/p&gt;
&lt;p&gt;4&lt;/p&gt;
&lt;p&gt;forex.eur&lt;/p&gt;
&lt;p&gt;5&lt;/p&gt;
&lt;p&gt;forex.usd&lt;/p&gt;
&lt;p&gt;…&lt;/p&gt;
&lt;p&gt;…&lt;/p&gt;
&lt;p&gt;N&lt;/p&gt;
&lt;p&gt;stock.nasdaq.msft&lt;/p&gt;
&lt;p&gt;We are then tasked with routing messages whose topics match the respective subscriber requests, where a “&lt;em&gt;*”&lt;/em&gt; wildcard matches any word. This is frequently a bottleneck for message-oriented middleware like ZeroMQ, RabbitMQ, ActiveMQ, TIBCO EMS, et al. Because of this, there are a number of &lt;a href="http://zeromq.org/whitepapers:message-matching"&gt;well-known&lt;/a&gt; &lt;a href="http://wso2.com/library/articles/2015/05/article-fast-topic-matching-algorithm-implementation-for-wso2-message-broker/"&gt;solutions&lt;/a&gt; &lt;a href="https://www.rabbitmq.com/blog/2010/09/14/very-fast-and-scalable-topic-routing-part-1/"&gt;to the problem&lt;/a&gt;. In this post, I’ll describe some of these solutions, as well as a novel one, and attempt to quantify them through benchmarking. As usual, the code is available &lt;a href="https://github.com/tylertreat/fast-topic-matching"&gt;on GitHub&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Benchmarking Commit Logs</title><link>https://bravenewgeek.com/benchmarking-commit-logs/</link><pubDate>Sun, 27 Nov 2016 13:28:55 -0600</pubDate><guid>https://bravenewgeek.com/benchmarking-commit-logs/</guid><description>&lt;p&gt;In this article, we look at &lt;a href="https://kafka.apache.org/"&gt;Apache Kafka&lt;/a&gt; and &lt;a href="http://nats.io/"&gt;NATS Streaming&lt;/a&gt;, two messaging systems based on the idea of a commit log. We’ll compare some of the features of both but spend less time talking about Kafka since by now it’s quite well known. Similar to &lt;a href="https://bravenewgeek.com/benchmarking-message-queue-latency/"&gt;previous&lt;/a&gt; &lt;a href="https://bravenewgeek.com/dissecting-message-queues/"&gt;studies&lt;/a&gt;, we’ll attempt to quantify their general performance characteristics through careful benchmarking.&lt;/p&gt;
&lt;p&gt;The purpose of this benchmark is to test drive the newly released NATS Streaming system, which was made generally available just in the last few months. NATS Streaming doesn’t yet support clustering, so we try to put its performance into context by looking at a similar configuration of Kafka.&lt;/p&gt;</description></item><item><title>So You Wanna Go Fast?</title><link>https://bravenewgeek.com/so-you-wanna-go-fast/</link><pubDate>Wed, 24 Feb 2016 19:30:14 -0600</pubDate><guid>https://bravenewgeek.com/so-you-wanna-go-fast/</guid><description>&lt;p&gt;I originally proposed this as a &lt;a href="https://www.gophercon.com/"&gt;GopherCon&lt;/a&gt; talk on writing “high-performance Go”, which is why it may seem rambling, incoherent, and—at times—not at all related to Go. The talk was rejected (probably because of the rambling and incoherence), but I still think it’s a subject worth exploring. The good news is, since it was rejected, I can take this where I want. The remainder of this piece is mostly the outline of that talk with some parts filled in, some meandering stories which may or may not pertain to the topic, and some lessons learned along the way. I think it might make a good talk one day, but this will have to do for now.&lt;/p&gt;</description></item><item><title>Breaking and Entering: Lose the Lock While Embracing Concurrency</title><link>https://bravenewgeek.com/breaking-and-entering-lose-the-lock-while-embracing-concurrency/</link><pubDate>Sun, 27 Dec 2015 19:12:53 -0600</pubDate><guid>https://bravenewgeek.com/breaking-and-entering-lose-the-lock-while-embracing-concurrency/</guid><description>&lt;p&gt;&lt;em&gt;This article originally appeared on Workiva’s engineering blog as a &lt;a href="https://techblog.workiva.com/tech-blog/breaking-and-entering-lose-lock-while-embracing-concurrency-part-i"&gt;two-part series&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Providing robust message routing was a priority for us at Workiva when building our distributed messaging infrastructure. This encompassed directed messaging, which allows us to route messages to specific endpoints based on service or client identifiers, but also topic fan-out with support for wildcards and pattern matching.&lt;/p&gt;
&lt;p&gt;Existing message-oriented middleware, such as RabbitMQ, provide varying levels of support for these but don’t offer the rich features needed to power Wdesk. This includes transport fallback with graceful degradation, tunable qualities of service, support for client-side messaging, and pluggable authentication middleware. As such, we set out to build a new system, not by reinventing the wheel, but by repurposing it.&lt;/p&gt;</description></item><item><title>Everything You Know About Latency Is Wrong</title><link>https://bravenewgeek.com/everything-you-know-about-latency-is-wrong/</link><pubDate>Sat, 12 Dec 2015 15:12:12 -0600</pubDate><guid>https://bravenewgeek.com/everything-you-know-about-latency-is-wrong/</guid><description>&lt;p&gt;Okay, maybe not &lt;em&gt;everything&lt;/em&gt; you know about latency is wrong. But now that I have your attention, we can talk about why the tools and methodologies you use to measure and reason about latency are likely horribly flawed. In fact, they’re not just flawed, they’re probably &lt;em&gt;lying to your face.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;When I went to &lt;a href="http://www.thestrangeloop.com/"&gt;Strange Loop&lt;/a&gt; in September, I attended a workshop called “Understanding Latency and Application Responsiveness” by Gil Tene. Gil is the CTO of Azul Systems, which is most renowned for its C4 pauseless garbage collector and associated Zing Java runtime. While the workshop was four and a half hours long, Gil also gave a 40-minute talk called &lt;a href="https://youtu.be/lJ8ydIuPFeU"&gt;“How NOT to Measure Latency”&lt;/a&gt; which was basically an abbreviated, less interactive version of the workshop. If you ever get the opportunity to see Gil speak or attend his workshop, I recommend you do. At the very least, do yourself a favor and watch one of his recorded talks or find his slide decks online.&lt;/p&gt;</description></item><item><title>Benchmark Responsibly</title><link>https://bravenewgeek.com/benchmark-responsibly/</link><pubDate>Fri, 02 Jan 2015 14:53:22 -0600</pubDate><guid>https://bravenewgeek.com/benchmark-responsibly/</guid><description>&lt;p&gt;When I posted my &lt;a href="http://www.bravenewgeek.com/dissecting-message-queues/"&gt;Dissecting Message Queues&lt;/a&gt; article last summer, it understandably caused some controversy.  I received both praise and scathing comments, emails asking why I didn’t benchmark X and pull requests to bump the numbers of Y. To be honest, that analysis was more of a brain dump from my own test driving of various message queues than any sort of authoritative or scientific study—it was &lt;em&gt;far&lt;/em&gt; from the latter, to say the least. The qualitative discussion was pretty innocuous, but the benchmarks and &lt;a href="https://github.com/tylertreat/mq-benchmarking"&gt;supporting code&lt;/a&gt; were the target of a lot of (valid) criticism. In retrospect, it was probably irresponsible to publish them, but I was young and naive back then; now I’m just mostly naive.&lt;/p&gt;</description></item></channel></rss>