51zero / 51zero/eel-sdk

limit parallelism of ParquetSource to reduce memory footprint

Đang mở
#382 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Scala
Star
147
Fork
32
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi!

I set up a ParquetSource with a JDBCSink and ran into memory issues.
The parquet files are stored in an s3 bucket and have been written by spark (snappy-compressed ~500 MByte).

Spark writes one file per partition (default=200). This causes eel to use lots of memory since many subscriptions are submitted to the executor, although I set up the stream like this `source.toDataStream().to(sink, parallelism = 1)`

In the code I found that you initialize the executor like this `val executor = Executors.newCachedThreadPool()` which creates an unbounded ThreadPool.

I did some experiments and repartitioned the spark dataframe to 1 and stored it again. Here's the comparison (see screenshots below):
memory usage of the 200 files parquet source: >1.2 Gbyte*
memory usage of the 1 file parquet source: 83 MByte constantly.

(*) I let it run on my local machine with normal DSL internet connection. On the server it ran oom pretty quickly - meaning it used more than 2GByte (my XmX setting for the app).

![image](https://user-images.githubusercontent.com/39078/40673447-1f702fae-6372-11e8-99a2-828d96b66a1f.png)

![image](https://user-images.githubusercontent.com/39078/40673462-2a1367dc-6372-11e8-8269-6ff53f90fa3e.png)

Can you think of a way to limit the amount of parallelism? Happy to provide a merge request if you point me in the right direction.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Look at the ParquetSource implementation to find where the Executors.newCachedThreadPool() is used. Understand how the source handles multiple files and subscriptions. The goal is to modify the thread pool initialization to allow limiting parallelism, perhaps by adding a configurable parameter. Check existing tests for ParquetSource to see how to validate changes.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
hadoop, scala, spark
Lĩnh vực
data-engineering, stream-processing
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.