:_mod-docs-content-type: ASSEMBLY
[id="serverless-concurrency"]
= Concurrency
include::_attributes/common-attributes.adoc[]
:context: serverless-concurrency

Concurrency determines the number of simultaneous requests that can be processed by each replica of an application at any given time. Concurrency can be configured as a _soft limit_ or a _hard limit_:

* A soft limit is a targeted requests limit, rather than a strictly enforced bound. For example, if there is a sudden burst of traffic, the soft limit target can be exceeded.

* A hard limit is a strictly enforced upper bound requests limit. If concurrency reaches the hard limit, surplus requests are buffered and must wait until there is enough free capacity to execute the requests.
+
[IMPORTANT]
====
Using a hard limit configuration is only recommended if there is a clear use case for it with your application. Having a low, hard limit specified may have a negative impact on the throughput and latency of an application, and might cause cold starts.
====

Adding a soft target and a hard limit means that the autoscaler targets the soft target number of concurrent requests, but imposes a hard limit of the hard limit value for the maximum number of requests.

If the hard limit value is less than the soft limit value, the soft limit value is tuned down, because there is no need to target more requests than the number that can actually be handled.

include::modules/serverless-concurrency-limits-configure-soft.adoc[leveloffset=+1]
include::modules/serverless-concurrency-limits-configure-hard.adoc[leveloffset=+1]
include::modules/serverless-target-utilization.adoc[leveloffset=+1]