Postgresql already pg_cancel_backend and pg_terminate_backend which will stop a backend. Sometimes the system is busy (e.g. disk IO) for a long time, but I don’t want to stop each backend If postgres has a sleep method, I may let some pid just sleep a few times, so disk busy may decend and the most import backend may run faster.
Backend1 -----disk busy 99% Backend1 -----disk busy 99% Backend2 -----disk bush 99% pg_sleep_backend(1, 10min) Backend2 -----disk busy 0% Backend3 -----disk bush 99% pg_sleep_backend(1, 11min) Backend3 -----disk busy 0% Backend4 -----disk bush 99% pg_sleep_backend(1, 12min) Backend4 -----disk busy 0% 从 Windows 版邮件发送 |