lab4: исправления по ревью

This commit is contained in:
Vladislav Kunetskiy
2026-10-21 23:25:11 +03:00
parent 3389c6c900
commit e9f0fde6f2
32 changed files with 451 additions and 131 deletions
+3 -1
View File
@@ -14,7 +14,7 @@ with SeaweedFS 3.80, two API replicas and HAProxy.
| `s3-init.txt` | Idempotent bucket bootstrap, app/forbidden prefix probes | `docker compose run --rm s3-init` (twice) |
| `private-bucket.txt` | Anonymous S3 GET and published ports | `docker compose exec seaweedfs wget ...` |
| `s3-outage.txt` | S3 down: attachments 503, other endpoints 200 | `docker compose stop seaweedfs` |
| `sweep.txt` | Abandoned presign cleanup after grace; ready survives | `S3_SWEEP_GRACE=2s S3_SWEEP_INTERVAL=1s` |
| `sweep.txt` | Abandoned presign cleanup after grace; ready survives | `S3_SWEEP_GRACE=2s S3_SWEEP_INTERVAL=1s S3_PRESIGN_TTL=1s` |
| `memory/` | 10 concurrent 9.4 MiB uploads, cgroup memory samples | `python3 scripts/lab4_memory_experiment.py` |
| `track1/` | Proxy vs presigned upload: traffic, latency, memory | `python3 scripts/lab4_track1.py` |
@@ -26,3 +26,5 @@ Notes:
the primary RAM metric.
- Presigned completion re-reads the object once to verify SHA-256, so API RX
stays close to the file size. The client-facing LB leg is the actual saving.
- Presigned URLs sign `Content-Length`: an oversized PUT is rejected by S3 with 403
before anything is stored.
+1 -1
View File
@@ -1 +1 @@
PASS: lab4 attachment failover; served by cbc4cbeea6da
PASS: lab4 attachment failover; served by 7fd3e5df907d
+6 -4
View File
@@ -1,5 +1,7 @@
elapsed,phase,anon,current
0.367,during,281419776,386904064
1.063,during,281698304,384315392
1.689,during,281784320,369328128
2.139,during,281849856,290664448
0.378,during,281362432,400949248
0.804,during,281423872,381423616
1.395,during,281542656,403361792
1.827,during,281542656,371871744
2.376,during,281632768,411824128
2.81,during,281653248,381726720
1 elapsed phase anon current
2 0.367 0.378 during 281419776 281362432 386904064 400949248
3 1.063 0.804 during 281698304 281423872 384315392 381423616
4 1.689 1.395 during 281784320 281542656 369328128 403361792
5 2.139 1.827 during 281849856 281542656 290664448 371871744
6 2.376 during 281632768 411824128
7 2.81 during 281653248 381726720
+5 -5
View File
@@ -3,9 +3,9 @@ concurrency: 10
file_size_bytes: 9454448
uploads: 30
rounds: 3
elapsed_seconds: 2.097
baseline_anon_bytes: 279879680
peak_anon_bytes: 281849856
anon_delta_bytes: 1970176
peak_memory_current_bytes: 386904064
elapsed_seconds: 2.980
baseline_anon_bytes: 280317952
peak_anon_bytes: 281653248
anon_delta_bytes: 1335296
peak_memory_current_bytes: 411824128
note: memory.current includes page cache from temporary spool files; anon is the primary metric
+6 -6
View File
@@ -2,13 +2,13 @@
Container mtusi-messenger-lab4-seaweedfs-1 Running
Container mtusi-messenger-lab4-seaweedfs-1 Waiting
Container mtusi-messenger-lab4-seaweedfs-1 Healthy
Container mtusi-messenger-lab4-s3-init-run-6d633e58a067 Creating
Container mtusi-messenger-lab4-s3-init-run-6d633e58a067 Created
{"time":"2026-10-21T19:37:16.099886123Z","level":"INFO","msg":"s3 bucket ready","endpoint":"http://seaweedfs:8333","bucket":"messenger-attachments"}
Container mtusi-messenger-lab4-s3-init-run-77217672cba1 Creating
Container mtusi-messenger-lab4-s3-init-run-77217672cba1 Created
{"time":"2026-10-21T20:24:44.714991263Z","level":"INFO","msg":"s3 bucket ready","endpoint":"http://seaweedfs:8333","bucket":"messenger-attachments"}
=== run 2 (idempotent) ===
Container mtusi-messenger-lab4-seaweedfs-1 Running
Container mtusi-messenger-lab4-seaweedfs-1 Waiting
Container mtusi-messenger-lab4-seaweedfs-1 Healthy
Container mtusi-messenger-lab4-s3-init-run-a60a52baaf22 Creating
Container mtusi-messenger-lab4-s3-init-run-a60a52baaf22 Created
{"time":"2026-10-21T19:37:16.941920617Z","level":"INFO","msg":"s3 bucket ready","endpoint":"http://seaweedfs:8333","bucket":"messenger-attachments"}
Container mtusi-messenger-lab4-s3-init-run-33ccde88f9aa Creating
Container mtusi-messenger-lab4-s3-init-run-33ccde88f9aa Created
{"time":"2026-10-21T20:24:45.578062247Z","level":"INFO","msg":"s3 bucket ready","endpoint":"http://seaweedfs:8333","bucket":"messenger-attachments"}
+2 -2
View File
@@ -1,8 +1,8 @@
created attachment before outage: 01a15ff7-e2fe-7a6c-b896-c61c3451a6c5
created attachment before outage: 01a1601e-9947-753c-8085-65db29e8a909
seaweedfs stopped
health/ready during outage: {'status': 'ok'}
chat list during outage: 200
download during outage: 503
upload during outage: 503
seaweedfs restarted
upload after recovery: ready 01a15ff8-6610-7628-a06a-26e590c6186b
upload after recovery: ready 01a1601f-1c45-793b-bb59-281781ea8482
+2 -3
View File
@@ -1,5 +1,4 @@
ready attachment created: 01a15ff8-9634-77d1-b7e2-cd5831a19d49
abandoned presign attachment: 01a15ff8-9639-7e03-a71c-2971e9425972 (no PUT)
ready attachment created: 01a16022-78dc-7349-b3da-2937b2faf1f0
abandoned presign attachment: 01a16022-78e3-733f-861b-0443011dcfc8 (no PUT)
abandoned pending row removed after grace
ready attachment survived sweep: ready 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
sweeper settings restored (10m/1m)
+20 -20
View File
@@ -1,21 +1,21 @@
size,bytes,flow,iteration,latency_s,lb_rx_bytes,lb_tx_bytes,api_rx_bytes,api_tx_bytes,api_anon_peak
~1MiB,1050888,proxy,0,0.2246,1059079,1059227,1059155,1060779,282734592
~1MiB,1050888,proxy,1,0.2436,1057539,1058793,1058440,1058956,282742784
~1MiB,1050888,proxy,2,0.2276,1058111,1058605,1059413,1060497,282763264
~1MiB,1050888,proxy,3,0.2225,1056087,1058199,1058375,1058314,282767360
~1MiB,1050888,proxy,4,0.2267,1057825,1059425,1058752,1059718,282771456
~1MiB,1050888,presign,0,0.2196,3464,3596,1058037,9166,282787840
~1MiB,1050888,presign,1,0.2249,3465,3729,1057424,9073,282836992
~1MiB,1050888,presign,2,0.2171,4015,3833,1058301,8969,282849280
~1MiB,1050888,presign,3,0.2276,3465,3597,1057489,8774,282865664
~1MiB,1050888,presign,4,0.2327,4631,4333,1057989,9060,282877952
~9MiB,9454448,proxy,0,0.2375,9490073,9512447,9506779,9489274,282886144
~9MiB,9454448,proxy,1,0.2365,9488841,9503073,9493951,9486796,282882048
~9MiB,9454448,proxy,2,0.2353,9489017,9505121,9505811,9490554,282890240
~9MiB,9454448,proxy,3,0.2282,9491723,9501595,9500701,9493150,282906624
~9MiB,9454448,proxy,4,0.229,9493835,9509411,9500971,9489868,282918912
~9MiB,9454448,presign,0,0.2359,3465,3663,9473260,11216,282935296
~9MiB,9454448,presign,1,0.235,4014,3832,9473694,11664,282968064
~9MiB,9454448,presign,2,0.2391,3465,3795,9473579,13975,283009024
~9MiB,9454448,presign,3,0.2504,4564,4068,9473083,14572,283045888
~9MiB,9454448,presign,4,0.2353,3465,3597,9473381,12391,283054080
~1MiB,1050888,proxy,0,0.2291,1058727,1075375,1074306,1059556,284934144
~1MiB,1050888,proxy,1,0.2253,1058659,1058991,1060120,1061998,285270016
~1MiB,1050888,proxy,2,0.2328,1058925,1059123,1058798,1059912,285433856
~1MiB,1050888,proxy,3,0.227,1058485,1058633,1058297,1059591,285433856
~1MiB,1050888,proxy,4,0.2284,1057165,1057115,1057126,1058104,285638656
~1MiB,1050888,presign,0,0.2249,4098,3850,1058691,10486,285917184
~1MiB,1050888,presign,1,0.2262,4163,3981,1058060,9274,286142464
~1MiB,1050888,presign,2,0.2356,3548,3680,1057677,9240,286138368
~1MiB,1050888,presign,3,0.2297,3482,3614,1058397,10146,286183424
~1MiB,1050888,presign,4,0.2388,3482,3680,1057479,8382,286216192
~9MiB,9454448,proxy,0,0.2374,9491811,9511561,9503858,9488878,286212096
~9MiB,9454448,proxy,1,0.2397,9498015,9511259,9498331,9490528,286228480
~9MiB,9454448,proxy,2,0.2247,9492207,9511759,9493573,9486286,286261248
~9MiB,9454448,proxy,3,0.2273,9486399,9496645,9483662,9481323,286285824
~9MiB,9454448,proxy,4,0.237,9483275,9494891,9493892,9482709,286285824
~9MiB,9454448,presign,0,0.2431,4098,3916,9473045,12060,286306304
~9MiB,9454448,presign,1,0.246,3552,3680,9472208,9451,286318592
~9MiB,9454448,presign,2,0.2347,4164,3982,9473447,11088,286326784
~9MiB,9454448,presign,3,0.2346,3482,3614,9471731,9174,286343168
~9MiB,9454448,presign,4,0.2389,4098,3916,9473771,14040,286367744
1 size bytes flow iteration latency_s lb_rx_bytes lb_tx_bytes api_rx_bytes api_tx_bytes api_anon_peak
2 ~1MiB 1050888 proxy 0 0.2246 0.2291 1059079 1058727 1059227 1075375 1059155 1074306 1060779 1059556 282734592 284934144
3 ~1MiB 1050888 proxy 1 0.2436 0.2253 1057539 1058659 1058793 1058991 1058440 1060120 1058956 1061998 282742784 285270016
4 ~1MiB 1050888 proxy 2 0.2276 0.2328 1058111 1058925 1058605 1059123 1059413 1058798 1060497 1059912 282763264 285433856
5 ~1MiB 1050888 proxy 3 0.2225 0.227 1056087 1058485 1058199 1058633 1058375 1058297 1058314 1059591 282767360 285433856
6 ~1MiB 1050888 proxy 4 0.2267 0.2284 1057825 1057165 1059425 1057115 1058752 1057126 1059718 1058104 282771456 285638656
7 ~1MiB 1050888 presign 0 0.2196 0.2249 3464 4098 3596 3850 1058037 1058691 9166 10486 282787840 285917184
8 ~1MiB 1050888 presign 1 0.2249 0.2262 3465 4163 3729 3981 1057424 1058060 9073 9274 282836992 286142464
9 ~1MiB 1050888 presign 2 0.2171 0.2356 4015 3548 3833 3680 1058301 1057677 8969 9240 282849280 286138368
10 ~1MiB 1050888 presign 3 0.2276 0.2297 3465 3482 3597 3614 1057489 1058397 8774 10146 282865664 286183424
11 ~1MiB 1050888 presign 4 0.2327 0.2388 4631 3482 4333 3680 1057989 1057479 9060 8382 282877952 286216192
12 ~9MiB 9454448 proxy 0 0.2375 0.2374 9490073 9491811 9512447 9511561 9506779 9503858 9489274 9488878 282886144 286212096
13 ~9MiB 9454448 proxy 1 0.2365 0.2397 9488841 9498015 9503073 9511259 9493951 9498331 9486796 9490528 282882048 286228480
14 ~9MiB 9454448 proxy 2 0.2353 0.2247 9489017 9492207 9505121 9511759 9505811 9493573 9490554 9486286 282890240 286261248
15 ~9MiB 9454448 proxy 3 0.2282 0.2273 9491723 9486399 9501595 9496645 9500701 9483662 9493150 9481323 282906624 286285824
16 ~9MiB 9454448 proxy 4 0.229 0.237 9493835 9483275 9509411 9494891 9500971 9493892 9489868 9482709 282918912 286285824
17 ~9MiB 9454448 presign 0 0.2359 0.2431 3465 4098 3663 3916 9473260 9473045 11216 12060 282935296 286306304
18 ~9MiB 9454448 presign 1 0.235 0.246 4014 3552 3832 3680 9473694 9472208 11664 9451 282968064 286318592
19 ~9MiB 9454448 presign 2 0.2391 0.2347 3465 4164 3795 3982 9473579 9473447 13975 11088 283009024 286326784
20 ~9MiB 9454448 presign 3 0.2504 0.2346 4564 3482 4068 3614 9473083 9471731 14572 9174 283045888 286343168
21 ~9MiB 9454448 presign 4 0.2353 0.2389 3465 4098 3597 3916 9473381 9473771 12391 14040 283054080 286367744
+4 -4
View File
@@ -2,10 +2,10 @@ Lab4 track 1: proxy vs presigned upload
| size | flow | median latency, s | p95 latency, s | LB rx, bytes | API rx, bytes | API anon peak, bytes |
|---|---|---:|---:|---:|---:|---:|
| ~1MiB | proxy | 0.227 | 0.244 | 1057728 | 1058827 | 282771456 |
| ~1MiB | presign | 0.225 | 0.233 | 3808 | 1057848 | 282877952 |
| ~9MiB | proxy | 0.235 | 0.237 | 9490698 | 9501643 | 282918912 |
| ~9MiB | presign | 0.236 | 0.250 | 3795 | 9473399 | 283054080 |
| ~1MiB | proxy | 0.228 | 0.233 | 1058392 | 1061729 | 285638656 |
| ~1MiB | presign | 0.230 | 0.239 | 3755 | 1058061 | 286216192 |
| ~9MiB | proxy | 0.237 | 0.240 | 9490341 | 9494663 | 286285824 |
| ~9MiB | presign | 0.239 | 0.246 | 3879 | 9472840 | 286367744 |
Note: presigned upload keeps the file body off the API request path and off the load balancer.
Completion still streams the object from S3 once to verify its SHA-256, so api_rx stays close to