- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit5cbbe70
committed
Flush the IO statistics of active WAL senders more frequently
WAL senders do not flush their statistics until they exit, limiting themonitoring possible for live processes. This is penalizing when WALsenders are running for a long time, like in streaming or logicalreplication setups, because it is not possible to know the amount of IOthey generate while running.This commit makes WAL senders more aggressive with their statisticsflush, using an internal of 1 second, with the flush timing calculatedbased on the existing GetCurrentTimestamp() done before the sleeps doneto wait for some activity. Note that the sleep done for logical andphysical WAL senders happens in two different code paths, so the statsflushes need to happen in these two places.One test is added for the physical WAL sender case, and one for thelogical WAL sender case. This can be done in a stable fashion byrelying on the WAL generated by the TAP tests in combination with astats reset while a server is running, but only on HEAD as WAL data hasbeen added to pg_stat_io ina051e71.This issue exists sincea9c70b4 and the introduction of pg_stat_io,so backpatch down to v16.Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>Reviewed-by: vignesh C <vignesh21@gmail.com>Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>Discussion:https://postgr.es/m/Z73IsKBceoVd4t55@ip-10-97-1-34.eu-west-3.compute.internalBackpatch-through: 161 parent4c1d853 commit5cbbe70
1 file changed
+32
-2
lines changedLines changed: 32 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
90 | 90 |
| |
91 | 91 |
| |
92 | 92 |
| |
| 93 | + | |
93 | 94 |
| |
94 | 95 |
| |
95 | 96 |
| |
96 | 97 |
| |
| 98 | + | |
| 99 | + | |
| 100 | + | |
97 | 101 |
| |
98 | 102 |
| |
99 | 103 |
| |
| |||
1820 | 1824 |
| |
1821 | 1825 |
| |
1822 | 1826 |
| |
| 1827 | + | |
1823 | 1828 |
| |
1824 | 1829 |
| |
1825 | 1830 |
| |
| |||
1840 | 1845 |
| |
1841 | 1846 |
| |
1842 | 1847 |
| |
| 1848 | + | |
1843 | 1849 |
| |
1844 | 1850 |
| |
1845 | 1851 |
| |
| |||
1950 | 1956 |
| |
1951 | 1957 |
| |
1952 | 1958 |
| |
1953 |
| - | |
| 1959 | + | |
| 1960 | + | |
1954 | 1961 |
| |
1955 | 1962 |
| |
1956 | 1963 |
| |
| |||
1959 | 1966 |
| |
1960 | 1967 |
| |
1961 | 1968 |
| |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
1962 | 1977 |
| |
1963 | 1978 |
| |
1964 | 1979 |
| |
| |||
2766 | 2781 |
| |
2767 | 2782 |
| |
2768 | 2783 |
| |
| 2784 | + | |
| 2785 | + | |
2769 | 2786 |
| |
2770 | 2787 |
| |
2771 | 2788 |
| |
| |||
2860 | 2877 |
| |
2861 | 2878 |
| |
2862 | 2879 |
| |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
2863 | 2883 |
| |
2864 | 2884 |
| |
2865 | 2885 |
| |
2866 | 2886 |
| |
2867 | 2887 |
| |
2868 | 2888 |
| |
2869 | 2889 |
| |
| 2890 | + | |
2870 | 2891 |
| |
2871 | 2892 |
| |
2872 | 2893 |
| |
| |||
2877 | 2898 |
| |
2878 | 2899 |
| |
2879 | 2900 |
| |
2880 |
| - | |
| 2901 | + | |
| 2902 | + | |
2881 | 2903 |
| |
2882 | 2904 |
| |
2883 | 2905 |
| |
2884 | 2906 |
| |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
2885 | 2915 |
| |
2886 | 2916 |
| |
2887 | 2917 |
| |
|
0 commit comments
Comments
(0)