You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2020/12/03 13:59:35 UTC

[GitHub] [hudi] ygordefraga opened a new issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

ygordefraga opened a new issue #2280:
URL: https://github.com/apache/hudi/issues/2280


   Hi there,
   
   I have a problem with writing when there are many partitions. 
   
   ### Data
   
   The DataFrame i'm working with is pretty simple. It contains all the messages sent by the organizations.
   
   message_id |timestamp|status|organization_id|year|month|day
   ------------ | -------------|-------------| -------------| -------------| -------------| -------------
   bdabfa6f-2a3e-4c17-acd7-350227473ae4  | 2020-11-25T10:00:00Z|SENT | 0b38bec3-15ac-4e57-9bb9-48d7de412ffa | 2020 | 11 | 25
   203d5495-9b5d-4003-b7f3-ab312a70db40 |2020-11-25T11:00:00Z |SENT | 75e498d4-c979-4a12-b8df-1051c7976d34 | 2020 | 11 | 24
   09fa0543-cf5a-4e6b-9d16-ad14a8a7058a | 2020-10-22T09:00:00Z|NOT_SENT | 0b38bec3-15ac-4e57-9bb9-48d7de412ffa | 2020 | 10 | 22
   
   ### Previous Scenario (Good performance)
   
   Writing was taking about a **40 seconds** to write **100k rows** when partitioning contained **year**, **month** and **day** only. But this kind of partitioning was not the best for my use case. 
   
   _Partitions_
   
   ```
   year=2020/month=10/day=22
   year=2020/month=11/day=24
   year=2020/month=11/day=25
   ```
   
   ### Current Scenario (Bad performance)
   
   I changed partitioning to have **organization_id** before the other partitions. In this approach the writing time has increased considerably and now it takes about **5 minutes** to write **100k rows**. There are **hundreds** of organizations and each of them will have a partition per day.
   
   _Partitions_
   
   ```
   
   organization_id=0b38bec3-15ac-4e57-9bb9-48d7de412ffa/year=2020/month=10/day=22
   organization_id=75e498d4-c979-4a12-b8df-1051c7976d34/year=2020/month=11/day=24
   organization_id=0b38bec3-15ac-4e57-9bb9-48d7de412ffa/year=2020/month=11/day=25
   ```
   
   _Execution time_
   
   ![Screenshot from 2020-11-26 14-22-07](https://user-images.githubusercontent.com/20543207/100381963-fabcbc80-2ff8-11eb-9770-05fac8a572e9.png)
   
   ### Configuration
   
   Both approaches use the same configs. Some settings were based on the [Tuning Guide](https://cwiki.apache.org/confluence/display/HUDI/Tuning+Guide).
   
   _Hudi Configs_
   
   ```
   "hoodie.datasource.write.insert.drop.duplicates" -> "true"
   "hoodie.insert.shuffle.parallelism" -> "27"
   "hoodie.finalize.write.parallelism" -> "27"
   "hoodie.datasource.write.recordkey.field" -> "message_id"
   "hoodie.datasource.write.precombine.field" -> "timestamp"
   "hoodie.datasource.write.partitionpath.field" -> "organization_id,year,month,day"
   "hoodie.datasource.write.keygenerator.class" -> classOf[ComplexKeyGenerator].getName
   ```
   
   _Spark submit configs_
   
   ```
     ...
     --driver-memory 4G \
     --executor-memory 8G \
     --executor-cores 3 \
     --num-executors 3 \
     ...
     --conf spark.driver.memoryOverhead=1024 \
     --conf spark.executor.memoryOverhead=2048 \
     --conf spark.memory.fraction=0.9 \
     --conf spark.memory.storageFraction=0.2 \
     --conf spark.sql.shuffle.partitions=27 \
     --conf spark.default.parallelism=27 \
     --conf spark.sql.hive.convertMetastoreParquet=false \
     --conf spark.serializer=org.apache.spark.serializer.KryoSerializer \
     --conf spark.rdd.compress=true \
     --conf spark.shuffle.service.enabled=true \
     --conf spark.executor.extraJavaOptions="-XX:NewSize=1g -XX:SurvivorRatio=2 -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:CMSInitiatingOccupancyFraction=70 -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+PrintTenuringDistribution -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/hoodie-heapdump.hprof -Dlog4j.configuration=log4j-executor.properties -Dvm.logging.level=ERROR -Dvm.logging.name=UsageHudiStream -Duser.timezone=UTC" \
   ```
   What's missing in the configs?
   
   > Hudi Version = 0.5.2
   > Spark Version = 2.4.5
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga removed a comment on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
ygordefraga removed a comment on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-736666402


   >> Please note that the next version of hudi will come with consolidated metadata which will remove the listing altogether.
   
   What you mean with that?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] bvaradar commented on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
bvaradar commented on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-735927848


   @ygordefraga : This could be coming from the increase in the number of partitions.
   This could be related to https://github.com/apache/hudi/issues/2269#issuecomment-733299492 
   
   Also, note that since you increased the number of partition with the additional partitioning level, keeping the same number of executors wont be exactly apples-to-apples comparison.
   
   Can you try 0.6.0 (which has incremental cleaning support) to see if you get better performance.
   Please note that the next version of hudi will come with consolidated metadata which will remove the listing altogether.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga removed a comment on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
ygordefraga removed a comment on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-738010863


   I used Hudi 0.5.3 and this are the results:
   
   ![Screenshot from 2020-12-03 10-19-52](https://user-images.githubusercontent.com/20543207/101027135-803ef000-3556-11eb-98e6-e555bd10d2e9.png)
   
   Thank you, guys!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga closed issue #2280: [SUPPORT] Simple record key and composite partition

Posted by GitBox <gi...@apache.org>.
ygordefraga closed issue #2280:
URL: https://github.com/apache/hudi/issues/2280


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] bvaradar commented on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
bvaradar commented on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-736750785


   > > Please note that the next version of hudi will come with consolidated metadata which will remove the listing altogether.
   > 
   > What do you mean with that?
   
   The File listing improvements as mentioned in https://cwiki.apache.org/confluence/display/HUDI/RFC+-+15%3A+HUDI+File+Listing+and+Query+Planning+Improvements will be available in 0.7 release.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga removed a comment on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
ygordefraga removed a comment on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-733991146


   ![Screenshot from 2020-11-25 20-32-52](https://user-images.githubusercontent.com/20543207/100291781-749f6800-2f5d-11eb-9726-8c27ed55bf50.png)
   
   That's a picture of the time it takes to process the data with partitions by organization_id.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] vinothchandar commented on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
vinothchandar commented on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-735945530


   Looks like balaji did beat me to it.  :) 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga commented on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
ygordefraga commented on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-736666402


   >> Please note that the next version of hudi will come with consolidated metadata which will remove the listing altogether.
   
   What you mean with that?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga commented on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
ygordefraga commented on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-736807941


   Writing got better after setting the `hoodie.clean.automatic=false` . I'll try hudi 0.6 (or 0.5.3), compare and post it here.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] bvaradar commented on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
bvaradar commented on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-736752118


   Regarding the bundle issue, the workaround posted should have worked. Another option is to try 0.5.3 which has the support too. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga commented on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
ygordefraga commented on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-738010863


   I used Hudi 0.5.3 and this are the results:
   
   ![Screenshot from 2020-12-03 10-19-52](https://user-images.githubusercontent.com/20543207/101027135-803ef000-3556-11eb-98e6-e555bd10d2e9.png)
   
   Thank you, guys!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga commented on issue #2280: [SUPPORT] Composite partition performance

Posted by GitBox <gi...@apache.org>.
ygordefraga commented on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-733991146


   ![Screenshot from 2020-11-25 20-32-52](https://user-images.githubusercontent.com/20543207/100291781-749f6800-2f5d-11eb-9726-8c27ed55bf50.png)
   
   That's a picture of the time it takes to process the data with partitions by organization_id.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga commented on issue #2280: [SUPPORT] Composite partition performance

Posted by GitBox <gi...@apache.org>.
ygordefraga commented on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-733833453


   I changed the subject of this support issue because I already solved the problem I had before.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga commented on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
ygordefraga commented on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-736666569






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga removed a comment on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
ygordefraga removed a comment on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-736666569


   > Please note that the next version of hudi will come with consolidated metadata which will remove the listing altogether.
   What do you mean with that?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga removed a comment on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
ygordefraga removed a comment on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-733833453


   I changed the subject of this support issue because I already solved the problem I had before.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga commented on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
ygordefraga commented on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-736806224


   > Regarding the bundle issue, the workaround posted should have worked. Another option is to try 0.5.3 which has the support too.
   
   I'll try it again.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga commented on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
ygordefraga commented on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-736580869


   > @ygordefraga : This could be coming from the increase in the number of partitions.
   > This could be related to [#2269 (comment)](https://github.com/apache/hudi/issues/2269#issuecomment-733299492)
   > 
   > Also, note that since you increased the number of partition with the additional partitioning level, keeping the same number of executors wont be exactly apples-to-apples comparison.
   > 
   > Can you try 0.6.0 (which has incremental cleaning support) to see if you get better performance.
   > Please note that the next version of hudi will come with consolidated metadata which will remove the listing altogether.
   
   Does "hoodie.clean.automatic" available on hudi 0.5.2? And does clean make sense for COW tables when there is no upsert? (my case)? What cleaning does in this situation?
   
   I tried Hudi 0.6, but I faced this [issue](https://issues.apache.org/jira/browse/HUDI-1117) and could not solve it. Any suggestion about that?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga commented on issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
ygordefraga commented on issue #2280:
URL: https://github.com/apache/hudi/issues/2280#issuecomment-738011563


   I used Hudi 0.5.3 and the results were really good.
   
   ![Screenshot from 2020-12-03 10-19-52](https://user-images.githubusercontent.com/20543207/101027340-aa90ad80-3556-11eb-8565-8ac134eee182.png)
   
   Thank you, guys!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] ygordefraga closed issue #2280: [SUPPORT] Slow insert into COW tables with multi level partitions

Posted by GitBox <gi...@apache.org>.
ygordefraga closed issue #2280:
URL: https://github.com/apache/hudi/issues/2280


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org