Тёмный

Mule 4 | Parallel For Each | Optimising Max concurrency | Calculate Parallelism 

Vishwas Pawar
Подписаться 5 тыс.
Просмотров 11 тыс.
50% 1

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 22   
@jacekbiaecki8076
@jacekbiaecki8076 2 года назад
Absolutely premium content - as always. Thank you! This fragment: "They will be fighting among them...... Emmm... Not fighing because they all are gentlemen. They will be struggling for..." This one was funny ;-)
@pateeluyou
@pateeluyou 3 года назад
Nice one. It helped me to consider proper concurrency in my app. Thank you.
@HaiNaZheng
@HaiNaZheng Год назад
Great videp but It would be very helpful if the processors got named properly.
@kedareshwarawasthi2383
@kedareshwarawasthi2383 3 месяца назад
Can you shed some light on how we can make parallel for each to execute sequentially like for each . I have been seeing some of those claims in the community with transaction scope or something. Thank you
@DanielEsquerdo
@DanielEsquerdo 11 месяцев назад
If I have a payload that is an array of 10.000 positions. The ideal collection should be 1 to 100 , 1 to 1000 ? I'm working on a flow that the developer set the collection as a payload. So I guess because of that they are having problems of performance. ( 10.000 roots in parallel ??? ) Making some tests I realize that setting the collection with 1 to 1000 or 1 to 100 is faster than using payload. Can you imagine why ? Thanks!
@chandrraraj5983
@chandrraraj5983 2 года назад
Excellent explanation
@mereddygowthami4365
@mereddygowthami4365 2 года назад
Hello sir, for me your videos are very helpful. I'm trying to know more about vcore and worker. But I'm not able to find good explanation, could you please do a video on vcore and worker.
@sandeeppowar1289
@sandeeppowar1289 2 года назад
Thank you .. I have query ..in case of DB connection inside parallel foreach can we set max concurrency to no of connection available by DB like 50
@getrash1005
@getrash1005 2 года назад
Thank you very much for detailed explanation. I have 2 questions. 1. In all the formula you used number of cores for calculation, I have application on Cloudhub with 0.2 vCore with 1 worker node. In the logs its showing me following config. * Pooling strategy: UBER * * gracefulShutdownTimeout: 15000 ms * * uber.threadPool.maxSize: 117 * * uber.threadPool.threadKeepAlive: 30000 ms Can I use Max Concurrency for Parallel for each as 10 (more than number of vCore) ? 2. Lets say I have 100 records in payload for "Parallel for each pushing synchronous HTTP request" with max concurrency as 5, Can I assume that any moment of time, there will be maximum 5 connection ?
@Vishwasp13
@Vishwasp13 11 месяцев назад
Sorry for the delayed reply, its a good question, hope the answer would helps you or someone having similar doubt. 1. You can use 10 which is more than the number of core, but in that case the excess number of threads (more than the core count) will be waiting for their turn to get the CPU time, which might result into degraded performance. The optimum concurreny as explained in the video can be attained by having a value same or close to the number of available cores. Coming to the available threads, it represents that we have 117 threads at our disposal which means we can have 117 tasks ready to be handled by thread but they won't get the CPU time together as the number of cores are less, the threads will be waiting for their turn. 2. Yes, you can assume a maximum of 5 connections.
@mayuria2447
@mayuria2447 3 года назад
Can we know the difference between for each parallel and batch processing
@Vishwasp13
@Vishwasp13 3 года назад
Reliability, state management and fine grained error handling is the key difference between Batch and For loop (Sequential and Parallel). In case of For loops the only difference is of processing, one does sequential other is parallel. Use batch for heavy lifting process like data synchronizations, or schedules that involve huge records and complex processing, the batch steps give you fine grained control on errors and happy path and also makes code more readable.
@mayuria2447
@mayuria2447 3 года назад
Why it will not be same in batch processing vishwas sir there no of threads in equal to 2 multiplied with vcore right
@mendasurya5089
@mendasurya5089 2 года назад
what is the use of batch size in for each scope
@rohitak4792
@rohitak4792 3 года назад
Hello Vishwas, 4:51 i see the console output in sequential manner but i got in output as random(parallel processing) order, could you please clarify this.
@gowthamparimi
@gowthamparimi 3 года назад
What if we deploy application in 0.1v or 0.2v and when we have multiple workers also,how do we calculate the max number of threads
@Vishwasp13
@Vishwasp13 3 года назад
0.1v and 0.2v cores have only 2 available cores which means you can attain real parallelism of 2, if you exceed this limit there will be context switching. Multiple worker will have no effect as both will be two different VM and there's no resource sharing. Regarding calculation of max thread, please watch the video again I've explained the formula.
@DanielEsquerdo
@DanielEsquerdo 11 месяцев назад
How can I determine the number of Cores of an environment? If I debug local pointing to the dev environment is it sufficient to determine or should I evaluate that in the cloudHub? ( in the cloud I dont know how to determine that ) Thank you!
@Vishwasp13
@Vishwasp13 11 месяцев назад
To find the number of available cores in a Cloudhub worker, you can write a java code in Mule app that would return the number of cores and deploy it to Cloudhub by selecting the worker size of your choice. You can use the code mentioned here: stackoverflow.com/questions/4759570/finding-number-of-cores-in-java#:~:text=Finding%20the%20number%20of%20cores%20the%20Java%20program%20can%20use,concern%20to%20keep%20in%20mind.
@DanielEsquerdo
@DanielEsquerdo 11 месяцев назад
@@Vishwasp13 if I keep the maxconcurrency empty is it could be a problem? We are having time problems executing just a transform message.
@madhuramadhura3534
@madhuramadhura3534 3 года назад
Does thread switching occurs in CPU_Intense?/ because if CPU_intense requires 2mins of time to exceute, y again thread switching occurs for next thread?? i mean, on what basis other thread comes in to use this intense thread while other is in processing state
@Vishwasp13
@Vishwasp13 3 года назад
First lets understand the orders of threads BLOCKING_IO > CPU_INTENSIVE > CPU_LITE, the BLOCKING_IO thread pool is the most expensive, now if the flow starts with Logger which uses CPU_LITE and the next processor is Transform then obviously a thread switch has to be done because CPU_LITE < CPU_INTENSIVE, so a thread from CPU_INTENSIVE will be used now again after Transform if you have logger so here CPU_INTENSIVE thread can easily to that task there is no point in switiching back to CPU_LITE, I hope this explains the idea of thread switching and the order of thread pools Now coming to your question of switching from CPU_INTENSIVE, obviously there can be situations where after a Transform component that uses CPU_INTENSIVE, there is another processor like DB_INSERT so this is an IO operation which is a blocking task so here CPU_INTENSIVE cannot do that task so it moves to BLOCKING_IO thread pool. All the processors belong to some thread pool by default but that doesn't mean they'll use that default thread pool, CPU_LIT tasks can be done by CPU_INTENSIVE/ BLOCKING_IO pools as well, that depends on the situation. I've explained all of these concepts in detail in thread pool video, please consider watching it. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-YRTLPxRnC9w.html
Далее
This mother's baby is too unreliable.
00:13
Просмотров 19 млн
Редакция. News: 137-я неделя
42:24
Просмотров 621 тыс.
Mule 4: API Gateway and Auto Discovery
20:15
Просмотров 20 тыс.
This mother's baby is too unreliable.
00:13
Просмотров 19 млн