Peak connections MySQL + bad gateway nginx php

I have on AWS:

RDS m5.xlarge
MySQL 5.6

EC2 t2.small
NGINX + PHP 7.1

In an intermittent way, my MySQL is getting a peak of connections, 20 to be exact. And every time this happens, "Bad Gateway" appears in NGINX.

  1. According to the type of RDS, 20 connections would not be little for her to become inaccessible?

  2. How can I better investigate the reason for this peak of connections?

Author: Claytinho, 2019-07-04