Slackbot
12/13/2022, 5:29 AMMohit Garg
12/13/2022, 5:33 AMVijay Narayanan
12/13/2022, 5:37 AMVijay Narayanan
12/13/2022, 5:37 AMMohit Garg
12/13/2022, 5:37 AMMohit Garg
12/13/2022, 5:38 AMMohit Garg
12/13/2022, 5:38 AMMohit Garg
12/13/2022, 5:38 AMMohit Garg
12/13/2022, 5:38 AMMohit Garg
12/13/2022, 5:38 AMSergio Ferragut
12/13/2022, 5:14 PMdruid.indexer.runner.javaOptsArray?
In addition to all that, and as an alternate path which is usually better, are you on Apache Druid 24.0.x ? One of the great new features is SQL based batch ingestion, where you can use a SQL INSERT or REPLACE statement to ingest external data and it has better performance than the traditional index_parallel batch ingestion. Rollup becomes a SQL aggregation query such as:Sergio Ferragut
12/13/2022, 5:15 PMINSERT INTO "kttm_rollup"
WITH kttm_data AS (
SELECT * FROM TABLE(
EXTERN(
'{"type":"http","uris":["<https://static.imply.io/example-data/kttm-v2/kttm-v2-2019-08-25.json.gz>"]}',
'{"type":"json"}',
'[{"name":"timestamp","type":"string"},{"name":"agent_category","type":"string"},{"name":"agent_type","type":"string"},{"name":"browser","type":"string"},{"name":"browser_version","type":"string"},{"name":"city","type":"string"},{"name":"continent","type":"string"},{"name":"country","type":"string"},{"name":"version","type":"string"},{"name":"event_type","type":"string"},{"name":"event_subtype","type":"string"},{"name":"loaded_image","type":"string"},{"name":"adblock_list","type":"string"},{"name":"forwarded_for","type":"string"},{"name":"language","type":"string"},{"name":"number","type":"long"},{"name":"os","type":"string"},{"name":"path","type":"string"},{"name":"platform","type":"string"},{"name":"referrer","type":"string"},{"name":"referrer_host","type":"string"},{"name":"region","type":"string"},{"name":"remote_address","type":"string"},{"name":"screen","type":"string"},{"name":"session","type":"string"},{"name":"session_length","type":"long"},{"name":"timezone","type":"string"},{"name":"timezone_offset","type":"long"},{"name":"window","type":"string"}]'
)
))
SELECT
FLOOR(TIME_PARSE("timestamp") TO MINUTE) AS __time,
session,
agent_category,
agent_type,
browser,
browser_version,
MV_TO_ARRAY("language") AS "language", -- Multi-value string dimension
os,
city,
country,
forwarded_for AS ip_address,
COUNT(*) AS "cnt",
SUM(session_length) AS session_length,
APPROX_COUNT_DISTINCT_DS_HLL(event_type) AS unique_event_types
FROM kttm_data
WHERE os = 'iOS'
GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
PARTITIONED BY HOUR
CLUSTERED BY browser, sessionSergio Ferragut
12/13/2022, 5:20 PM"type":"s3" and in the input format type you can use "type":"parquet". This should be directly transferable from you current ioConfig and inputFormat settings in your current batch ingestion.Sergio Ferragut
12/14/2022, 5:17 PMMohit Garg
12/15/2022, 5:35 AMMohit Garg
12/15/2022, 5:54 AMMohit Garg
12/15/2022, 5:54 AMdruid_node_type: 'middleManager'
druid_worker_capacity: 10
DRUID_XMX: 5G
DRUID_XMS: 1G
DRUID_MAXDIRECTMEMORYSIZE: 2g
druid_processing_buffer_sizeBytes: '200000000'
druid_processing_numMergeBuffers: 2
druid_processing_numThreads: 2
druid_server_http_numThreads: 250
druid_indexer_runner_javaOptsArray: '["-server", "-Xms512m", "-Xmx1g", "-XX:MaxDirectMemorySize=2g", "-Duser.timezone=UTC", "-Dfile.encoding=UTF-8", "-XX:+ExitOnOutOfMemoryError", "-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager"]'
druid_indexer_fork_property_druid_processing_buffer_sizeBytes: '200000000'
druid_indexer_fork_property_druid_processing_numMergeBuffers: 2
druid_indexer_fork_property_druid_processing_numThreads: 2
druid_indexer_fork_property_druid_server_http_numThreads: 70
#new changes
druid_indexer_task_baseDir: "/opt/druid/var/druid/task_baseDir"
druid_indexer_task_baseTaskDir: "/opt/druid/var/druid/baseTaskDir"
druid_indexer_task_restoreTasksOnRestart: true
druid_processing_tmpDir: "/opt/druid/var/druid/tmpDir"
druid_indexer_storage_type: "metadata"
druid_realtime_cache_useCache: true
druid_realtime_cache_populateCache: true
druid_cache_type: caffeine
#groupby
druid_query_groupBy_maxMergingDictionarySize: "100000000"
druid_query_groupBy_maxOnDiskStorage: "10000000000"Sergio Ferragut
12/15/2022, 5:04 PM(druid.processing.numThreads + druid.processing.numMergeBuffers + 1) * druid.processing.buffer.sizeBytes for the forked process = 1G, and more heap will help, so you could invert them heap=2G and maxDirect = 1G
• that implies a total of 3G * 10 peons = 30G - if you have more, add more to the heap.
• worker capacity set to 10 implies that you have 11 CPUs available to the MM. If you have less CPUs, reduce this number and redistribute the memory among the number of peons you end up with.
• If you go down the SQL-Based Ingestion path, there's a really good explanation of how memory is used in the peons/workers here.
Finally in a little shameless self promotion, I wrote this blog post yesterday speaking of using SQL to do Rollup ingestion, including approximations. I hope you find it useful.