forked from mtusi2026/mtusi2026lab3
One to eight replicas of 1 CPU, 512 MiB and one worker each, three repeats per rate; the 4x1 point comes from series A. Peak successful RPS: 1 720 for one replica, 2 936 for two, 4 724 for four and only 4 260 for eight, lower than four. Up to two replicas the API is the limit (101 % and 201 % of its CPU). At eight replicas the API uses 473 of its 800 % and the balancer 40 % of a core, while PostgreSQL is at 178 of 200 %, 47.5 of the 64 pool connections wait for a chat row lock and the balancer queue holds 744 requests. The locking SELECT ... FOR UPDATE of the chat takes 14.2 ms on average, 97 % of all statement time of the step, and about 7 connections sit idle in transaction: the lock holders wait for the application between round trips. A universal scalability law fit over 1, 2, 4 and 8 CPUs gives sigma 0.014 and kappa 0.038, a peak near five replicas and a decline after it. No step of this series was rejected as disturbed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27
9.9 KiB
9.9 KiB
| 1 | ts | state | wait_event_type | wait_event | backends | max_connections |
|---|---|---|---|---|---|---|
| 2 | 1793224800 | idle | Client | ClientRead | 62 | 200 |
| 3 | 1793224802 | active | IO | WalSync | 1 | 200 |
| 4 | 1793224802 | active | Lock | transactionid | 9 | 200 |
| 5 | 1793224802 | active | Lock | tuple | 42 | 200 |
| 6 | 1793224802 | idle | Client | ClientRead | 3 | 200 |
| 7 | 1793224802 | idle in transaction | 1 | 200 | ||
| 8 | 1793224802 | idle in transaction | Client | ClientRead | 8 | 200 |
| 9 | 1793224803 | active | IO | WalSync | 1 | 200 |
| 10 | 1793224803 | active | LWLock | WALWrite | 3 | 200 |
| 11 | 1793224803 | active | Lock | transactionid | 23 | 200 |
| 12 | 1793224803 | active | Lock | tuple | 30 | 200 |
| 13 | 1793224803 | idle | Client | ClientRead | 1 | 200 |
| 14 | 1793224803 | idle in transaction | Client | ClientRead | 6 | 200 |
| 15 | 1793224804 | active | Client | ClientRead | 1 | 200 |
| 16 | 1793224804 | active | Lock | transactionid | 17 | 200 |
| 17 | 1793224804 | active | Lock | tuple | 32 | 200 |
| 18 | 1793224804 | idle | Client | ClientRead | 4 | 200 |
| 19 | 1793224804 | idle in transaction | Client | ClientRead | 10 | 200 |
| 20 | 1793224805 | active | Client | ClientRead | 1 | 200 |
| 21 | 1793224805 | active | IO | WalSync | 1 | 200 |
| 22 | 1793224805 | active | LWLock | WALWrite | 3 | 200 |
| 23 | 1793224805 | active | Lock | transactionid | 16 | 200 |
| 24 | 1793224805 | active | Lock | tuple | 30 | 200 |
| 25 | 1793224805 | idle | Client | ClientRead | 5 | 200 |
| 26 | 1793224805 | idle in transaction | Client | ClientRead | 7 | 200 |
| 27 | 1793224805 | idle in transaction | Lock | transactionid | 1 | 200 |
| 28 | 1793224806 | active | 3 | 200 | ||
| 29 | 1793224806 | active | IO | WalSync | 1 | 200 |
| 30 | 1793224806 | active | Lock | transactionid | 9 | 200 |
| 31 | 1793224806 | active | Lock | tuple | 40 | 200 |
| 32 | 1793224806 | idle | Client | ClientRead | 6 | 200 |
| 33 | 1793224806 | idle in transaction | 1 | 200 | ||
| 34 | 1793224806 | idle in transaction | Client | ClientRead | 4 | 200 |
| 35 | 1793224807 | active | IO | WalSync | 1 | 200 |
| 36 | 1793224807 | active | Lock | transactionid | 14 | 200 |
| 37 | 1793224807 | active | Lock | tuple | 34 | 200 |
| 38 | 1793224807 | idle | Client | ClientRead | 4 | 200 |
| 39 | 1793224807 | idle in transaction | Client | ClientRead | 9 | 200 |
| 40 | 1793224807 | idle in transaction | LWLock | WALWrite | 1 | 200 |
| 41 | 1793224807 | idle in transaction | Lock | tuple | 1 | 200 |
| 42 | 1793224808 | active | 1 | 200 | ||
| 43 | 1793224808 | active | Lock | transactionid | 11 | 200 |
| 44 | 1793224808 | active | Lock | tuple | 36 | 200 |
| 45 | 1793224808 | idle | Client | ClientRead | 5 | 200 |
| 46 | 1793224808 | idle in transaction | Client | ClientRead | 10 | 200 |
| 47 | 1793224808 | idle in transaction | Lock | tuple | 1 | 200 |
| 48 | 1793224810 | active | Client | ClientRead | 1 | 200 |
| 49 | 1793224810 | active | IO | WalSync | 1 | 200 |
| 50 | 1793224810 | active | LWLock | WALWrite | 2 | 200 |
| 51 | 1793224810 | active | Lock | transactionid | 11 | 200 |
| 52 | 1793224810 | active | Lock | tuple | 40 | 200 |
| 53 | 1793224810 | idle | Client | ClientRead | 3 | 200 |
| 54 | 1793224810 | idle in transaction | 1 | 200 | ||
| 55 | 1793224810 | idle in transaction | Client | ClientRead | 5 | 200 |
| 56 | 1793224811 | active | 3 | 200 | ||
| 57 | 1793224811 | active | Client | ClientRead | 7 | 200 |
| 58 | 1793224811 | active | IO | WalSync | 1 | 200 |
| 59 | 1793224811 | active | LWLock | WALWrite | 1 | 200 |
| 60 | 1793224811 | active | Lock | transactionid | 11 | 200 |
| 61 | 1793224811 | active | Lock | tuple | 32 | 200 |
| 62 | 1793224811 | idle | Client | ClientRead | 4 | 200 |
| 63 | 1793224811 | idle | Lock | transactionid | 1 | 200 |
| 64 | 1793224811 | idle in transaction | Client | ClientRead | 3 | 200 |
| 65 | 1793224811 | idle in transaction | IO | WalSync | 1 | 200 |
| 66 | 1793224812 | active | Client | ClientRead | 1 | 200 |
| 67 | 1793224812 | active | Lock | transactionid | 11 | 200 |
| 68 | 1793224812 | active | Lock | tuple | 36 | 200 |
| 69 | 1793224812 | idle | Client | ClientRead | 5 | 200 |
| 70 | 1793224812 | idle in transaction | 2 | 200 | ||
| 71 | 1793224812 | idle in transaction | Client | ClientRead | 6 | 200 |
| 72 | 1793224812 | idle in transaction | LWLock | WALWrite | 1 | 200 |
| 73 | 1793224812 | idle in transaction | Lock | tuple | 2 | 200 |
| 74 | 1793224813 | active | 2 | 200 | ||
| 75 | 1793224813 | active | LWLock | WALWrite | 1 | 200 |
| 76 | 1793224813 | active | Lock | transactionid | 10 | 200 |
| 77 | 1793224813 | active | Lock | tuple | 38 | 200 |
| 78 | 1793224813 | idle | Client | ClientRead | 7 | 200 |
| 79 | 1793224813 | idle in transaction | Client | ClientRead | 6 | 200 |
| 80 | 1793224814 | active | LWLock | LockManager | 25 | 200 |
| 81 | 1793224814 | active | Lock | transactionid | 6 | 200 |
| 82 | 1793224814 | active | Lock | tuple | 21 | 200 |
| 83 | 1793224814 | idle | Client | ClientRead | 5 | 200 |
| 84 | 1793224814 | idle in transaction | Client | ClientRead | 7 | 200 |
| 85 | 1793224815 | active | 1 | 200 | ||
| 86 | 1793224815 | active | Client | ClientRead | 1 | 200 |
| 87 | 1793224815 | active | IO | WalSync | 1 | 200 |
| 88 | 1793224815 | active | LWLock | WALWrite | 2 | 200 |
| 89 | 1793224815 | active | Lock | transactionid | 14 | 200 |
| 90 | 1793224815 | active | Lock | tuple | 35 | 200 |
| 91 | 1793224815 | idle | Client | ClientRead | 5 | 200 |
| 92 | 1793224815 | idle in transaction | Client | ClientRead | 5 | 200 |
| 93 | 1793224817 | active | 3 | 200 | ||
| 94 | 1793224817 | active | Lock | transactionid | 9 | 200 |
| 95 | 1793224817 | active | Lock | tuple | 39 | 200 |
| 96 | 1793224817 | idle | Client | ClientRead | 5 | 200 |
| 97 | 1793224817 | idle in transaction | Client | ClientRead | 8 | 200 |
| 98 | 1793224818 | active | 1 | 200 | ||
| 99 | 1793224818 | active | Client | ClientRead | 2 | 200 |
| 100 | 1793224818 | active | LWLock | WALWrite | 1 | 200 |
| 101 | 1793224818 | active | Lock | transactionid | 12 | 200 |
| 102 | 1793224818 | active | Lock | tuple | 38 | 200 |
| 103 | 1793224818 | idle | Client | ClientRead | 5 | 200 |
| 104 | 1793224818 | idle in transaction | Client | ClientRead | 5 | 200 |
| 105 | 1793224819 | active | IO | WalSync | 1 | 200 |
| 106 | 1793224819 | active | LWLock | WALWrite | 4 | 200 |
| 107 | 1793224819 | active | Lock | transactionid | 10 | 200 |
| 108 | 1793224819 | active | Lock | tuple | 36 | 200 |
| 109 | 1793224819 | idle | Client | ClientRead | 6 | 200 |
| 110 | 1793224819 | idle in transaction | Client | ClientRead | 7 | 200 |
| 111 | 1793224820 | active | 1 | 200 | ||
| 112 | 1793224820 | active | IO | WalSync | 1 | 200 |
| 113 | 1793224820 | active | LWLock | WALWrite | 6 | 200 |
| 114 | 1793224820 | active | Lock | transactionid | 29 | 200 |
| 115 | 1793224820 | active | Lock | tuple | 23 | 200 |
| 116 | 1793224820 | idle | Client | ClientRead | 1 | 200 |
| 117 | 1793224820 | idle in transaction | Client | ClientRead | 2 | 200 |
| 118 | 1793224820 | idle in transaction | LWLock | WALWrite | 1 | 200 |
| 119 | 1793224821 | active | Client | ClientRead | 7 | 200 |
| 120 | 1793224821 | active | LWLock | WALWrite | 1 | 200 |
| 121 | 1793224821 | active | Lock | transactionid | 7 | 200 |
| 122 | 1793224821 | active | Lock | tuple | 36 | 200 |
| 123 | 1793224821 | idle | Client | ClientRead | 2 | 200 |
| 124 | 1793224821 | idle | Lock | tuple | 3 | 200 |
| 125 | 1793224821 | idle in transaction | 1 | 200 | ||
| 126 | 1793224821 | idle in transaction | Client | ClientRead | 3 | 200 |
| 127 | 1793224821 | idle in transaction | IO | WalSync | 1 | 200 |
| 128 | 1793224821 | idle in transaction | Lock | transactionid | 1 | 200 |
| 129 | 1793224821 | idle in transaction | Lock | tuple | 2 | 200 |
| 130 | 1793224822 | active | IO | WalSync | 1 | 200 |
| 131 | 1793224822 | active | LWLock | WALWrite | 1 | 200 |
| 132 | 1793224822 | active | Lock | transactionid | 8 | 200 |
| 133 | 1793224822 | active | Lock | tuple | 41 | 200 |
| 134 | 1793224822 | idle | Client | ClientRead | 4 | 200 |
| 135 | 1793224822 | idle in transaction | 1 | 200 | ||
| 136 | 1793224822 | idle in transaction | Client | ClientRead | 8 | 200 |
| 137 | 1793224824 | active | Client | ClientRead | 2 | 200 |
| 138 | 1793224824 | active | Lock | transactionid | 11 | 200 |
| 139 | 1793224824 | active | Lock | tuple | 36 | 200 |
| 140 | 1793224824 | idle | Client | ClientRead | 5 | 200 |
| 141 | 1793224824 | idle in transaction | Client | ClientRead | 10 | 200 |
| 142 | 1793224825 | active | Client | ClientRead | 10 | 200 |
| 143 | 1793224825 | active | LWLock | WALWrite | 1 | 200 |
| 144 | 1793224825 | active | Lock | transactionid | 6 | 200 |
| 145 | 1793224825 | active | Lock | tuple | 36 | 200 |
| 146 | 1793224825 | idle | Client | ClientRead | 4 | 200 |
| 147 | 1793224825 | idle | Lock | tuple | 1 | 200 |
| 148 | 1793224825 | idle in transaction | Client | ClientRead | 3 | 200 |
| 149 | 1793224825 | idle in transaction | Lock | tuple | 3 | 200 |
| 150 | 1793224826 | active | Client | ClientRead | 5 | 200 |
| 151 | 1793224826 | active | LWLock | WALWrite | 1 | 200 |
| 152 | 1793224826 | active | Lock | transactionid | 13 | 200 |
| 153 | 1793224826 | active | Lock | tuple | 32 | 200 |
| 154 | 1793224826 | idle | Client | ClientRead | 6 | 200 |
| 155 | 1793224826 | idle | Lock | tuple | 1 | 200 |
| 156 | 1793224826 | idle in transaction | 2 | 200 | ||
| 157 | 1793224826 | idle in transaction | Client | ClientRead | 2 | 200 |
| 158 | 1793224826 | idle in transaction | LWLock | WALWrite | 2 | 200 |
| 159 | 1793224827 | active | IO | WalSync | 1 | 200 |
| 160 | 1793224827 | active | LWLock | WALWrite | 3 | 200 |
| 161 | 1793224827 | active | Lock | transactionid | 32 | 200 |
| 162 | 1793224827 | active | Lock | tuple | 16 | 200 |
| 163 | 1793224827 | idle | 1 | 200 | ||
| 164 | 1793224827 | idle | Client | ClientRead | 6 | 200 |
| 165 | 1793224827 | idle in transaction | Client | ClientRead | 5 | 200 |
| 166 | 1793224828 | active | 1 | 200 | ||
| 167 | 1793224828 | active | Client | ClientRead | 1 | 200 |
| 168 | 1793224828 | active | IO | WalSync | 1 | 200 |
| 169 | 1793224828 | active | LWLock | LockManager | 1 | 200 |
| 170 | 1793224828 | active | Lock | transactionid | 9 | 200 |
| 171 | 1793224828 | active | Lock | tuple | 38 | 200 |
| 172 | 1793224828 | idle | Client | ClientRead | 6 | 200 |
| 173 | 1793224828 | idle in transaction | Client | ClientRead | 7 | 200 |
| 174 | 1793224829 | active | Client | ClientRead | 1 | 200 |
| 175 | 1793224829 | active | IO | WalSync | 1 | 200 |
| 176 | 1793224829 | active | Lock | transactionid | 11 | 200 |
| 177 | 1793224829 | active | Lock | tuple | 38 | 200 |
| 178 | 1793224829 | idle | Client | ClientRead | 4 | 200 |
| 179 | 1793224829 | idle in transaction | Client | ClientRead | 9 | 200 |
| 180 | 1793224830 | active | Client | ClientRead | 1 | 200 |
| 181 | 1793224830 | active | IO | WalSync | 1 | 200 |
| 182 | 1793224830 | active | LWLock | WALWrite | 2 | 200 |
| 183 | 1793224830 | active | Lock | transactionid | 10 | 200 |
| 184 | 1793224830 | active | Lock | tuple | 37 | 200 |
| 185 | 1793224830 | idle | Client | ClientRead | 6 | 200 |
| 186 | 1793224830 | idle in transaction | Client | ClientRead | 7 | 200 |
| 187 | 1793224832 | active | 2 | 200 | ||
| 188 | 1793224832 | active | IO | WalSync | 1 | 200 |
| 189 | 1793224832 | active | LWLock | WALWrite | 1 | 200 |
| 190 | 1793224832 | active | Lock | transactionid | 17 | 200 |
| 191 | 1793224832 | active | Lock | tuple | 34 | 200 |
| 192 | 1793224832 | idle | Client | ClientRead | 5 | 200 |
| 193 | 1793224832 | idle in transaction | Client | ClientRead | 4 | 200 |
| 194 | 1793224833 | active | 1 | 200 | ||
| 195 | 1793224833 | active | Client | ClientRead | 2 | 200 |
| 196 | 1793224833 | active | IO | WalSync | 1 | 200 |
| 197 | 1793224833 | active | Lock | transactionid | 15 | 200 |
| 198 | 1793224833 | active | Lock | tuple | 33 | 200 |
| 199 | 1793224833 | idle | Client | ClientRead | 3 | 200 |
| 200 | 1793224833 | idle in transaction | Client | ClientRead | 9 | 200 |
| 201 | 1793224834 | active | Lock | transactionid | 16 | 200 |
| 202 | 1793224834 | active | Lock | tuple | 34 | 200 |
| 203 | 1793224834 | idle | Client | ClientRead | 4 | 200 |
| 204 | 1793224834 | idle in transaction | 1 | 200 | ||
| 205 | 1793224834 | idle in transaction | Client | ClientRead | 9 | 200 |
| 206 | 1793224835 | active | IO | WalSync | 1 | 200 |
| 207 | 1793224835 | active | LWLock | WALWrite | 7 | 200 |
| 208 | 1793224835 | active | Lock | transactionid | 15 | 200 |
| 209 | 1793224835 | active | Lock | tuple | 38 | 200 |
| 210 | 1793224835 | idle | Client | ClientRead | 1 | 200 |
| 211 | 1793224835 | idle in transaction | Client | ClientRead | 2 | 200 |
| 212 | 1793224836 | active | 2 | 200 | ||
| 213 | 1793224836 | active | Client | ClientRead | 13 | 200 |
| 214 | 1793224836 | active | IO | WalSync | 1 | 200 |
| 215 | 1793224836 | active | LWLock | WALWrite | 4 | 200 |
| 216 | 1793224836 | active | Lock | transactionid | 11 | 200 |
| 217 | 1793224836 | active | Lock | tuple | 33 | 200 |
| 218 | 1793224837 | active | Client | ClientRead | 1 | 200 |
| 219 | 1793224837 | active | Lock | transactionid | 5 | 200 |
| 220 | 1793224837 | active | Lock | tuple | 47 | 200 |
| 221 | 1793224837 | idle | Client | ClientRead | 4 | 200 |
| 222 | 1793224837 | idle in transaction | Client | ClientRead | 6 | 200 |
| 223 | 1793224837 | idle in transaction | IO | WalSync | 1 | 200 |
| 224 | 1793224838 | active | 1 | 200 | ||
| 225 | 1793224838 | active | Client | ClientRead | 2 | 200 |
| 226 | 1793224838 | active | Lock | transactionid | 14 | 200 |
| 227 | 1793224838 | active | Lock | tuple | 33 | 200 |
| 228 | 1793224838 | idle | Client | ClientRead | 5 | 200 |
| 229 | 1793224838 | idle in transaction | 1 | 200 | ||
| 230 | 1793224838 | idle in transaction | Client | ClientRead | 8 | 200 |
| 231 | 1793224840 | active | 2 | 200 | ||
| 232 | 1793224840 | active | LWLock | BufferContent | 1 | 200 |
| 233 | 1793224840 | active | Lock | transactionid | 9 | 200 |
| 234 | 1793224840 | active | Lock | tuple | 38 | 200 |
| 235 | 1793224840 | idle | Client | ClientRead | 4 | 200 |
| 236 | 1793224840 | idle in transaction | 2 | 200 | ||
| 237 | 1793224840 | idle in transaction | Client | ClientRead | 8 | 200 |
| 238 | 1793224841 | active | 3 | 200 | ||
| 239 | 1793224841 | active | LWLock | WALWrite | 1 | 200 |
| 240 | 1793224841 | active | Lock | transactionid | 11 | 200 |
| 241 | 1793224841 | active | Lock | tuple | 34 | 200 |
| 242 | 1793224841 | idle | Client | ClientRead | 8 | 200 |
| 243 | 1793224841 | idle in transaction | Client | ClientRead | 7 | 200 |
| 244 | 1793224842 | idle | Client | ClientRead | 64 | 200 |