why is my solr slow?: presented by mike drob, cloudera

25
OCTOBER 11-14, 2016 BOSTON, MA

Upload: lucidworks

Post on 07-Jan-2017

69 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

OCTOBER 11-14, 2016 • BOSTON, MA

Page 2: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Why is my Solr slow?Mike Drob

Software Engineer, Cloudera

Page 3: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Who Am I?● Apache HTrace (Incubating) Committer● Software Engineer @ Cloudera● Middle School LEGO Robotics Mentor

Page 4: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Outline● The need for tracing● HTrace introduction● Examples with Solr● Finding the slow server!

Page 5: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Scenario● User complains that queries are “slow”

● Caches?● Or faceting?● Or sorting?● Or...?

Page 6: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

The State of the ArtRun a query with debug=timing:

"timing":{ "time":178.0, "prepare":{"time":7.0, "query":{"time":4.0}} "process":{"time":160.0, "query":{"time":118.0}, "facet":{"time":33.0}}

Page 7: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

What is Apache HTrace● Distributed Tracing Library● Primitive Type is the “Span”

● Unique ID● Source + Description● Start/Stop Time● Additional Metadata

● See Also: Dapper, Zipkin, Wingtips

Page 8: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Reference Architecture

ApplicationTraceGen

ApplicationTraceGen

ApplicationTraceGen

ApplicationTraceGen

Collector

Page 9: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Example Architecture

Solr

trace

Solr

trace

Solr

trace

Solr

trace

htraced

Page 10: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

How Do I Trace?● Can Trace Any “Unit Of Work”

● Method Calls● Threads● RPCs doQuery();

try (TraceScope scope = tracer.newScope(“work”)) { doQuery();}

Page 11: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

What Does It Look Like?

● Trace of q=*:* and resulting sub-queries● Data modeled on debug=timing

Page 12: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Aside: Benefits over debug=timing● Separate time-lines for each server● Ability to mark annotations● Data stored for later analysis● Trace non-query requests● Trace calls to other systems

Page 13: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Something More Complex

techproducts/select?q=*:*&facet.field=popularity

Page 14: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

And Other Commands

Page 15: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

And Other Commands

Page 16: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Configuration● New section in solr.xml<trace> <str name="span.receiver.classes">org.apache.htrace.impl.HTracedSpanReceiver</str> <str name="htraced.receiver.address">trace-server:9075</str> <str name="sampler.classes">org.apache.htrace.core.ProbabilitySampler</str></trace>

● Sampler Options● Advanced: Force Trace

… traceid=<64-bit> …

● Advanced: Buffer Options

Page 17: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Performance● Each trace add ~25ns of overhead

● Search handler can generate ~20 traces● Traces are buffered in memory● May consider multiple recievers

Page 18: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Future Work● Add tracing to clients (SolrJ)● Leverage MDC logging● Async Requests

Page 19: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Demo

Page 20: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Demo (Backup) "responseHeader":{ "zkConnected":true, "status":0, "QTime":5251, "params":{ "q":"*:*", "indent":"on", "wt":"json", "_":"1476334957442"}},

Page 21: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Demo (Backup)

Page 22: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Demo (Backup)

Page 23: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Demo (Backup)

Page 24: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Demo (Backup)

Page 25: Why Is My Solr Slow?: Presented by Mike Drob, Cloudera

Thank you [email protected] @mikhaildrob