-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function executing in parallel despite maxConcurrentCalls=1 #2667
Comments
The host.json settings apply per instance of your app, not globally across all instances. So if you were running this function app on a dedicated app service plan with two VMs, both of them would run one execution (for a total of two concurrently). If you're running on the consumption plan, then the total number of concurrent executions will vary as the system scales your app up and down based on load. If you're on the consumption plan, the This issue tracks improving the overall experience in this area, but there is no ETA: |
Oh, interesting. I didn't realize that, thanks for the clarification. It is important for the function we're building that we limit it to a certain number of parallel operations, because the service it is hitting (Microsoft Power BI to perform dataset refreshes, actually) will choke if more than 6 at a time are happening, yet it has no internal limiting. I will try |
@paulbatum Any updates on when V2 and |
V2 is relevant since WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT is a V2 feature, right? |
No, it applies for both versions. |
Oh. Awesome. I didn't know that. Very good to know! |
Are there any workarounds on this item. We are reading a subscription on a message bus topic, and writing to a CosmosDb collection, and need to limit the concurrency (some sort of bulkheading). |
@markusfoss Did you look into this: |
We have discovered the following when using the Azure Function 2.0 with a Service Bus Topic Trigger [FunctionName("DirectHitMessageFunc")] We observe that 16 concurrent invocations are run on the instance despite the following host.json: We log to an external system (serilog --> Seq) and record the serverIp - these are allways the same (unless we restart the func app in azure). @MisinformedDNA Also I have not had success with setting the WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT higher than "1" - it is allways executed on only one instance (deduced based on same serverIp logged to Seq). Several 1000 messages have been processes, and I have introduced a Thread.Sleep(7 seconds) to try and make the Azure Function runtime spread the load to more instances. To sum up:
From our point of view, we can not go in production when we do not know what load is put on downstream resources throught concurrency control (the reason why we went for a Pub/Sub architecture to begin with). Have others had made other conclusions? |
@markusfoss - I experienced the same behaviour, WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT in the app settings and maxConcurrentCalls in host.json do not seem to have the desired effect on the function (see also #912) |
Theres a bug in V2 right now that means that the This is one of several issues that are tracked as a blocker for V2 to go into general availability. As for the issue your reported about lack of scale out, that would require more investigation. You'd need to fill out the details in the issue template (invocation ID, region, etc). |
@paulbatum
Did more testing today - and am not able to see scale out
on WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT > 1 in our logs. Do not know
why they didn't yesterday. Anyways: Thanks for the response. Looking
forward to Throttling support on Azure Service Bus :) !
…On Mon, Aug 20, 2018 at 6:13 PM Paul Batum ***@***.***> wrote:
Theres a bug in V2 right now that means that the maxConcurrentCalls value
is not being used correctly:
#2828 <#2828>
This is one of several issues that are tracked as a blocker for V2 to go
into general availability.
As for the issue your reported about lack of scale out, that would require
more investigation. You'd need to fill out the details in the issue
template (invocation ID, region, etc).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2667 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABGh7TUC3EKSH8LzOMua0cEAvtzJwgVjks5uSuA2gaJpZM4TR2jn>
.
|
As V2 is now in GA, can I treat this issue as resolved? (I'm contemplating upgrading a V1 Event Hub consumer application to V2...) |
So a few different things were discussed in this issue:
At this point, I agree that this issue can be closed because everything it touched on is covered by another issue. |
Investigative information
Please provide the following:
Repro steps
Provide the steps required to reproduce the problem:
Expected behavior
With maxConcurrentCalls=1, I would expect another instance of the function to not kick off until the first one has completed and released its lock on the topic message.
Actual behavior
Multiple instances of the function are executing in parallel.
Known workarounds
?
Related information
The text was updated successfully, but these errors were encountered: