- Newest
- Most votes
- Most comments
Based on your project requirements and challenges, I would recommend using Amazon ECS (Elastic Container Service) with AWS Fargate as the most suitable service for your use case. Here's why:
-
Scalability: ECS with Fargate can easily handle your requirement of running 100,000 processes in parallel. It allows you to run containers without managing the underlying infrastructure, which is ideal for your large-scale application.
-
Networking: ECS provides advanced networking capabilities that can help address your TCP port range issues. It supports awsvpc network mode, which gives each task its own elastic network interface and private IP address, effectively solving the port exhaustion problem.
-
Resource Management: With ECS, you can precisely define the CPU and memory requirements for each task. This allows you to allocate the 30MB of memory you mentioned for each process, and you can adjust the resources for your master process to prevent crashes.
-
Inter-Process Communication: ECS tasks can communicate with each other and with external services. You can set up your master process as a separate service within the same ECS cluster, allowing for efficient communication between the master and worker processes.
-
Monitoring and Debugging: ECS integrates well with AWS CloudWatch for monitoring and logging, providing you with the ability to debug and monitor your application effectively.
-
Cost-Effective: Fargate allows you to pay only for the resources you use, which can be more cost-effective than running an EC2 instance, especially with fluctuating workloads.
-
Network Performance: ECS with Fargate provides excellent network performance, which is crucial for your application that relies heavily on network communication.
While Lambda functions could potentially be used, they may not be ideal for your use case due to the need for long-running processes and the complexity of managing inter-process communication. ECS provides a more suitable environment for your application architecture, offering the right balance of scalability, performance, and manageability.
Sources
Amazon ECS Service Connect components - Amazon Elastic Container Service
Amazon API Gateway Features | API Management | Amazon Web Services
Given your requirements for network optimization and large-scale concurrent tasks, EC2 would be more suitable since it offers better control over the environment, no time limits, and direct management of network resources . Here's why EC2 is better for your case:
Resource Control
You can choose instances optimized for network (c5n.18xlarge or similar) Configure OS-level settings (ulimit, TCP parameters) Tune Node.js process settings directly
Cost Efficiency
Reserved instances for long-running processes No per-invocation costs like Lambda More predictable billing
Network Performance
Direct network interfaces Consistent latency Higher bandwidth Better proxy management
answered 2 years ago
what about the TCP port saturation issue? do you recommend running docker containers inside the instance in order to split the port high demand from the processes?
Relevant content
asked 2 years ago
asked 3 years ago

I documented a bit on ECS but I see that running a container for each process is not optimal because that would take resources to run the container image . these resrouces would be duplicated 100k times..