I have been assigned a new website to work on and I have recently moved it to a new server operating at CentOS 7 which is using nginx to host my website made with zend framework.
However, very frequently (10-20 times a day) the cpu usage of the server becomes 100% and the website crashes (504 gateway timeout). The site only works again when I restart the server.
Therefore I have two questions:
How can I restart the server (or nginx, im not sure in this case) when the CPU is fully used?
Or even better is how can identify which file is the source of this issue?