TelegramMessenger / MTProxy

5.01k stars 830 forks source link

Multiple errors when launching Docker Image on AWS ECS Fargate #416

Closed fcdm25 closed 4 years ago

fcdm25 commented 4 years ago

Hi there,

When I'm trying to launch docker image with telegrammessenger/proxy, after starting the logs I see these logs:

[*]   t.me link for secret 1: https://t.me/proxy?server=157.175.65.132&port=443&secret=145cd1e74307151cd4f9ec69d047e2e9
[*]   Tag: no tag
[*]   External IP: 157.175.65.132
[*]   Make sure to fix the links in case you run the proxy on a different port.
[+] Starting proxy...
[6][2020-08-21 21:57:16.338900 local] Invoking engine mtproxy-0.01 compiled at Feb 28 2020 12:17:45 by gcc 4.9.2 64-bit after commit dc0c7f3de40530053189c572936ae4fd1567269b
[6][2020-08-21 21:57:16.339043 local] config_filename = '/etc/telegram/backend.conf'
[6][2020-08-21 21:57:16.339206 local] creating 2 workers
[41][2020-08-21 21:57:16.339438 local] failed to set rlimit for open files. Try running as root or requesting smaller maxconns value.
[41][2020-08-21 21:57:16.339471 local] fatal: cannot raise open file limit to 65552
[6][2020-08-21 21:57:16.339490 local] failed to set rlimit for open files. Try running as root or requesting smaller maxconns value.
[6][2020-08-21 21:57:16.339497 local] fatal: cannot raise open file limit to 65552

Unfortanoltly in AWS ECS Fargate, you can not execute next commands, to fix this:

docker run --ulimit nofile=98304:98304
docker run --connections 1000

Are there any choices to bypass these errors?

fcdm25 commented 4 years ago

To fix this issue, need to go to ECS Task Definition and in container definition add RESOURCE LIMITS, no file 98304, 98304 image