forked from NebulousLabs/Sia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
consts.go
59 lines (51 loc) · 1.79 KB
/
consts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package renter
import (
"time"
"github.com/NebulousLabs/Sia/build"
)
var (
// chunkDownloadTimeout defines the maximum amount of time to wait for a
// chunk download to finish before returning in the download-to-upload repair
// loop
chunkDownloadTimeout = build.Select(build.Var{
Dev: 15 * time.Minute,
Standard: 15 * time.Minute,
Testing: 1 * time.Minute,
}).(time.Duration)
// defaultMemory establishes the default amount of memory that the renter
// will use when performing uploads and downloads. Const should be a factor
// of 4 MiB, since most operations will be on data pieces that are 4 MiB
// each.
defaultMemory = build.Select(build.Var{
Dev: uint64(1 << 28), // 256 MiB
Standard: uint64(3 * 1 << 28), // 768 MiB
Testing: uint64(1 << 17), // 128 KiB - 4 KiB sector size, need to test memory exhaustion
}).(uint64)
// Limit the number of doublings to prevent overflows.
maxConsecutivePenalty = build.Select(build.Var{
Dev: 4,
Standard: 10,
Testing: 3,
}).(int)
// maxScheduledDownloads specifies the number of chunks that can be downloaded
// for auto repair at once. If the limit is reached new ones will only be scheduled
// once old ones are scheduled for upload
maxScheduledDownloads = build.Select(build.Var{
Dev: 5,
Standard: 10,
Testing: 5,
}).(int)
// rebuildChunkHeapInterval defines how long the renter sleeps between
// checking on the filesystem health.
rebuildChunkHeapInterval = build.Select(build.Var{
Dev: 90 * time.Second,
Standard: 15 * time.Minute,
Testing: 3 * time.Second,
}).(time.Duration)
// Prime to avoid intersecting with regular events.
uploadFailureCooldown = build.Select(build.Var{
Dev: time.Second * 7,
Standard: time.Second * 61,
Testing: time.Second,
}).(time.Duration)
)