Apache Druid: a high performance real-time analytics database.
Go to file
Kashif Faraz 45a8fa280c
Add SegmentAllocationQueue to batch SegmentAllocateActions (#13369)
In a cluster with a large number of streaming tasks (~1000), SegmentAllocateActions 
on the overlord can often take very long intervals of time to finish thus causing spikes 
in the `task/action/run/time`. This may result in lag building up while a task waits for a
segment to get allocated.

The root causes are:
- large number of metadata calls made to the segments and pending segments tables
- `giant` lock held in `TaskLockbox.tryLock()` to acquire task locks and allocate segments

Since the contention typically arises when several tasks of the same datasource try
to allocate segments for the same interval/granularity, the allocation run times can be
improved by batching the requests together.

Changes
- Add flags
   - `druid.indexer.tasklock.batchSegmentAllocation` (default `false`)
   - `druid.indexer.tasklock.batchAllocationMaxWaitTime` (in millis) (default `1000`)
- Add methods `canPerformAsync` and `performAsync` to `TaskAction`
- Submit each allocate action to a `SegmentAllocationQueue`, and add to correct batch
- Process batch after `batchAllocationMaxWaitTime`
- Acquire `giant` lock just once per batch in `TaskLockbox`
- Reduce metadata calls by batching statements together and updating query filters
- Except for batching, retain the whole behaviour (order of steps, retries, etc.)
- Respond to leadership changes and fail items in queue when not leader
- Emit batch and request level metrics
2022-12-05 14:00:07 +05:30
.github Update gha & travis checks (#13412) 2022-12-02 15:06:31 +05:30
.idea Revert Accidental Change to Druid.xml (#13190) 2022-10-06 14:42:35 -07:00
benchmarks Prepare master branch for next release, 26.0.0 (#13401) 2022-11-22 15:31:01 +05:30
cloud Prepare master branch for next release, 26.0.0 (#13401) 2022-11-22 15:31:01 +05:30
codestyle Always return sketches from DS_HLL, DS_THETA, DS_QUANTILES_SKETCH. (#13247) 2022-11-03 09:43:00 -07:00
core Add SegmentAllocationQueue to batch SegmentAllocateActions (#13369) 2022-12-05 14:00:07 +05:30
dev Make http options the default configurations (#13092) 2022-10-05 05:35:17 +05:30
distribution Prepare master branch for next release, 26.0.0 (#13401) 2022-11-22 15:31:01 +05:30
docs Remove limit from timeseries (#13457) 2022-12-02 12:19:59 -08:00
examples Quieter streaming supervisors. (#13392) 2022-11-20 23:53:17 -08:00
extendedset Prepare master branch for next release, 26.0.0 (#13401) 2022-11-22 15:31:01 +05:30
extensions-contrib SQL test framework extensions (#13426) 2022-12-02 09:11:59 -08:00
extensions-core SQL test framework extensions (#13426) 2022-12-02 09:11:59 -08:00
helm/druid helm: add Kubernetes discovery support (#13262) 2022-10-28 15:09:48 +05:30
hll Prepare master branch for next release, 26.0.0 (#13401) 2022-11-22 15:31:01 +05:30
hooks Git hooks should fail on errors; pass args to git hooks (#12322) 2022-03-10 09:07:50 +09:00
indexing-hadoop Prepare master branch for next release, 26.0.0 (#13401) 2022-11-22 15:31:01 +05:30
indexing-service Add SegmentAllocationQueue to batch SegmentAllocateActions (#13369) 2022-12-05 14:00:07 +05:30
integration-tests MSQ Reindex IT (#13433) 2022-12-01 12:13:23 +05:30
integration-tests-ex MSQ Reindex IT (#13433) 2022-12-01 12:13:23 +05:30
licenses Web console: making the cell filter menu more functional, removing the old query view, and updating d3 (#13169) 2022-10-07 12:44:40 -07:00
processing Unnest functionality for Druid (#13268) 2022-12-02 18:48:25 -08:00
publications De-incubation cleanup in code, docs, packaging (#9108) 2020-01-03 12:33:19 -05:00
server Add SegmentAllocationQueue to batch SegmentAllocateActions (#13369) 2022-12-05 14:00:07 +05:30
services Prepare master branch for next release, 26.0.0 (#13401) 2022-11-22 15:31:01 +05:30
sql SQL test framework extensions (#13426) 2022-12-02 09:11:59 -08:00
web-console don't render duration if aggregated (#13455) 2022-11-30 19:21:07 -08:00
website doc: add a basic JDBC tutorial (#13343) 2022-11-30 16:25:35 -08:00
.asf.yaml Add .asf.yaml. (#9083) 2019-12-20 16:45:38 -08:00
.backportrc.json Add 0.18.0 to .backportrc.json to facilitate backport. (#9661) 2020-04-11 13:49:04 -07:00
.codecov.yml Use Codecov (#8388) 2019-08-28 08:49:30 -07:00
.dockerignore Add docker container for druid (#6896) 2019-02-08 12:12:28 +00:00
.gitignore Add CTA and fix typo (#13009) 2022-09-06 11:16:50 -07:00
.lgtm.yml be consistent about referring to the web console by its name (#13118) 2022-09-19 15:02:17 -07:00
.travis.yml Update gha & travis checks (#13412) 2022-12-02 15:06:31 +05:30
CONTRIBUTING.md Add missing MSQ error code fields to docs (#13308) 2022-11-10 21:03:04 +05:30
LABELS Add plain text README.txt, use relative link from README.md to build.md (#7611) 2019-05-09 21:29:26 -07:00
LICENSE support Aliyun OSS service as deep storage (#9898) 2020-07-01 22:20:53 -07:00
NOTICE Update year in the notice file and the release process instructions (#12622) 2022-08-23 18:17:18 +05:30
README.md be consistent about referring to the web console by its name (#13118) 2022-09-19 15:02:17 -07:00
README.template De-incubation cleanup in code, docs, packaging (#9108) 2020-01-03 12:33:19 -05:00
check_test_suite.py Adds license and security vulnerabilities checks for Hadoop3 build (#13270) 2022-11-09 14:50:31 +05:30
check_test_suite_test.py ignore licenses changes in check test script (#12964) 2022-08-25 12:31:28 -07:00
it.sh Building druid-it-tools and running for travis in it.sh (#12957) 2022-08-30 12:48:07 +05:30
licenses.yaml treat user cancelation seriously (#13376) 2022-11-18 14:04:16 -08:00
owasp-dependency-check-suppressions.xml Port CVE suppressions from 24.0.1 (#13415) 2022-11-23 11:35:33 +05:30
pom.xml Prepare master branch for next release, 26.0.0 (#13401) 2022-11-22 15:31:01 +05:30
upload.sh Adding licenses and enable apache-rat-plugin. (#6215) 2018-09-18 08:39:26 -07:00

README.md

Build Status Language grade: Java Coverage Status Docker Helm


Website | Twitter | Download | Get Started | Documentation | Community | Build | Contribute | License


Apache Druid

Druid is a high performance real-time analytics database. Druid's main value add is to reduce time to insight and action.

Druid is designed for workflows where fast queries and ingest really matter. Druid excels at powering UIs, running operational (ad-hoc) queries, or handling high concurrency. Consider Druid as an open source alternative to data warehouses for a variety of use cases. The design documentation explains the key concepts.

Getting started

You can get started with Druid with our local or Docker quickstart.

Druid provides a rich set of APIs (via HTTP and JDBC) for loading, managing, and querying your data. You can also interact with Druid via the built-in web console (shown below).

Load data

data loader Kafka

Load streaming and batch data using a point-and-click wizard to guide you through ingestion setup. Monitor one off tasks and ingestion supervisors.

Manage the cluster

management

Manage your cluster with ease. Get a view of your datasources, segments, ingestion tasks, and services from one convenient location. All powered by SQL systems tables, allowing you to see the underlying query for each view.

Issue queries

query view combo

Use the built-in query workbench to prototype DruidSQL and native queries or connect one of the many tools that help you make the most out of Druid.

Documentation

See the latest documentation for the documentation for the current official release. If you need information on a previous release, you can browse previous releases documentation.

Make documentation and tutorials updates in /docs using MarkDown and contribute them using a pull request.

Community

Visit the official project community page to read about getting involved in contributing to Apache Druid, and how we help one another use and operate Druid.

  • Druid users can find help in the druid-user mailing list on Google Groups, and have more technical conversations in #troubleshooting on Slack.
  • Druid development discussions take place in the druid-dev mailing list (dev@druid.apache.org). Subscribe by emailing dev-subscribe@druid.apache.org. For live conversations, join the #dev channel on Slack.

Check out the official community page for details of how to join the community Slack channels.

Find articles written by community members and a calendar of upcoming events on the project site - contribute your own events and articles by submitting a PR in the apache/druid-website-src repository.

Building from source

Please note that JDK 8 or JDK 11 is required to build Druid.

See the latest build guide for instructions on building Apache Druid from source.

Contributing

Please follow the community guidelines for contributing.

For instructions on setting up IntelliJ dev/intellij-setup.md

License

Apache License, Version 2.0