I migrated from AWS t3.large to c5.xlarge after that I got a lot of 502 errors.
Here is what the Nginx error log looks like
2021/07/04 14:20:41 [error] 6445#6445: *349471 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 15.160.*.***, server: www.maparatunisie.tn, request: "GET /categorie-produit/cheveux/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/categorie-produit/cheveux/"
2021/07/04 14:20:41 [error] 6444#6444: *349474 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 15.160.*.***, server: www.maparatunisie.tn, request: "GET /produit/adrein-gagnon-multi-homme-active-50-30-comprimes-copie/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/produit/adrein-gagnon-multi-homme-active-50-30-comprimes-copie/"
2021/07/04 14:20:41 [error] 6446#6446: *349476 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 15.160.*.***, server: www.maparatunisie.tn, request: "GET /boutique/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/boutique/"
2021/07/04 14:20:41 [error] 6447#6447: *349478 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 15.160.*.***, server: www.maparatunisie.tn, request: "GET /categorie-produit/complements-alimentaires/fertilite-menopause/fertilite-femme/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/categorie-produit/complements-alimentaires/fertilite-menopause/fertilite-femme/"
2021/07/04 14:20:41 [error] 6445#6445: *349482 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 15.160.*.***, server: www.maparatunisie.tn, request: "GET /categorie-produit/complements-alimentaires/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/categorie-produit/complements-alimentaires/"
2021/07/04 14:20:41 [error] 6445#6445: *349485 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 15.160.*.***, server: www.maparatunisie.tn, request: "GET /categorie-produit/complements-alimentaires/forme-et-vitalite/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/categorie-produit/complements-alimentaires/forme-et-vitalite/"
2021/07/04 14:20:41 [error] 6446#6446: *349488 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 15.160.*.***, server: www.maparatunisie.tn, request: "GET /produit/vita-citral-stick-levres-nourrissant-4g/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/produit/vita-citral-stick-levres-nourrissant-4g/"
2021/07/04 14:20:41 [error] 6447#6447: *349490 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 15.160.*.***, server: www.maparatunisie.tn, request: "GET /boutique/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/boutique/"
2021/07/04 14:20:41 [error] 6445#6445: *349492 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 15.160.*.***, server: www.maparatunisie.tn, request: "GET /categorie-produit/visages/yeux-levres/hydratation-levres/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/categorie-produit/visages/yeux-levres/hydratation-levres/"
2021/07/04 14:20:41 [error] 6447#6447: *349497 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: 15.160.*.***, server: www.maparatunisie.tn, request: "GET /produit/vital-viamen-15-gelules/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/produit/vital-viamen-15-gelules/"
I downgraded from PHP 7.4 to 7.3 and I got only these 7 errors and now I passed 30min without errors.
2021/07/04 14:53:13 [crit] 6444#6444: *355269 connect() to unix:/var/run/php/php74-fpm-maparatunisie.tn.sock failed (2: No such file or directory) while connecting to upstream, client: 197.6.*.***, server: www.maparatunisie.tn, request: "GET /wp-admin/admin-ajax.php?action=flatsome_ajax_search_products&query=Bio%20o HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/cart/"
2021/07/04 14:53:14 [crit] 6444#6444: *355269 connect() to unix:/var/run/php/php74-fpm-maparatunisie.tn.sock failed (2: No such file or directory) while connecting to upstream, client: 197.6.**.***, server: www.maparatunisie.tn, request: "GET /wp-admin/admin-ajax.php?action=flatsome_ajax_search_products&query=Bio%20oi HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/cart/"
2021/07/04 14:53:14 [crit] 6444#6444: *355269 connect() to unix:/var/run/php/php74-fpm-maparatunisie.tn.sock failed (2: No such file or directory) while connecting to upstream, client: 197.6.*.***, server: www.maparatunisie.tn, request: "GET /wp-admin/admin-ajax.php?action=flatsome_ajax_search_products&query=Bio%20oil HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/cart/"
2021/07/04 14:53:15 [crit] 6444#6444: *355269 connect() to unix:/var/run/php/php74-fpm-maparatunisie.tn.sock failed (2: No such file or directory) while connecting to upstream, client: 197.6.*.***, server: www.maparatunisie.tn, request: "GET /?s=Bio+oil&post_type=product HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/cart/"
2021/07/04 14:53:15 [crit] 6444#6444: *355269 connect() to unix:/var/run/php/php74-fpm-maparatunisie.tn.sock failed (2: No such file or directory) while connecting to upstream, client: 197.6.*.***, server: www.maparatunisie.tn, request: "GET /favicon.ico HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/?s=Bio+oil&post_type=product"
2021/07/04 14:53:16 [crit] 6447#6447: *358034 connect() to unix:/var/run/php/php74-fpm-maparatunisie.tn.sock failed (2: No such file or directory) while connecting to upstream, client: 102.169.*.***, server: www.maparatunisie.tn, request: "POST /wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/produit/aktiv-selenium-30-gelules/"
2021/07/04 14:53:16 [crit] 6447#6447: *358034 connect() to unix:/var/run/php/php74-fpm-maparatunisie.tn.sock failed (2: No such file or directory) while connecting to upstream, client: 102.169.*.***, server: www.maparatunisie.tn, request: "POST /wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php74-fpm-maparatunisie.tn.sock:", host: "www.maparatunisie.tn", referrer: "https://www.maparatunisie.tn/produit/aktiv-selenium-30-gelules/"
Could it be PHP version? or should I digg more?