Catalogue
Number of Nginx Worker Processes by Fargate Task Size

Number of Nginx Worker Processes by Fargate Task Size

🌐 日本語で読む

Just a memo.

Nginx has a setting that sets the number of worker processes to auto, delegating the count to the number of CPU cores.

1
worker_processes auto;

I investigated how many processes this results in for various Fargate task sizes.

Results

cpumemnumber of nginx worker processes
2565122
102420482
204840964

When I increased the task size, the worker process count properly grew with auto.

By the way,
even if the number of processes increases, you can’t change the net.somaxconn value on Fargate, so
to handle more requests, it’s better to increase the number of tasks.

Also, the following cost the same amount ♪

  • cpu=256, mem=512 × 8 tasks
  • cpu=2048, mem=4096 × 1 task

Let’s increase the number of tasks!

kenzo0107

kenzo0107