Skip to content

Commit d571185

Browse files
committed
regular update to Lambda github docs
1 parent e39b869 commit d571185

9 files changed

+33
-33
lines changed

doc_source/API_AliasRoutingConfiguration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AliasRoutingConfiguration<a name="API_AliasRoutingConfiguration"></a>
22

3-
The parent object that implements what percentage of traffic will invoke each function version\. For more information, see [Traffic Shifting Using Aliases](lambda-traffic-shifting-using-aliases.md)\. The maximum number of stream records that can be sent to your Lambda function for a single invocation\. ng\-using\-aliases"/>\.
3+
The parent object that implements what percentage of traffic will invoke each function version\. For more information, see [Traffic Shifting Using Aliases](lambda-traffic-shifting-using-aliases.md)\. The maximum number of stream records that can be sent to your Lambda function for a single invocation\.
44

55
## Contents<a name="API_AliasRoutingConfiguration_Contents"></a>
66

doc_source/API_CreateEventSourceMapping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The request does not use any URI parameters\.
3939
The request accepts the following data in JSON format\.
4040

4141
** [BatchSize](#API_CreateEventSourceMapping_RequestSyntax) ** <a name="SSS-CreateEventSourceMapping-request-BatchSize"></a>
42-
The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function\. Your function receives an event with all the retrieved records\. The default for Amazon Kinesis and Amazon DynamoDB is 100 records\.
42+
The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function\. Your function receives an event with all the retrieved records\. The default for Amazon Kinesis and Amazon DynamoDB is 100 records\. Both the default and maximum for Amazon SQS are 10 messages\.
4343
Type: Integer
4444
Valid Range: Minimum value of 1\. Maximum value of 10000\.
4545
Required: No

doc_source/API_UpdateEventSourceMapping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The event source mapping identifier\.
3333
The request accepts the following data in JSON format\.
3434

3535
** [BatchSize](#API_UpdateEventSourceMapping_RequestSyntax) ** <a name="SSS-UpdateEventSourceMapping-request-BatchSize"></a>
36-
The maximum number of stream records that can be sent to your Lambda function for a single invocation\. If you are using an SQS queue as an event source, the maximum value is 10\.
36+
The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function\. Your function receives an event with all the retrieved records\.
3737
Type: Integer
3838
Valid Range: Minimum value of 1\. Maximum value of 10000\.
3939
Required: No

doc_source/create-deployment-pkg-zip-java.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ After you build the project, the resulting \.zip file \(that is, your deployment
5555
from compileJava
5656
from processResources
5757
into('lib') {
58-
from configurations.compile.Classpath
58+
from configurations.compileClasspath
5959
}
6060
}
6161
@@ -118,7 +118,7 @@ task buildZip(type: Zip) {
118118
from compileJava
119119
from processResources
120120
into('lib') {
121-
from configurations.compile.Classpath
121+
from configurations.compileClasspath
122122
}
123123
}
124124

doc_source/go-programming-model-handler-types.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ import (
5252
"fmt"
5353
"github.com/aws/aws-lambda-go/lambda"
5454
)
55-
55+
``
5656
type MyEvent struct {
57-
Name string 'json:"What is your name?"'
58-
Age int 'json:"How old are you?"'
57+
Name string `json:"What is your name?"`
58+
Age int `json:"How old are you?"`
5959
}
6060
6161
type MyResponse struct {
62-
Message string 'json:"Answer:"'
62+
Message string `json:"Answer:"`
6363
}
6464
6565
func HandleLambdaEvent(event MyEvent) (MyResponse, error) {
@@ -137,10 +137,10 @@ func init() {
137137
myObjects = result.Contents
138138
}
139139
140-
func LambdaHandler() int {
140+
func LambdaHandler() (int, error) {
141141
invokeCount = invokeCount + 1
142142
log.Print(myObjects)
143-
return invokeCount
143+
return invokeCount, nil
144144
}
145145
146146
func main() {

doc_source/limits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ AWS Lambda will dynamically scale capacity in response to increased traffic, sub
5959
| South America \(São Paulo\) | 500 |
6060

6161
**Note**
62-
If the default **Immediate Concurrency Increase** value is not sufficient to accommodate the traffic surge, AWS Lambda will continue to increase the number of concurrent function executions by **500 per minute** until your account safety limit has been reached or the number of concurrently executing functions is sufficient to successfully process the increased load\. Some event sources, such as Amazon Simple Queue Service, DynamoDB or Amazon Kinesis may have their own scaling limitations\. For more information, see [Understanding Scaling Behavior](scaling.md)\.
62+
If the default **Immediate Concurrency Increase** value is not sufficient to accommodate the traffic surge, AWS Lambda will continue to increase the number of concurrent function executions by **500 per minute** until your account safety limit has been reached or the number of concurrently executing functions is sufficient to successfully process the increased load\. For more information, see [Understanding Scaling Behavior](scaling.md)\.
6363

6464
**To request a limit increase for concurrent executions:**
6565

doc_source/nodejs-prog-model-handler.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@
33
AWS Lambda invokes your Lambda function via a `handler` object\. A `handler` represents the name of your Lambda function \(and serves as the entry point that AWS Lambda uses to execute your function code\. For example:
44

55
```
6-
exports.myHandler = function(event, context) {
7-
...
6+
exports.myHandler = function(event, context, callback) {
7+
... function code
8+
callback(null, "some success message");
9+
// or
10+
// callback("some error type");
811
}
912
```
1013
+ `myHandler` – This is the name of the function AWS Lambda invokes\. Suppose you save this code as `helloworld.js`\. Then, `myHandler` is the function that contains your Lambda function code and `helloworld` is the name of the file that represents your deployment package\. For more information, see [Creating a Deployment Package \(Node\.js\)](nodejs-create-deployment-pkg.md)\.
1114

1215
AWS Lambda supports two invocation types:
13-
+ **RequestResponse**, or `synchronous execution`: AWS Lambda returns the result of the function call to the client invoking the Lambda function\. If the handler code of your Lambda function does not specify a return value, AWS Lambda will automatically return `null` for that value\.
16+
+ **RequestResponse**, or *synchronous execution*: AWS Lambda returns the result of the function call to the client invoking the Lambda function\. If the handler code of your Lambda function does not specify a return value, AWS Lambda will automatically return `null` for that value\. For a simple sample, see [Example](#nodejs-prog-model-handler-example)\.
1417
+ **Event**, or *asynchronous execution*: AWS Lambda will discard any results of the function call\.
1518
**Note**
1619
If you discover that your Lambda function does not process the event using asynchronous invocation, you can investigate the failure using [Dead Letter Queues](dlq.md)\.
1720

18-
Event sources can range from a supported AWS service or custom applications that invoke your Lambda function\. For examples, see [Sample Events Published by Event Sources](eventsources.md)
21+
Event sources can range from a supported AWS service or custom applications that invoke your Lambda function\. For examples, see [Sample Events Published by Event Sources](eventsources.md)\. For a simple sample, see [Example](#nodejs-prog-model-handler-example)\.
1922
+ `context` – AWS Lambda uses this parameter to provide details of your Lambda function's execution\. For more information, see [The Context Object \(Node\.js\)](nodejs-prog-model-context.md)\.
23+
+ `callback` \(optional\)– See [Using the Callback Parameter](#nodejs-prog-model-handler-callback)\.
2024

2125
## Using the Callback Parameter<a name="nodejs-prog-model-handler-callback"></a>
2226

doc_source/scaling.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
# Understanding Scaling Behavior<a name="scaling"></a>
22

3-
Concurrent executions refers to the number of executions of your function code that are happening at any given time\. You can estimate the concurrent execution count, but the concurrent execution count will differ depending on whether or not your Lambda function is processing events from a stream\-based event source\.
3+
Concurrent executions refers to the number of executions of your function code that are happening at any given time\. You can estimate the concurrent execution count, but the concurrent execution count will differ depending on whether or not your Lambda function is processing events from a poll\-based event source\. If you create a Lambda function to process events from event sources that aren't poll\-based \(for example, Lambda can process every event from other sources, like Amazon S3 or API Gateway\), each published event is a unit of work, in parallel, up to your account limits\. Therefore, the number of events \(or requests\) these event sources publish influences the concurrency\. You can use the this formula to estimate your concurrent Lambda function invocations:
4+
5+
```
6+
events (or requests) per second * function duration
7+
```
8+
9+
For example, consider a Lambda function that processes Amazon S3 events\. Suppose that the Lambda function takes on average three seconds and Amazon S3 publishes 10 events per second\. Then, you will have 30 concurrent executions of your Lambda function\.
10+
11+
The number of concurrent executions for poll\-based event sources also depends on additional factors, as noted following:
412
+ **Poll\-based event sources that are stream\-based**
513
+ Amazon Kinesis Data Streams
614
+ Amazon DynamoDB
715

816
For Lambda functions that process Kinesis or DynamoDB streams the number of shards is the unit of concurrency\. If your stream has 100 active shards, there will be at most 100 Lambda function invocations running concurrently\. This is because Lambda processes each shard’s events in sequence\. **Poll\-based event sources that are not stream\-based**: For Lambda functions that process Amazon SQS queues, AWS Lambda will automatically scale the polling on the queue until the maximum concurrency level is reached, where each message batch can be considered a single concurrent unit\. AWS Lambda's automatic scaling behavior is designed to keep polling costs low when a queue is empty while simultaneously enabling you to achieve high throughput when the queue is being used heavily\.
917

10-
Here is how it works:
11-
+ When an Amazon SQS event source mapping is initially enabled, Lambda begins long\-polling the Amazon SQS queue\. Long polling helps reduce the cost of polling Amazon Simple Queue Service by reducing the number of empty responses, while proving optimal processing latency when messages arrive\. As the influx of messages to a queue increases, AWS Lambda automatically scales up polling activity until the number of concurrent function executions reaches 1000, the account concurrency limit, or the \(optional\) function concurrency limit, whichever is lower\. SQS Event Sources support an initial burst of 5 concurrent function invocations and increase concurrency by 60 concurrent invocations per minute\.
12-
+ Lambda monitors the number of [inflight messages](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html#inflight-messages), and when it detects that this number is increasing, it will increase the polling frequency by 20 [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) requests per minute and the function concurrency by 60 calls per minute\. As long as the queue remains busy, scale up continues until at least one of the following occurs:
13-
+ Polling frequency reaches 100 simultaneous ReceiveMessage requests and function invocation concurrency reaches 1,000\.
14-
+ The account concurrency maximum has been reached\.
15-
+ The per\-function concurrency limit of the function attached to the SQS queue \(if any\) has been reached\.
18+
When an Amazon SQS event source mapping is initially enabled, Lambda begins long\-polling the Amazon SQS queue\. Long polling helps reduce the cost of polling Amazon Simple Queue Service by reducing the number of empty responses, while providing optimal processing latency when messages arrive\.
1619

17-
When AWS Lambda detects that the number of inflight messages is decreasing, it will decrease the polling frequency by 10 ReceiveMessage requests per minute and decrease the concurrency used to invoke your function by 30 calls per minute\.
20+
As the influx of messages to a queue increases, AWS Lambda automatically scales up polling activity until the number of concurrent function executions reaches 1000, the account concurrency limit, or the \(optional\) function concurrency limit, whichever is lower\. Amazon Simple Queue Service supports an initial burst of 5 concurrent function invocations and increases concurrency by 60 concurrent invocations per minute\.
1821
**Note**
1922
[Account\-level limits](http://docs.aws.amazon.com/lambda/latest/dg/limits.html) are impacted by other functions in the account, and per\-function concurrency applies to all events sent to a function\. For more information, see [Managing Concurrency](concurrent-executions.md)\.
20-
+ **Event sources that aren't stream\-based** – If you create a Lambda function to process events from event sources that aren't stream\-based \(for example, Lambda can process every event from other sources, like Amazon S3 or API Gateway\), each published event is a unit of work, in parallel, up to your account limits\. Therefore, the number of events \(or requests\) these event sources publish influences the concurrency\. You can use the this formula to estimate your concurrent Lambda function invocations:
21-
22-
```
23-
events (or requests) per second * function duration
24-
```
25-
26-
For example, consider a Lambda function that processes Amazon S3 events\. Suppose that the Lambda function takes on average three seconds and Amazon S3 publishes 10 events per second\. Then, you will have 30 concurrent executions of your Lambda function\.
2723

2824
## Request Rate<a name="concurrent-executions-request-rate"></a>
2925

30-
Request rate refers to the rate at which your Lambda function is invoked\. For all services except the stream\-based services, the request rate is the rate at which the event sources generate the events\. For stream\-based services, AWS Lambda calculates the request rate as follow:
26+
Request rate refers to the rate at which your Lambda function is invoked\. For all services except the stream\-based services, the request rate is the rate at which the event sources generate the events\. For stream\-based services, AWS Lambda calculates the request rate as follows:
3127

3228
```
3329
request rate = number of concurrent executions / function duration

doc_source/with-sqs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Note the following about how Amazon Simple Queue Service and AWS Lambda integrat
2424
+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md)
2525

2626
When using these operations to map your Lambda function to an Amazon SQS queue, note the following configuration parameters:
27-
+ **BatchSize**: The largest number of records that AWS Lambda will retrieve from each [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) call\. The maximum batch size supported by Amazon Simple Queue Service is up to 10 queue messages per batch\.
27+
+ **BatchSize**: The number of records that AWS Lambda will retrieve from each [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) call\. Both the default and maximum batch size supported by Amazon Simple Queue Service is up to 10 queue messages per batch\.
2828
+ **Enabled**: A flag to signal AWS Lambda that it should start polling your specified Amazon SQS queue\.
2929
+ **EventSourceArn**: The ARN \(Amazon Resource Name\) of your Amazon SQS queue that AWS Lambda is monitoring for new messages\.
3030
+ **FunctionName**: The Lambda function to invoke when AWS Lambda detects new messages on your configured Amazon SQS queue\.

0 commit comments

Comments
 (0)