Bruce Momjian <pgman@candle.pha.pa.us> writes: > Right. What if the postmaster signals the backend once a second to do > their reporting. I am not sure what the final solution will be, but we > _need_ one based on the performance numbers I and others have seen. > Could we have PGPROC have a reporting boolean that is set every second > and somehow checked by each backend?
I don't see any point in involving the postmaster in it. What might be interesting is to replace the current backend timer-interrupt handling by a free-running cyclic interrupt every N milliseconds (the resolution of the statement_timeout and deadlock_check delays would then be no better than N milliseconds, since those actions would occur at the next cyclic interrupt after the desired time expires). We could possibly drive stats reports and ps_status updates from this, as well as sampling EXPLAIN ANALYZE if anyone cares to pursue that. Complaints I can foresee: * lots of cycles wasted in idle backends. Possibly a backend that's not received any command for a second or two could shut down its interrupt until it next gets a command. * not clear whether the interrupt happens when waiting for I/O. I already mentioned that this would be a problem for EXPLAIN ANALYZE, but it might be no big deal for the other uses. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster