SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
ElasticSearch London
Tuning ElasticSearch for multi-terabyte analytics
or… “Counting stuff is hard”
Andrew Clegg
Data Analytics & Visualization Team
Pearson
@andrew_clegg
Introduction
Our data
Over 11 billion “docs” in production cluster.
Each doc is around 1-2KB of JSON.
~60 million docs/day == ~700 docs/sec.
Higher than this during peak times.
Much higher when backfilling historical data.
Conversely: not many end users yet: 5-20 on a typical day.
Our architecture

Palomino
Getting data in
Hardware
(Yes, actual hardware!)
Cisco UCS servers, 24 cores, 96GB memory.
8 x 1TB disks.
7 for data, 1 for log files, temp files, etc.
Reads/writes parallelized across segments.
Currently 5 of these in production cluster.
10GB switch.
Getting data in
Index configuration
We don’t store any data in ElasticSearch. All we need is facet counts.
Disable _source, _all, and individual field storage.
Disable term vectors and norms.
No analysis on text fields (just unbroken strings).
No date autodetection.
Getting data in
Weekly rolling indices mean shard level can increase as traffic does
Time (new index each week)
Shard count

NB currently we have steady state so it’s set to 5 shards each week.
3 replicas per shard (including primary).
Real-time implies: can’t disable replication during indexing!
Getting data in
Client configuration
Multiple writer threads on multiple machines: currently 6 x 3.
Bulk API: currently up to 1000 docs per batch.
Incoming docs queued until batch limit, or time or size limits, reached.
(e.g. 1000 docs or 100000 bytes or 2 secs since last batch)
Getting data in
Other things we could do -- but currently don’t
Tune indexer thread pool size?
Tune segment merge policy?
Reduce flush interval?
Even without these, our current record is over 20,000 docs indexed/sec.
(And think the bottleneck was the client machines…)
Getting data out
Typical queries
Date histogram and terms facet are the most common by far.
So we wrote our own versions with some optimizations :-)
https://github.com/pearson-enabling-technologies/elasticsearch-approx-plugin
Field data cache size important for speed: currently 30% of 80GB heap.
(In fact it actually uses much more than this, with ES 0.90.2. Upgrade planned!)
We always use search_type=count.
Getting data out
Facet workflow
Client
request

Data nodes:
● Find matching records
● Perform groupings and counts
(and any other calculations)
● Return to master

Arbitrary master node:
● Parses query
● Distributes subqueries to data nodes
(including itself)
● Combines results (reduce function)
● Returns to client
Getting data out
Facet plugin optimizations
Approximate data structures and sampling mode:
Trade between speed/memory and accuracy.
Uses Lucene’s BytesRef & BytesRefHash instead of String & HashSet.
Micro-caching of local calculations, e.g. timestamp rounding.
Explicit “render” phase after “reduce” phase:
Defer as much as possible until then.
Getting data out
General advice for plugin writers
Minimize object creation/destruction and type conversions.
Use arrays of primitives, or Trove collections, where possible. Reuse buffers.
Release objects as soon as possible when no longer needed.
Lucene has some neat tricks: bit fields, fast hashing algorithms.
So does ElasticSearch: CacheRecycler lets you reuse collections.
Getting data out
Hints for query performance tuning
Tools like jmap, jstat, Visual VM and MAT are very helpful.
Use ES “hot threads” API to see where it’s spending its time.
Set up unit/integration tests with time and RAM instrumentation.
Getting data out
Other things we could do -- but currently don’t
Non-data nodes to parse queries, and handle reduce & render phases.
Garbage collector tuning.
(Note to self: see if Trove still crashes Java 7 JVM under G1 GC…)
Use SSDs :-)
Thanks!
Any questions?
https://github.com/pearson-enabling-technologies/
https://twitter.com/andrew_clegg

Mais conteúdo relacionado

Destaque

Data Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlationsData Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlationsDatamining Tools
 
