fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

indexserver: remove DownloadLimitMBPS (#303)

This value was unread. It stopped being read when we removed support for
zoekt-index-archive. We have a rate limiter now running on the server
side rate limiting the git clone speeds to ensure we don't overwhelm the
network.

+8 -28
-4
cmd/zoekt-sourcegraph-indexserver/index.go
··· 72 72 73 73 // FileLimit is the maximum size of a file 74 74 FileLimit int 75 - 76 - // DownloadLimitMBPS is the maximum MB/s to use when downloading the 77 - // archive. 78 - DownloadLimitMBPS string 79 75 } 80 76 81 77 // BuildOptions returns a build.Options represented by indexArgs. Note: it
+4 -5
cmd/zoekt-sourcegraph-indexserver/index_test.go
··· 169 169 }, { 170 170 name: "all", 171 171 args: indexArgs{ 172 - Incremental: true, 173 - IndexDir: "/data/index", 174 - Parallelism: 4, 175 - FileLimit: 123, 176 - DownloadLimitMBPS: "1000", 172 + Incremental: true, 173 + IndexDir: "/data/index", 174 + Parallelism: 4, 175 + FileLimit: 123, 177 176 IndexOptions: IndexOptions{ 178 177 Name: "test/repo", 179 178 CloneURL: "http://api.test/.internal/git/test/repo",
-14
cmd/zoekt-sourcegraph-indexserver/main.go
··· 509 509 510 510 // 1 MB; match https://sourcegraph.sgdev.org/github.com/sourcegraph/sourcegraph/-/blob/cmd/symbols/internal/symbols/search.go#L22 511 511 FileLimit: 1 << 20, 512 - 513 - // We are downloading archives from within the same network from 514 - // another Sourcegraph service (gitserver). This can end up being 515 - // so fast that we harm gitserver's network connectivity and our 516 - // own. In the case of zoekt-indexserver and gitserver running on 517 - // the same host machine, we can even reach up to ~100 Gbps and 518 - // effectively DoS the Docker network, temporarily disrupting other 519 - // containers running on the host. 520 - // 521 - // Google Compute Engine has a network bandwidth of about 1.64 Gbps 522 - // between nodes, and AWS varies widely depending on instance type. 523 - // We play it safe and default to 1 Gbps here (~119 MiB/s), which 524 - // means we can fetch a 1 GiB archive in ~8.5 seconds. 525 - DownloadLimitMBPS: "1000", // 1 Gbps 526 512 } 527 513 } 528 514
+4 -5
cmd/zoekt-sourcegraph-indexserver/main_test.go
··· 33 33 IndexOptions: IndexOptions{ 34 34 Name: "testName", 35 35 }, 36 - IndexDir: "/testdata/index", 37 - Parallelism: 6, 38 - Incremental: true, 39 - FileLimit: 1 << 20, 40 - DownloadLimitMBPS: "1000", 36 + IndexDir: "/testdata/index", 37 + Parallelism: 6, 38 + Incremental: true, 39 + FileLimit: 1 << 20, 41 40 } 42 41 got := s.indexArgs(IndexOptions{Name: "testName"}) 43 42 if !cmp.Equal(got, want) {