admin管理员组文章数量:1277888
I have a very computation based Spring Batch job that is executed with multiple threads. The job might be executed on different computers with different hardware.
I currently configured a chunk size of 1.000.000 but depending on the processor speed and the number of processors, the processing of one chunk might take from 30 seconds up to 1 hour.
Is there any pragmatic way, to adapt the chunk size dynamically based on the runtime of the last StepExecution
?
I have something like that in mind:
- Initial chunk size 1000; target runtime per step 5 minutes
- First chunk is processed and the real runtime was 1 minute --> increase chunk size by factor 5
- Set new chunk size is 5000
- Next chunk is processed within 5 minutes; no adaptation of chunk size necessary
Optionally scaling down:
- High workload on the system; real runtime was 10 minutes --> decrease of chunk size by factor 1/2 again
- ...
Is some mechanism like that possible to implement?
I have a very computation based Spring Batch job that is executed with multiple threads. The job might be executed on different computers with different hardware.
I currently configured a chunk size of 1.000.000 but depending on the processor speed and the number of processors, the processing of one chunk might take from 30 seconds up to 1 hour.
Is there any pragmatic way, to adapt the chunk size dynamically based on the runtime of the last StepExecution
?
I have something like that in mind:
- Initial chunk size 1000; target runtime per step 5 minutes
- First chunk is processed and the real runtime was 1 minute --> increase chunk size by factor 5
- Set new chunk size is 5000
- Next chunk is processed within 5 minutes; no adaptation of chunk size necessary
Optionally scaling down:
- High workload on the system; real runtime was 10 minutes --> decrease of chunk size by factor 1/2 again
- ...
Is some mechanism like that possible to implement?
Share Improve this question edited Feb 25 at 8:24 jonrsharpe 122k30 gold badges267 silver badges474 bronze badges asked Feb 25 at 8:22 OliverOliver 831 silver badge7 bronze badges1 Answer
Reset to default 0It is not possible to re-configure a step dynamically while it is running. You can definitely set the chunk-size dynamically at runtime before starting the step, but not once the step is started and is running. The chunk size will remain the same for all chunks.
本文标签: springDynamic chunk size based on step execution durationStack Overflow
版权声明:本文标题:spring - Dynamic chunk size based on step execution duration - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741219720a2360732.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论