[External] : Re: jstack, profilers and other tools

Alex Otenko oleksandr.otenko at gmail.com
Thu Jul 21 07:13:36 UTC 2022


Let's move on. I take these discussions as an opportunity to revisit
understanding and learn new things. So I went to the beginnings, and now I
have to disagree even with the claim that thread count is a cap on
concurrency - certainly, not on concurrency as used in Little's law.
Please, bear with me and see if it's correct.

Suppose we have 1 thread that is able to dispose of one request in 10ms.
The prediction is that concurrency won't exceed 1, right?

Yes, N threads can't be processing more than N tasks. Yes, this is also the
case, when we test in a particular way - that is, if we send requests
sequentially, the next being sent only after receiving a response.

Enter real world. All requests are independent. So if throughput is 66.667,
response time in a single-threaded system above is 30ms. If we agree on
this, then concurrency predicted by Little's law is 2, not capped at 1.

More than that, it is unbounded. If throughput is 99, response time is 1s,
and concurrency is 99. Knowing how response time grows, we can tell it
really can be arbitrarily large for any throughput below 100 (the limit of
the system).


Alex

On Wed, 20 Jul 2022, 19:24 Alex Otenko, <oleksandr.otenko at gmail.com> wrote:

> To me that statement implies a few things:
>
> - that Little's law talks of thread count
>
> - that if thread count is low, can't have throughput advantage
>
>
> Well, I don't feel like discussing my imperfect grasp of English.
>
> On Tue, 19 Jul 2022, 23:52 Ron Pressler, <ron.pressler at oracle.com> wrote:
>
>>
>>
>> On 19 Jul 2022, at 18:38, Alex Otenko <oleksandr.otenko at gmail.com> wrote:
>>
>> Agreed about the architectural advantages.
>>
>> The email that triggered my rant did contain the claim that using Virtual
>> threads has the advantage of higher concurrency.
>>
>> > The throughput advantage to virtual threads comes from one aspect —
>> their *number* — as explained by Little’s law.
>>
>>
>>
>>
>> Yes, and that is correct. As I explained, a higher maximum number of
>> threads does indeed mean it is possible to reach the higher concurrency
>> needed for higher throughput, so virtual threads, by virtue of their
>> number, do allow for higher throughput. That statement is completely
>> accurate, and yet it means something very different from (the incorrect)
>> “increasing the number of threads increases throughput”, which is how you
>> misinterpreted the statement.
>>
>> This is similar to saying that AC allows people to live in areas with
>> higher temperature, and that is a very different statement from saying that
>> AC increases the temperature (althoughI guess it happens to also do that).
>>
>> — Ron
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20220721/014d760e/attachment.htm>


More information about the loom-dev mailing list