Closed
Bug 1390320
Opened 9 years ago
Closed 9 years ago
Dataset API should set the number of rdd partitions relative to available default parallelism
Categories
(Data Platform and Tools :: General, enhancement)
Data Platform and Tools
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: amiyaguchi, Assigned: tcsc)
References
Details
Attachments
(1 external file)
Currently the moztelemetry Dataset api partitions the raw heka using information about the files on disk.[1]
It might be worthwhile to make the number of partitions relative to the available default parallelism provided to the spark context. This may make processing the data faster, in the context of main_summary and sync_summary.
The general guideline is to have 2-4 partitions per cpu.[2] This ends up being 1-2x sc.defaultParalleism.
[1] https://github.com/mozilla/moztelemetry/blob/master/src/main/scala/com/mozilla/telemetry/heka/Dataset.scala#L73
[2] https://spark.apache.org/docs/latest/rdd-programming-guide.html#parallelized-collections
Comment 1•9 years ago
|
||
I have done similar work on the python api. The approach I found to work better is to have a slightly different grouping function [1], which takes into account both the number of files and the size of each file.
Setting the number of partitions based on sc.defaultParallelism doesn't work well in this case because the file size is not uniform and there's no guarantee that the partitions will be balanced.
I would suggest to implement the same functionality in scala.
[1] https://github.com/mozilla/python_moztelemetry/blob/b7a59c84a7dfa7d89d3e8dcd2ebb3ba8ae70c60c/moztelemetry/dataset.py#L26-L41
| Reporter | ||
Comment 2•9 years ago
|
||
I'd like to do some testing before further discussion, but I think the number of rdd partitions affects the parallelism of operations downstream. A second-hand account describes a lack of parallelism when using the Dataset API.[1][2]
I guess the downside is that repartitioning is slow and forces a shuffle at the beginning of the job.
[1] http://logs.glob.uno/?c=mozilla%23datapipeline&s=14+Aug+2017&e=14+Aug+2017#c28949
[2] http://logs.glob.uno/?c=mozilla%23datapipeline&s=14+Aug+2017&e=14+Aug+2017#c28964
| Assignee | ||
Comment 3•9 years ago
|
||
I hope nobody minds that I took this. It was causing issues in a zeppelin notebook, and I'd like to land something very similar to that notebook into telemetry batch view.
Assignee: nobody → tchiovoloni
| Assignee | ||
Comment 4•9 years ago
|
||
| Assignee | ||
Comment 5•9 years ago
|
||
This has landed and is in new versions of moztelemetry, resolving as fixed.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•4 years ago
|
Component: Telemetry APIs for Analysis → General
You need to log in
before you can comment on or make changes to this bug.
Description
•