Hi Amit, Are you trying to the minimize the elapsed time for this single function call, or the overall performance of the system? Probably having 10 threads doing the putAlls in parallel would end up taking less time, unless your system is saturated enough that the extra thread contention starts hurting you. But a larger putAll from a single thread might be more efficient if you are a doing a lot of these function calls in parallel - that could depend on the size of your data and if it is colocated.
Akihiro is right that you probably won't know what is better for your workload unless you test it. -Dan On Tue, Nov 28, 2017 at 8:25 AM, Amit Pandey <[email protected]> wrote: > Hey Thanks for the answer. I guess I didn't explain it correctly. I am not > trying to do single puts from threads. > > So my situation is :- > > I can do 500 inserts from 10 threads via putAll > > or I can just collect them ( 5000) and do a putAll. > > Which one is the correct approach ? > > On Mon, Nov 27, 2017 at 8:07 AM, Akihiro Kitada <[email protected]> > wrote: > >> Hello Amit, >> >> >Now my question is will it be faster to do it on the individual threads >> and just return that they have completed the task so that they can be sent >> back to the caller or the way we do it now I,e collect all data and insert >> is better ? >> >> It depends on the workload and cluster configuration (data size, num of >> data, num of threads, num of members, region type and so on) although >> putAll could be more efficient in terms of throughput per threads. >> >> I recommend you to try both ways based on the possible workload and >> configuration. >> >> Thanks, regards. >> >> >> >> >> -- >> Akihiro Kitada | Staff Customer Engineer | +81 80 3716 3736 >> <+81%2080-3716-3736> >> Support.Pivotal.io <http://support.pivotal.io/> | Mon-Fri 9:00am to >> 5:30pm JST | 1-877-477-2269 <(877)%20477-2269> >> [image: support] <https://support.pivotal.io/> [image: twitter] >> <https://twitter.com/pivotal> [image: linkedin] >> <https://www.linkedin.com/company/3048967> [image: facebook] >> <https://www.facebook.com/pivotalsoftware> [image: google plus] >> <https://plus.google.com/+Pivotal> [image: youtube] >> <https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl> >> >> >> 2017-11-26 0:33 GMT+09:00 Amit Pandey <[email protected]>: >> >>> Hey Guys, >>> >>> I have a question. So I have a function which calls some threads to get >>> data to be inserted into a region. It collects all the data and then puts >>> them into a region with putAll. >>> >>> Now my question is will it be faster to do it on the individual threads >>> and just return that they have completed the task so that they can be sent >>> back to the caller or the way we do it now I,e collect all data and insert >>> is better ? >>> >>> Regards >>> >> >> >
