تماشای این درس نیاز به اشتراک حرفه‌ای دارد.

Configuring Web Concurrency1:47

that AWS gives us two options with reserved concurrency and provisioned concurrency. With reserved concurrency, we tell AWS, hey, this specific function reserve 30 concurrency slots for it. And when we do that, no other function can use these slots. Also, the function will start throttling if it receives more than 30 concurrent invocations. Let's see how we can use reserved concurrency in Vapor. Inside our vapor.yaml configuration file, we may configure the reserved concurrency of each of the web, queue and console components separately. For the web component, we need to set a concurrency attribute under the environment we wish to configure. So here we will set concurrency equals 30. With that, only 30 concurrent executions will be allowed for the HTTP function of the staging environment. And no other function can take from these 30 reserved slots. To use reserved concurrency for the queue function,

Reserving CLI for Scheduler2:42

will be allowed for the HTTP function of the staging environment. And no other function can take from these 30 reserved slots. To use reserved concurrency for the queue function, we need to add a queueConcurrency attribute. We will set it to 10. With this setup, it's like we started php-fpm with maximum 30 child processes and fired up 10 Laravel queue workers. Now for the CLI function, you might think that we don't need to use reserved concurrency. And that's true most of the time. However, remember that when all concurrency slots are taken, invocations will start failing. And since the CLI function handles the scheduler, we need to make sure that at least one container is up or is available for the scheduler to run every minute. So to set the reserved concurrency for the CLI function, we may use the cliConcurrency attribute. Awesome. Now this environment has 41 reserved concurrency.

ServerlessAWS LambdaLaravel Vapor

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