The HHVM timeout for MW appservers is very long (180 seconds). This is to reduce the chance of unnecessary termination of write requests. For unavoidable performance reasons, many write requests do work in multiple DB transactions, so termination of a write request can produce database inconsistency. And some administrative requests are essential, expensive, and have a very low request rate, such as RevisionDeleteUser. In both cases, server-side timeout can lead to a need for ops intervention.
I propose increasing the timeout of write requests at runtime, using set_time_limit(), so that the default HHVM timeout is not constrained by these use cases. Then the default HHVM timeout can be reduced to say 60 seconds, as suggested in T97204.
MW core could provide a static method or global function to call which notifies it of the beginning of a potentially long-running write request. Then the relevant special pages and extensions could call that function. The function would respond by calling set_time_limit() with a limit specified in the MW configuration. There should be a special configuration value which instructs MW to not call set_time_limit() at all, e.g. false.