@@ -30,8 +30,14 @@ const (
30
30
)
31
31
32
32
const (
33
- // DefaultPreheatConcurrentCount is the default concurrent count for preheating all peers.
34
- DefaultPreheatConcurrentCount = 1000
33
+ // DefaultPreheatConcurrentPeerCount is the default concurrent peer count for preheating all peers.
34
+ DefaultPreheatConcurrentPeerCount = 500
35
+
36
+ // DefaultPreheatConcurrentTaskCount is the default concurrent task count for preheating all peers.
37
+ DefaultPreheatConcurrentTaskCount = 8
38
+
39
+ // DefaultPreheatConcurrentLayerCount is the default concurrent layer count for getting image distribution.
40
+ DefaultPreheatConcurrentLayerCount = 8
35
41
36
42
// DefaultJobTimeout is the default timeout for executing job.
37
43
DefaultJobTimeout = 60 * time .Minute
@@ -161,8 +167,16 @@ type PreheatArgs struct {
161
167
// Applies to 'all_peers' and 'all_seed_peers' scopes.
162
168
Count * uint32 `json:"count" binding:"omitempty,gte=1,lte=200"`
163
169
164
- // BatchSize is the batch size for preheating all peers, default is 50.
165
- ConcurrentCount int64 `json:"concurrent_count" binding:"omitempty,gte=1,lte=500"`
170
+ // ConcurrentTaskCount specifies the maximum number of tasks (e.g., image layers) to preheat concurrently.
171
+ // For example, if preheating 100 layers with ConcurrentTaskCount set to 10, up to 10 layers are processed simultaneously.
172
+ // If ConcurrentPeerCount is 10 for 1000 peers, each layer is preheated by 10 peers concurrently.
173
+ // Default is 8, maximum is 100.
174
+ ConcurrentTaskCount int64 `json:"concurrent_task_count" binding:"omitempty,gte=1,lte=100"`
175
+
176
+ // ConcurrentPeerCount specifies the maximum number of peers to preheat concurrently for a single task (e.g., an image layer).
177
+ // For example, if preheating a layer with ConcurrentPeerCount set to 10, up to 10 peers process that layer simultaneously.
178
+ // Default is 500, maximum is 1000.
179
+ ConcurrentPeerCount int64 `json:"concurrent_peer_count" binding:"omitempty,gte=1,lte=1000"`
166
180
167
181
// Timeout is the timeout for preheating, default is 30 minutes.
168
182
Timeout time.Duration `json:"timeout" binding:"omitempty"`
@@ -277,6 +291,9 @@ type GetImageDistributionArgs struct {
277
291
278
292
// The image type preheating task can specify the image architecture type. eg: linux/amd64.
279
293
Platform string `json:"platform" binding:"omitempty"`
294
+
295
+ // ConcurrentLayerCount specifies the maximum number of layers to get concurrently.
296
+ ConcurrentLayerCount int64 `json:"concurrent_layer_count" binding:"omitempty,gte=1,lte=100"`
280
297
}
281
298
282
299
// CreateGetImageDistributionJobResponse is the response for creating a get image job.
0 commit comments