A
A
akdes2018-03-02 13:09:49
PHP
akdes, 2018-03-02 13:09:49

Long php script results in 502 Nginx without self-healing, php-fpm not responding, how to find the cause?

Hi all.
A service on Laravel, consisting of a bunch of docker-compose (nginx + php-fpm 7.1.2) raised on t2.medium (two cores), hanging under LoadBalancer (AWS) + AutoScaling (AWS) is called via cron at 5 am. The script runs for about an hour and a half.
Problem : while the script is running, after 5 minutes, AWS shows the service as unhealthy - when calling the service (by IP), nginx throws 502.
docker logs web_containerissues

*AWESOME_IP*- - [02/Mar/2018:05:05:26 +0000] "GET / HTTP/1.1" 499 0 "-" "ELB-HealthChecker/2.0" "-"

AWS checks once a minute.
Those. according to the logs, 499 starts 5 minutes after cron is started. In parallel, even at night, several points contact the service every minute. Cron runs successfully.
Locally, such a problem was not observed, naturally without HealthChecker and add. calls from points.
Both containers ping each other, both react individually, nginx throws errors, and php container allows you to call laravel functions (php artisan tinker etc ..), work with controllers and the database.
Plantain on the knee : restart app-Container (php).
Tell me how and where to dig to find and fix the problem?
Of course, as a plan for the future, extend the cron routine into a separate service that runs only for this purpose, but unfortunately there is no time for this yet, and I want to understand the problem.
Thanks a lot!
UPDATE
dachshund, I dug further, found an article
on it, made a request, a live container, gives an immediate answer
Primary script unknown
Status: 404 Not Found
X-Powered-By: PHP/7.1.14
Content-type: text/html; charset=UTF-8
File not found.

and the dead one does not give anything at all - it hangs, after 2-3 minutes it resets.
So the problem is directly related to php-fpm because php itself plows, but it cannot process requests. Therefore, I remove the docker tag.
Tell me where to dig further?
The php-fpm logging was disabled, now enabled, I couldn't recreate the error myself, I'll watch and wait for the freeze...
UPDATE 5.03
The server crashed again, but didn't write to the log...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question