[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화NAVER D2
 
Elasticsearch in Netflix
Elasticsearch in NetflixElasticsearch in Netflix
Elasticsearch in NetflixDanny Yuan
 
Scaling real-time search and analytics with Elasticsearch
Scaling real-time search and analytics with ElasticsearchScaling real-time search and analytics with Elasticsearch
Scaling real-time search and analytics with Elasticsearchclintongormley
 
Scaling an ELK stack at bol.com
Scaling an ELK stack at bol.comScaling an ELK stack at bol.com
Scaling an ELK stack at bol.comRenzo Tomà
 
Using Hadoop to build a Data Quality Service for both real-time and batch data
Using Hadoop to build a Data Quality Service for both real-time and batch dataUsing Hadoop to build a Data Quality Service for both real-time and batch data
Using Hadoop to build a Data Quality Service for both real-time and batch dataDataWorks Summit/Hadoop Summit
 
Logging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaLogging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaAmazee Labs
 
A Publisher's Survival Guide for the Platform Era
A Publisher's Survival Guide for the Platform EraA Publisher's Survival Guide for the Platform Era
A Publisher's Survival Guide for the Platform EraBloomberg Media
 

Destaque (8)

Data Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlationsData Mining: Mining ,associations, and correlations
Data Mining: Mining ,associations, and correlations
 
[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화
 
Elasticsearch in Netflix
Elasticsearch in NetflixElasticsearch in Netflix
Elasticsearch in Netflix
 
Scaling real-time search and analytics with Elasticsearch
Scaling real-time search and analytics with ElasticsearchScaling real-time search and analytics with Elasticsearch
Scaling real-time search and analytics with Elasticsearch
 
Scaling an ELK stack at bol.com
Scaling an ELK stack at bol.comScaling an ELK stack at bol.com
Scaling an ELK stack at bol.com
 
Using Hadoop to build a Data Quality Service for both real-time and batch data
Using Hadoop to build a Data Quality Service for both real-time and batch dataUsing Hadoop to build a Data Quality Service for both real-time and batch data
Using Hadoop to build a Data Quality Service for both real-time and batch data
 
Logging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaLogging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & Kibana
 
A Publisher's Survival Guide for the Platform Era
A Publisher's Survival Guide for the Platform EraA Publisher's Survival Guide for the Platform Era
A Publisher's Survival Guide for the Platform Era
 

Último

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Último (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Tuning ElasticSearch for multi-terabyte analytics

  • 1.
  • 2. ElasticSearch London Tuning ElasticSearch for multi-terabyte analytics or… “Counting stuff is hard” Andrew Clegg Data Analytics & Visualization Team Pearson @andrew_clegg
  • 4. Our data Over 11 billion “docs” in production cluster. Each doc is around 1-2KB of JSON. ~60 million docs/day == ~700 docs/sec. Higher than this during peak times. Much higher when backfilling historical data. Conversely: not many end users yet: 5-20 on a typical day.
  • 6. Getting data in Hardware (Yes, actual hardware!) Cisco UCS servers, 24 cores, 96GB memory. 8 x 1TB disks. 7 for data, 1 for log files, temp files, etc. Reads/writes parallelized across segments. Currently 5 of these in production cluster. 10GB switch.
  • 7. Getting data in Index configuration We don’t store any data in ElasticSearch. All we need is facet counts. Disable _source, _all, and individual field storage. Disable term vectors and norms. No analysis on text fields (just unbroken strings). No date autodetection.
  • 8. Getting data in Weekly rolling indices mean shard level can increase as traffic does Time (new index each week) Shard count NB currently we have steady state so it’s set to 5 shards each week. 3 replicas per shard (including primary). Real-time implies: can’t disable replication during indexing!
  • 9. Getting data in Client configuration Multiple writer threads on multiple machines: currently 6 x 3. Bulk API: currently up to 1000 docs per batch. Incoming docs queued until batch limit, or time or size limits, reached. (e.g. 1000 docs or 100000 bytes or 2 secs since last batch)
  • 10. Getting data in Other things we could do -- but currently don’t Tune indexer thread pool size? Tune segment merge policy? Reduce flush interval? Even without these, our current record is over 20,000 docs indexed/sec. (And think the bottleneck was the client machines…)
  • 11. Getting data out Typical queries Date histogram and terms facet are the most common by far. So we wrote our own versions with some optimizations :-) https://github.com/pearson-enabling-technologies/elasticsearch-approx-plugin Field data cache size important for speed: currently 30% of 80GB heap. (In fact it actually uses much more than this, with ES 0.90.2. Upgrade planned!) We always use search_type=count.
  • 12. Getting data out Facet workflow Client request Data nodes: ● Find matching records ● Perform groupings and counts (and any other calculations) ● Return to master Arbitrary master node: ● Parses query ● Distributes subqueries to data nodes (including itself) ● Combines results (reduce function) ● Returns to client
  • 13. Getting data out Facet plugin optimizations Approximate data structures and sampling mode: Trade between speed/memory and accuracy. Uses Lucene’s BytesRef & BytesRefHash instead of String & HashSet. Micro-caching of local calculations, e.g. timestamp rounding. Explicit “render” phase after “reduce” phase: Defer as much as possible until then.
  • 14. Getting data out General advice for plugin writers Minimize object creation/destruction and type conversions. Use arrays of primitives, or Trove collections, where possible. Reuse buffers. Release objects as soon as possible when no longer needed. Lucene has some neat tricks: bit fields, fast hashing algorithms. So does ElasticSearch: CacheRecycler lets you reuse collections.
  • 15. Getting data out Hints for query performance tuning Tools like jmap, jstat, Visual VM and MAT are very helpful. Use ES “hot threads” API to see where it’s spending its time. Set up unit/integration tests with time and RAM instrumentation.
  • 16. Getting data out Other things we could do -- but currently don’t Non-data nodes to parse queries, and handle reduce & render phases. Garbage collector tuning. (Note to self: see if Trove still crashes Java 7 JVM under G1 GC…) Use SSDs :-)