Conversation
… destination cloud and region
goos: linux
goarch: amd64
pkg: github.com/buildbuddy-io/buildbuddy/enterprise/server/util/egress
cpu: AMD Ryzen 9 7900X 12-Core Processor
│ /tmp/base │ /tmp/after │
│ sec/op │ sec/op vs base │
StatsHandler/cached_hit-24 180.2n ± 5% 156.9n ± 7% -12.93% (p=0.001 n=7)
StatsHandler/cached_hit_multiple_payloads-24 631.1n ± 2% 199.8n ± 2% -68.34% (p=0.001 n=7)
StatsHandler/varying_ips-24 110.0µ ± 1% 109.7µ ± 2% ~ (p=0.165 n=7)
geomean 2.322µ 1.509µ -34.98%
│ /tmp/base │ /tmp/after │
│ B/op │ B/op vs base │
StatsHandler/cached_hit-24 184.0 ± 0% 136.0 ± 0% -26.09% (p=0.001 n=7)
StatsHandler/cached_hit_multiple_payloads-24 184.0 ± 0% 136.0 ± 0% -26.09% (p=0.001 n=7)
StatsHandler/varying_ips-24 439.0 ± 0% 391.0 ± 0% -10.93% (p=0.001 n=7)
geomean 245.9 193.4 -21.35%
│ /tmp/base │ /tmp/after │
│ allocs/op │ allocs/op vs base │
StatsHandler/cached_hit-24 5.000 ± 0% 4.000 ± 0% -20.00% (p=0.001 n=7)
StatsHandler/cached_hit_multiple_payloads-24 5.000 ± 0% 4.000 ± 0% -20.00% (p=0.001 n=7)
StatsHandler/varying_ips-24 9.000 ± 0% 8.000 ± 0% -11.11% (p=0.001 n=7)
geomean 6.082 5.040 -17.14%
|
do we need one package per platform? the tools are simple enough that you could put them into a single tool. then it's just one binary to run to refresh all the ranges. |
|
@vadimberezniker , I blame claude. I'll tell it to merge the commands. Do you think we should still have separate files for each provider? It might make diffs a bit easier to see. |
yeah one file per provider is fine. if you want you can also filter out the IPV6 ranges from the files. we currently don't serve over ipv6. |
| if info == nil { | ||
| return ctx | ||
| } | ||
| return context.WithValue(ctx, connDestinationKey{}, h.classifier.classify(info.RemoteAddr)) |
There was a problem hiding this comment.
Because of the load balancer siting in the middle info.RemoteAddr is going to give you the address of the LB proxy. You can use the clientip package to get the IP of the real client. This also means you can't cache this at the connection level.
vadimberezniker
left a comment
There was a problem hiding this comment.
You should add a classifier for private IPs to explicitly categorize internal traffic, otherwise looks good.
Good idea. Done. |
Based on #11508
I'll consolidate with https://github.com/buildbuddy-io/buildbuddy-internal/pull/6809 in a later PR.