Payroll issue on a server

Every time we run a payroll in an instance, another server instance goes down. We tested this locally, and the payroll runs smoothly in two to three minutes, but when we run it on a server, it gets stuck, and another instance crashes with an internal server error.

I’m on version 15
erpnext 15.21.2
frappe 15.26.0

Anyone can help in this regard

What do you find in the logs?
How much RAM does the server have?
What type of installation is it?