forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1f39535
committed
Reduce rate of walwriter wakeups due to async commits.
XLogSetAsyncXactLSN(), called at asynchronous commit, would wake upwalwriter every time the LSN advances, but walwriter doesn't actuallydo anything unless it has at least 'wal_writer_flush_after' fullblocks of WAL to write. Repeatedly waking up walwriter to do nothingis a waste of CPU cycles in both walwriter and the backends doing thewakeups. To fix, apply the same logic in XLogSetAsyncXactLSN() todecide whether to wake up walwriter, as walwriter uses to determine ifit has any work to do.In the passing, rename misleadingly named 'flushbytes' local variableto 'flushblocks'.Author: Andres Freund, Heikki LinnakangasDiscussion:https://www.postgresql.org/message-id/20231024230929.vsc342baqs7kmbte@awork3.anarazel.de1 parent360392f commit1f39535
1 file changed
+31
-18
lines changedLines changed: 31 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2456 | 2456 |
| |
2457 | 2457 |
| |
2458 | 2458 |
| |
| 2459 | + | |
| 2460 | + | |
2459 | 2461 |
| |
2460 | 2462 |
| |
2461 | 2463 |
| |
2462 | 2464 |
| |
| 2465 | + | |
2463 | 2466 |
| |
2464 | 2467 |
| |
2465 | 2468 |
| |
2466 | 2469 |
| |
2467 | 2470 |
| |
2468 |
| - | |
2469 |
| - | |
2470 |
| - | |
| 2471 | + | |
| 2472 | + | |
2471 | 2473 |
| |
2472 |
| - | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
2473 | 2486 |
| |
2474 |
| - | |
2475 |
| - | |
| 2487 | + | |
2476 | 2488 |
| |
2477 |
| - | |
2478 |
| - | |
2479 |
| - | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
2480 | 2494 |
| |
2481 | 2495 |
| |
2482 |
| - | |
2483 |
| - | |
2484 |
| - | |
2485 |
| - | |
2486 |
| - | |
2487 |
| - | |
| 2496 | + | |
2488 | 2497 |
| |
2489 | 2498 |
| |
2490 | 2499 |
| |
| |||
2803 | 2812 |
| |
2804 | 2813 |
| |
2805 | 2814 |
| |
2806 |
| - | |
| 2815 | + | |
2807 | 2816 |
| |
2808 | 2817 |
| |
2809 | 2818 |
| |
| |||
2855 | 2864 |
| |
2856 | 2865 |
| |
2857 | 2866 |
| |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
2858 | 2871 |
| |
2859 | 2872 |
| |
2860 |
| - | |
| 2873 | + | |
2861 | 2874 |
| |
2862 | 2875 |
| |
2863 | 2876 |
| |
| |||
2876 | 2889 |
| |
2877 | 2890 |
| |
2878 | 2891 |
| |
2879 |
| - | |
| 2892 | + | |
2880 | 2893 |
| |
2881 | 2894 |
| |
2882 | 2895 |
| |
|
0 commit comments
Comments
(0)