Server API is shown in Site administration ▸ Server ▸ PHP info?:
If your site is hosted on a managed service that you use a web interface to manage (e.g. cPanel) then you may need to contact the hosting company to find out how to change Apache's TimeOut (they may not allow this).
To explain, if Apache is using Server API: FPM/FastCGI then when Apache runs some PHP it passes it to the FPM process. FPM runs the PHP then sends the results to Apache. But if the PHP takes a long time (for example when restoring a large course backup) then Apache may give up waiting and show the 503 Service Unavailable error instead. TimeOut controls how long Apache waits for FPM to run the PHP.
If Server API is not FPM/FastCGI (e.g. if it's Apache 2.0 Handler) then the problem may be something else and changing the Apache TimeOut may not help.