If your website going down and showing HTTP error code 500 and/or 503 or sometimes your website's template getting error in some places, you might want to check your opcache PHP extension.
Opcache has to be enabled. It will lower your resource usage significantly because of its opcode caching capability.
However, if it has always been enabled but causing errors like I mentioned above, you can disable opcache extension temporarily (like 3-5 seconds) then enable it again. Your PHP engine should be refreshed and your Moodle site will be up again (if your server doesn't refresh, restart it manually).