Skip to content

Conversation

@grcevski
Copy link
Owner

@grcevski grcevski commented Dec 17, 2019

When queries in Pinot run at high QPS rate, it would be desirable to keep a LRU cache of certain sizes for the parsed query objects. There's a lot of new objects being allocated and expensive ANTLR grammar parsing that goes into converting the query expression strings into parsed Pinot Queries.

This PR introduces two separate capped LRU caches for the purpose of removing the unnecessary overhead of ANTRL parsing. The caches are very similar to how the Metric Names are cached in AsbtractMetrics and this PR requires that change, because it relies on the same library for fast concurrent LRU caching.

Todo:

  • Write unit tests
  • Performance measurements on top of metrics-improvements
  • Pick good defaults for the capped LRU collections, 1000 was arbitrarily picked

Performance measurement results:

Machine configuration:
4 core (8 threads) Intel(R) Xeon(R) W-2123 CPU @ 3.60GHz
32GB of RAM
Linux x86-64, kernel: 5.0.0-37-generic

Benchmark configuration:
TPC-H (optimal index)
20 clients
180s runtime
Results (QPS higher is better, response time lower is better)

Base with (metrics-improvements):
Time Passed: 180.014s, Query Executed: 528540, QPS: 2936.104969613474, Avg Response Time: 6.800626253452908ms

Improved (this branch):
Time Passed: 180.018s, Query Executed: 554955, QPS: 3082.7750558277507, Avg Response Time: 6.476053013307386ms

Co-authored-by: @grcevski @charliegracie @macarte @adityamandaleeka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants