Hi Sanket,

if you have a queue of 1000, then 1000 will be used in AsyncIO. Memory
doesn't matter. What you need to double-check is if your async library can
handle that many elements in parallel.

The AsyncHttpClient should have a thread pool that effectively will put an
upper limit on how many elements are processed in parallel. You usually
want to set the size of the thread pool to the queue size. You also need to
ensure that the thread pool is not shared across clients in the same task
manager or increase the thread pool accordingly. So if all 8 instances run
on the same task managers, you need 8000 parallel threads. Since you have 6
AsyncIO, you need a total of 48k threads.

Note that I'd probably start with fewer threads and queue size first. You
may get the desired results much sooner if you keep thread pool and queue
size in sync (I'm assuming you currently have 50 threads which is the
default afaik and 20x queue size)

Another thing to look at is if you use an ordered or unordered queue.
Ordered queue will always decrease performance if the settings are not in
sync.

On Tue, Oct 26, 2021 at 7:06 AM Sanket Agrawal <sanket.agra...@infosys.com>
wrote:

> Hello Everyone,
>
>
>
> I am using a series of 6 Async Operators in my application. Each operator
> is using AsyncHttpClient to make some external API call. Each Async
> Operator makes only one call to external API for a message. Capacity is set
> t 1000 for each parallelism. Approximately, we are getting response in
> 1000ms with correction of 20ms. We see that, at parallelism of 8 for async,
> only 5-8 messages are inside single parallelism of an async operator. I am
> trying to figure out what decides how many messages will go inside the
> Async Operator.
>
>
>
> *Topology*: Source – Process – Async(parallelism 8) – Async(parallelism
> 8) – Async(parallelism 8) – Async(parallelism 8) – Async(parallelism 8) –
> Async(parallelism 8) – process – sink.
>
> *Resources*: 1vcore, 4GB ram, running on AWS Kinesis Analytics.
>
>
>
> *Metrics: *CPU utilization* 22%, *Memory utilization*: 50-58%.*
>
>
>
> It will be helpful if I can get some articles on how Flink decides on how
> many messages will enter into an Async Operator when the capacity is
> specified as 1000 but available memory is only 4GB.
>
>
>
> Thanks,
>
> Sanket Agrawal
>
>
>

Reply via email to