:doc:`Lambda <../../lambda>` / Client / put_function_concurrency

************************
put_function_concurrency
************************



.. py:method:: Lambda.Client.put_function_concurrency(**kwargs)

  

  Sets the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency level.

   

  Concurrency settings apply to the function as a whole, including all published versions and the unpublished version. Reserving concurrency both ensures that your function has capacity to process the specified number of events simultaneously, and prevents it from scaling beyond that level. Use  GetFunction to see the current setting for a function.

   

  Use  GetAccountSettings to see your Regional concurrency limit. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per-function limit. For more information, see `Lambda function scaling <https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/PutFunctionConcurrency>`_  


  **Request Syntax**
  ::

    response = client.put_function_concurrency(
        FunctionName='string',
        ReservedConcurrentExecutions=123
    )
    
  :type FunctionName: string
  :param FunctionName: **[REQUIRED]** 

    The name or ARN of the Lambda function.

     

    **Name formats**

     

    
    * **Function name** – ``my-function``.
     
    * **Function ARN** – ``arn:aws:lambda:us-west-2:123456789012:function:my-function``.
     
    * **Partial ARN** – ``123456789012:function:my-function``.
    

     

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

    

  
  :type ReservedConcurrentExecutions: integer
  :param ReservedConcurrentExecutions: **[REQUIRED]** 

    The number of simultaneous executions to reserve for the function.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ReservedConcurrentExecutions': 123
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ReservedConcurrentExecutions** *(integer) --* 

        The number of concurrent executions that are reserved for this function. For more information, see `Managing Lambda reserved concurrency <https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html>`__.

        
  
  **Exceptions**
  
  *   :py:class:`Lambda.Client.exceptions.InvalidParameterValueException`

  
  *   :py:class:`Lambda.Client.exceptions.ResourceConflictException`

  
  *   :py:class:`Lambda.Client.exceptions.ServiceException`

  
  *   :py:class:`Lambda.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`Lambda.Client.exceptions.ResourceNotFoundException`

  

  **Examples**

  The following example configures 100 reserved concurrent executions for the my-function function.
  ::

    response = client.put_function_concurrency(
        FunctionName='my-function',
        ReservedConcurrentExecutions=100,
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ReservedConcurrentExecutions': 100,
        'ResponseMetadata': {
            '...': '...',
        },
    }

  