SlideShare a Scribd company logo
1 of 13
GRAYLOG ENGINEERING
DESIGN YOUR ARCHITECTURE.
README.
This is not a guide for the squeamish.
This is a peek for those who like to go off the beaten path, sometimes alone.
For those who aren’t afraid of pulling open the hood and getting their hands dirty.
This is the culmination of five years of engineering design in our hope to bring you
the fastest machine data processing engine on the planet.
Don’t call your sales rep, they won’t know the answers.
-GRAYLOG ENGINEERING
1.
2.
3.
4.
4 1/2
5.
6.
7.
8. 9.
LEGEND:
1 & 2. LOG MESSAGES & LOAD
BALANCER.
3. TRANSPORT LAYER.
4. PROCESSING CHAIN.
4½ - REST API.
5. MONGODB REPLICA SET.
6. ELASTICSEARCH CLUSTER.
7. ANATOMY OF A SINGLE INDEX.
8. INDEX MODEL.
9. DEFLECTOR QUEUE.
1 & 2, LOG MESSAGES & LOAD BALANCER.
tl;dr
We’re not going to spend any time here. Basically, send us any machine data
(structured or not) and use whatever load balancer you like.
The # of messages, their peak rates, average size and extractions performed will
affect performance, but we’ll cover that later.
3, TRANSPORT LAYER.
This is the inputs and journal on top of the Graylog server. It consists of inputs from
the message cloud (this is our syslog stream, as well as other inputs). These get
pre-processed without user configurability into parts of a message.
While the journal is on disk (I/O), it is an *append only* journal where there is no
seek time. (Internally we re-use Apache Kafka code to do this - thanks LinkedIn).
The write “needle” is always close to the same point on the disk so it does not
constantly scan. This makes it blazing fast. You can turn it off, but we do not
recommend it.
Why we did this: Other systems do not have this, so they will lose messages coming
in when message spikes happen because the network layer will start to reject them
or your local memory will explode.
4, PROCESSING CHAIN.
These messages are then taken and written into a process buffer, which is a ring
buffer. We are using the Disruptor library from LMAX, a high speed trading company
that relies on high speed and low latency.
Messages are then processed by the process buffer processor, where stream
routing and extracting of fields happens. This part can get CPU intensive! The filtered
message then goes into the output buffer (another ring buffer), then the output buffer
processor, and onwards to Elasticsearch (ES) or user defined output.
ProTip: Tuning the number of processors run per buffer is important and should
never exceed the number of CPU cores you have available for graylog-server.
Increase number of processors if you see too low throughput and try to focus on
process buffer processors because the output buffer usually does not need many. A
symptom of not enough processors is full buffers.
4½ , REST API.
Why is this different than any other rest API?
This is the same API we use on our web front end, hence you can make any
read/write call we do in your own UI. Yup, you can build your own front end.
Also, it has to be high quality, because this is the same API we use ourselves day to
day. It is not like others where it is just an API that is provided for external users to
integrate with, built once and patched with duct tape every release. Not that we don’t
like duct tape….
5, MONGO.
Then there is Mongo, which is storing only metadata: users, settings and
configuration data on all items: streams, dashboards, extractors, etc. Anything you
configure. If Mongo goes down, Graylog will continue to run. So, it is your choice
whether to include it in a high availability design.
Mongo recommends for HA scenario’s three instances of it. This is because if one
goes down then Mongo has to recommend a primary, and without two more it can
get confused between the first two. See Mongo Replication set for instructions.
6, ELASTICSEARCH CLUSTER.
We connect to ES servers as an embedded ES node that does not store data. So,
we look and act like an ES node, and know about configuration data (indexes,
shards, etc) for each ES server.
When writing to ES and when you are not a node, you have encode and transmit
over the wire as HTTP and then JSON and then decode it, etc. As a node you can
send it in native format, and it is fast.
For HA, we recommend having at least one replica configured.
7, ANATOMY OF AN INDEX.
A single index (In this example, Graylog Index #25), is broken into shards. This
means the index is broken up and the parts are run on different ES nodes. This
makes for faster searches because the query result can be computed on multiple ES
nodes in parallel.
An index can also have replicas configured. This means that each shard is mirrored
to other nodes, which is great for HA.
8, INDEX MODEL.
Each index is numbered starting with 0 the first time. In a time series database, all
data is stored with a time stamp, and once it is stored it is not gone back to be re-
written (hence is marked as READ_ONLY vs WRITE_ACTIVE for performance). So,
messages are not gone back to be re-inserted. This makes it fast. Because of the
time based storage, this also means when you query it you must give a time bound
search (i.e. in the last hour…).
Pro Tip: So the size of these indexes matter when performance tuning. You don’t
want to make the indexes too big because then the searches will take much longer,
and you don’t want them too short for the same reason. The indexes should be sized
based on the amount of data a you have and how far you normally search.
Sometimes people use it for longer historical strategic type searches. It is important
to know and size this correctly.
9, DEFLECTOR.
We write to an index alias called ‘deflector’ that can be atomically switched to a new
index. This allows us not to worry about having to stop message processing when
creating a new index because that is error-prone to manage (oh, index #25 is now
closed, ahh wait, okay the next one is #26, go ahead and write).
Why are we telling you this? Because, well, it’s these kinds of things that makes us
different. We are proud of thinking about all the small things that give you great
performance and stability, and hope you have enjoyed reading this as much as we
did writing it.
Graylog Engineering - Design Your Architecture

More Related Content

What's hot

Prometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingJulien Pivotto
 
OpenTelemetry For Architects
OpenTelemetry For ArchitectsOpenTelemetry For Architects
OpenTelemetry For ArchitectsKevin Brockhoff
 
Introduction to Prometheus
Introduction to PrometheusIntroduction to Prometheus
Introduction to PrometheusJulien Pivotto
 
Combining logs, metrics, and traces for unified observability
Combining logs, metrics, and traces for unified observabilityCombining logs, metrics, and traces for unified observability
Combining logs, metrics, and traces for unified observabilityElasticsearch
 
REX: Cloud Native Apps on a K8S stack
REX: Cloud Native Apps on a K8S stackREX: Cloud Native Apps on a K8S stack
REX: Cloud Native Apps on a K8S stackMathieu Herbert
 
Linking Metrics to Logs using Loki
Linking Metrics to Logs using LokiLinking Metrics to Logs using Loki
Linking Metrics to Logs using LokiKnoldus Inc.
 
Cloud Monitoring with Prometheus
Cloud Monitoring with PrometheusCloud Monitoring with Prometheus
Cloud Monitoring with PrometheusQAware GmbH
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersSATOSHI TAGOMORI
 
Introduction to Grafana Loki
Introduction to Grafana LokiIntroduction to Grafana Loki
Introduction to Grafana LokiJulien Pivotto
 
Getting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and GrafanaGetting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and GrafanaSyah Dwi Prihatmoko
 
Loki - like prometheus, but for logs
Loki - like prometheus, but for logsLoki - like prometheus, but for logs
Loki - like prometheus, but for logsJuraj Hantak
 
OpenTelemetry For Operators
OpenTelemetry For OperatorsOpenTelemetry For Operators
OpenTelemetry For OperatorsKevin Brockhoff
 
Grafana introduction
Grafana introductionGrafana introduction
Grafana introductionRico Chen
 
Fall in Love with Graphs and Metrics using Grafana
Fall in Love with Graphs and Metrics using GrafanaFall in Love with Graphs and Metrics using Grafana
Fall in Love with Graphs and Metrics using Grafanatorkelo
 
Centralized Logging System Using ELK Stack
Centralized Logging System Using ELK StackCentralized Logging System Using ELK Stack
Centralized Logging System Using ELK StackRohit Sharma
 
Prometheus design and philosophy
Prometheus design and philosophy   Prometheus design and philosophy
Prometheus design and philosophy Docker, Inc.
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?LunchBadger
 
Distributed tracing using open tracing & jaeger 2
Distributed tracing using open tracing & jaeger 2Distributed tracing using open tracing & jaeger 2
Distributed tracing using open tracing & jaeger 2Chandresh Pancholi
 

What's hot (20)

Prometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is coming
 
OpenTelemetry For Architects
OpenTelemetry For ArchitectsOpenTelemetry For Architects
OpenTelemetry For Architects
 
Introduction to Prometheus
Introduction to PrometheusIntroduction to Prometheus
Introduction to Prometheus
 
Combining logs, metrics, and traces for unified observability
Combining logs, metrics, and traces for unified observabilityCombining logs, metrics, and traces for unified observability
Combining logs, metrics, and traces for unified observability
 
REX: Cloud Native Apps on a K8S stack
REX: Cloud Native Apps on a K8S stackREX: Cloud Native Apps on a K8S stack
REX: Cloud Native Apps on a K8S stack
 
Linking Metrics to Logs using Loki
Linking Metrics to Logs using LokiLinking Metrics to Logs using Loki
Linking Metrics to Logs using Loki
 
Observability
Observability Observability
Observability
 
Cloud Monitoring with Prometheus
Cloud Monitoring with PrometheusCloud Monitoring with Prometheus
Cloud Monitoring with Prometheus
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and Containers
 
Introduction to Grafana Loki
Introduction to Grafana LokiIntroduction to Grafana Loki
Introduction to Grafana Loki
 
Getting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and GrafanaGetting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and Grafana
 
Prometheus monitoring
Prometheus monitoringPrometheus monitoring
Prometheus monitoring
 
Loki - like prometheus, but for logs
Loki - like prometheus, but for logsLoki - like prometheus, but for logs
Loki - like prometheus, but for logs
 
OpenTelemetry For Operators
OpenTelemetry For OperatorsOpenTelemetry For Operators
OpenTelemetry For Operators
 
Grafana introduction
Grafana introductionGrafana introduction
Grafana introduction
 
Fall in Love with Graphs and Metrics using Grafana
Fall in Love with Graphs and Metrics using GrafanaFall in Love with Graphs and Metrics using Grafana
Fall in Love with Graphs and Metrics using Grafana
 
Centralized Logging System Using ELK Stack
Centralized Logging System Using ELK StackCentralized Logging System Using ELK Stack
Centralized Logging System Using ELK Stack
 
Prometheus design and philosophy
Prometheus design and philosophy   Prometheus design and philosophy
Prometheus design and philosophy
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?
 
Distributed tracing using open tracing & jaeger 2
Distributed tracing using open tracing & jaeger 2Distributed tracing using open tracing & jaeger 2
Distributed tracing using open tracing & jaeger 2
 

Similar to Graylog Engineering - Design Your Architecture

Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...javier ramirez
 
Low latency in java 8 v5
Low latency in java 8 v5Low latency in java 8 v5
Low latency in java 8 v5Peter Lawrey
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practiceswebuploader
 
PASS Spanish Recomendaciones para entornos de SQL Server productivos
PASS Spanish   Recomendaciones para entornos de SQL Server productivosPASS Spanish   Recomendaciones para entornos de SQL Server productivos
PASS Spanish Recomendaciones para entornos de SQL Server productivosJavier Villegas
 
Architecting and productionising data science applications at scale
Architecting and productionising data science applications at scaleArchitecting and productionising data science applications at scale
Architecting and productionising data science applications at scalesamthemonad
 
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Brian Brazil
 
Apache Con 2008 Top 10 Mistakes
Apache Con 2008 Top 10 MistakesApache Con 2008 Top 10 Mistakes
Apache Con 2008 Top 10 MistakesJohn Coggeshall
 
Distributed tracing 101
Distributed tracing 101Distributed tracing 101
Distributed tracing 101Itiel Shwartz
 
Architecting a Large Software Project - Lessons Learned
Architecting a Large Software Project - Lessons LearnedArchitecting a Large Software Project - Lessons Learned
Architecting a Large Software Project - Lessons LearnedJoão Pedro Martins
 
High Performance Mysql
High Performance MysqlHigh Performance Mysql
High Performance Mysqlliufabin 66688
 
Writing and testing high frequency trading engines in java
Writing and testing high frequency trading engines in javaWriting and testing high frequency trading engines in java
Writing and testing high frequency trading engines in javaPeter Lawrey
 
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareBeyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareQuantum Leaps, LLC
 
10 things you're doing wrong in Talend
10 things you're doing wrong in Talend10 things you're doing wrong in Talend
10 things you're doing wrong in TalendMatthew Schroeder
 

Similar to Graylog Engineering - Design Your Architecture (20)

Spring batch
Spring batchSpring batch
Spring batch
 
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
 
Low latency in java 8 v5
Low latency in java 8 v5Low latency in java 8 v5
Low latency in java 8 v5
 
Hadoop bank
Hadoop bankHadoop bank
Hadoop bank
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practices
 
PASS Spanish Recomendaciones para entornos de SQL Server productivos
PASS Spanish   Recomendaciones para entornos de SQL Server productivosPASS Spanish   Recomendaciones para entornos de SQL Server productivos
PASS Spanish Recomendaciones para entornos de SQL Server productivos
 
Architecting and productionising data science applications at scale
Architecting and productionising data science applications at scaleArchitecting and productionising data science applications at scale
Architecting and productionising data science applications at scale
 
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
 
Apache Con 2008 Top 10 Mistakes
Apache Con 2008 Top 10 MistakesApache Con 2008 Top 10 Mistakes
Apache Con 2008 Top 10 Mistakes
 
Distributed tracing 101
Distributed tracing 101Distributed tracing 101
Distributed tracing 101
 
pm1
pm1pm1
pm1
 
Speed up sql
Speed up sqlSpeed up sql
Speed up sql
 
Architecting a Large Software Project - Lessons Learned
Architecting a Large Software Project - Lessons LearnedArchitecting a Large Software Project - Lessons Learned
Architecting a Large Software Project - Lessons Learned
 
Kafka internals
Kafka internalsKafka internals
Kafka internals
 
High Performance Mysql
High Performance MysqlHigh Performance Mysql
High Performance Mysql
 
Writing and testing high frequency trading engines in java
Writing and testing high frequency trading engines in javaWriting and testing high frequency trading engines in java
Writing and testing high frequency trading engines in java
 
Distributed Tracing
Distributed TracingDistributed Tracing
Distributed Tracing
 
Concurrency and parallel in .net
Concurrency and parallel in .netConcurrency and parallel in .net
Concurrency and parallel in .net
 
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareBeyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
 
10 things you're doing wrong in Talend
10 things you're doing wrong in Talend10 things you're doing wrong in Talend
10 things you're doing wrong in Talend
 

Recently uploaded

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Graylog Engineering - Design Your Architecture

  • 2. README. This is not a guide for the squeamish. This is a peek for those who like to go off the beaten path, sometimes alone. For those who aren’t afraid of pulling open the hood and getting their hands dirty. This is the culmination of five years of engineering design in our hope to bring you the fastest machine data processing engine on the planet. Don’t call your sales rep, they won’t know the answers. -GRAYLOG ENGINEERING
  • 3. 1. 2. 3. 4. 4 1/2 5. 6. 7. 8. 9. LEGEND: 1 & 2. LOG MESSAGES & LOAD BALANCER. 3. TRANSPORT LAYER. 4. PROCESSING CHAIN. 4½ - REST API. 5. MONGODB REPLICA SET. 6. ELASTICSEARCH CLUSTER. 7. ANATOMY OF A SINGLE INDEX. 8. INDEX MODEL. 9. DEFLECTOR QUEUE.
  • 4. 1 & 2, LOG MESSAGES & LOAD BALANCER. tl;dr We’re not going to spend any time here. Basically, send us any machine data (structured or not) and use whatever load balancer you like. The # of messages, their peak rates, average size and extractions performed will affect performance, but we’ll cover that later.
  • 5. 3, TRANSPORT LAYER. This is the inputs and journal on top of the Graylog server. It consists of inputs from the message cloud (this is our syslog stream, as well as other inputs). These get pre-processed without user configurability into parts of a message. While the journal is on disk (I/O), it is an *append only* journal where there is no seek time. (Internally we re-use Apache Kafka code to do this - thanks LinkedIn). The write “needle” is always close to the same point on the disk so it does not constantly scan. This makes it blazing fast. You can turn it off, but we do not recommend it. Why we did this: Other systems do not have this, so they will lose messages coming in when message spikes happen because the network layer will start to reject them or your local memory will explode.
  • 6. 4, PROCESSING CHAIN. These messages are then taken and written into a process buffer, which is a ring buffer. We are using the Disruptor library from LMAX, a high speed trading company that relies on high speed and low latency. Messages are then processed by the process buffer processor, where stream routing and extracting of fields happens. This part can get CPU intensive! The filtered message then goes into the output buffer (another ring buffer), then the output buffer processor, and onwards to Elasticsearch (ES) or user defined output. ProTip: Tuning the number of processors run per buffer is important and should never exceed the number of CPU cores you have available for graylog-server. Increase number of processors if you see too low throughput and try to focus on process buffer processors because the output buffer usually does not need many. A symptom of not enough processors is full buffers.
  • 7. 4½ , REST API. Why is this different than any other rest API? This is the same API we use on our web front end, hence you can make any read/write call we do in your own UI. Yup, you can build your own front end. Also, it has to be high quality, because this is the same API we use ourselves day to day. It is not like others where it is just an API that is provided for external users to integrate with, built once and patched with duct tape every release. Not that we don’t like duct tape….
  • 8. 5, MONGO. Then there is Mongo, which is storing only metadata: users, settings and configuration data on all items: streams, dashboards, extractors, etc. Anything you configure. If Mongo goes down, Graylog will continue to run. So, it is your choice whether to include it in a high availability design. Mongo recommends for HA scenario’s three instances of it. This is because if one goes down then Mongo has to recommend a primary, and without two more it can get confused between the first two. See Mongo Replication set for instructions.
  • 9. 6, ELASTICSEARCH CLUSTER. We connect to ES servers as an embedded ES node that does not store data. So, we look and act like an ES node, and know about configuration data (indexes, shards, etc) for each ES server. When writing to ES and when you are not a node, you have encode and transmit over the wire as HTTP and then JSON and then decode it, etc. As a node you can send it in native format, and it is fast. For HA, we recommend having at least one replica configured.
  • 10. 7, ANATOMY OF AN INDEX. A single index (In this example, Graylog Index #25), is broken into shards. This means the index is broken up and the parts are run on different ES nodes. This makes for faster searches because the query result can be computed on multiple ES nodes in parallel. An index can also have replicas configured. This means that each shard is mirrored to other nodes, which is great for HA.
  • 11. 8, INDEX MODEL. Each index is numbered starting with 0 the first time. In a time series database, all data is stored with a time stamp, and once it is stored it is not gone back to be re- written (hence is marked as READ_ONLY vs WRITE_ACTIVE for performance). So, messages are not gone back to be re-inserted. This makes it fast. Because of the time based storage, this also means when you query it you must give a time bound search (i.e. in the last hour…). Pro Tip: So the size of these indexes matter when performance tuning. You don’t want to make the indexes too big because then the searches will take much longer, and you don’t want them too short for the same reason. The indexes should be sized based on the amount of data a you have and how far you normally search. Sometimes people use it for longer historical strategic type searches. It is important to know and size this correctly.
  • 12. 9, DEFLECTOR. We write to an index alias called ‘deflector’ that can be atomically switched to a new index. This allows us not to worry about having to stop message processing when creating a new index because that is error-prone to manage (oh, index #25 is now closed, ahh wait, okay the next one is #26, go ahead and write). Why are we telling you this? Because, well, it’s these kinds of things that makes us different. We are proud of thinking about all the small things that give you great performance and stability, and hope you have enjoyed reading this as much as we did writing it.