3 ms·
Isn't most performance problems down to the CPU waiting for something? (network - disk - memory - cache)
by Cthulhu_ 3y ago
Isn't most performance problems down to the CPU waiting for something? (network - disk - memory - cache)
- dsr_ 3y agoAnd almost all the rest are due to the CPU doing unnecessary work.
- koliber 3y agoSometimes it's the CPU waiting. Sometimes there is a connection open to the DB which acquired a lot of locks during a long-running transaction. The DB is processing this transaction on one DB connection, and many other DB connections are blocked because they can not access certain tables, pages, or rows. The other sessions are literally doing nothing and are waiting. Potential ways to improve it: - Reducing the scope of transactions - committing more often within the transaction - optimizing just the most impactful queries which contribute to the blocking session's runtime (not ones that don't block at all) - loosening the transaction isolation level