Hi. I've got an unexpected error, I guess it's about timeout.
Task takes time quite long. generally less than 1minute. There is no problem when it finish before 1 minute. But sometimes task takes more than 1 minute. Error occurs when it takes more than 1minute. Please see below.
[ec2-user@ip-000-00-0-00 ~]$ curl --location --request POST 'userid.ap-northeast-2.elb.amazonaws.com:port/service' -d "video.mp4" -o output.json -v
Note: Unnecessary use of -X or --request, POST is already inferred.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 172.31.74.35:5000...
* Connected to loadbalancer.ap-northeast-2.elb.amazonaws.com (000.00.00.00) port 0000 (#0)
> POST /service HTTP/1.1
> Host: userid.ap-northeast-2.elb.amazonaws.com:port
> User-Agent: curl/7.79.1
> Accept: */*
> Content-Length: 37
> Content-Type: application/x-www-form-urlencoded
>
} [37 bytes data]
100 37 0 0 0 37 0 0 --:--:-- 0:00:59 --:--:-- 0* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Date: Tue, 19 Apr 2022 01:45:23 GMT
< Content-Type: application/octet-stream
< Content-Length: 0
< Connection: keep-alive
< Server: Python/3.7 aiohttp/3.7.4.post0
<
100 37 0 0 0 37 0 0 --:--:-- 0:01:00 --:--:-- 0
* Connection #0 to host loadbalancer.ap-northeast-2.elb.amazonaws.com left intactm left intact
With curl verbose option, I get 500 Internal Server Error at 0:00:59. How can I finish my task which takes more than 1minutes?
I've tried
- increasing Health check grace period for ECS Service
- increasing idle timeout of Load Balancer
- increasing timeout and interval of Target group
- curl options (like keep-alive, max-time)
My EC2 Instance
- type : t2.micro
- Amazon Linux
My Service
- Service type : REPLICA
- Launch type : FARGATE
My task in service
- Network mode : awsvpc
- Compatibilities : EC2, FARGATE
- Requries compatibilities : FARGATE
- EFS mounted
- Docker
Appreciate,
It's machine learning service so it takes long. We can't make our application faster than this.
Websockets is another legitimate use case where you don't want the connection to be automatically timed out. Anyone figure out where the timeout is set?