Skip to content

Commit 8ce7713

Browse files
committed
MINOR: global: add glitches_kill_cpu_usage to tune options
1 parent 2e7409b commit 8ce7713

10 files changed

Lines changed: 69 additions & 2 deletions

File tree

config-parser/section-parsers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ func (p *configParser) getGlobalParser() *Parsers { //nolint: maintidx
287287
addParser(parser, &sequence, &simple.Word{Name: "tune.epoll.mask-events"})
288288
addParser(parser, &sequence, &simple.Number{Name: "tune.events.max-events-at-once"})
289289
addParser(parser, &sequence, &simple.Enabled{Name: "tune.fail-alloc"})
290+
addParser(parser, &sequence, &simple.Number{Name: "tune.glitches.kill.cpu-usage"})
290291
addParser(parser, &sequence, &simple.OnOff{Name: "tune.fd.edge-triggered"})
291292
addParser(parser, &sequence, &simple.OnOff{Name: "tune.h1.zero-copy-fwd-recv"})
292293
addParser(parser, &sequence, &simple.OnOff{Name: "tune.h1.zero-copy-fwd-send"})

configuration/global.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,15 @@ func parseTuneOptions(p parser.Parser) (*models.TuneOptions, error) { //nolint:g
13051305
options.FailAlloc = boolOption
13061306
}
13071307

1308+
intPOption, err = parseInt64POption(p, "tune.glitches.kill.cpu-usage")
1309+
if err != nil {
1310+
return nil, err
1311+
}
1312+
if intOption != 0 {
1313+
isEmpty = false
1314+
options.GlitchesKillCPUUsage = intPOption
1315+
}
1316+
13081317
intOption, err = parseInt64Option(p, "tune.h2.header-table-size")
13091318
if err != nil {
13101319
return nil, err
@@ -3767,6 +3776,9 @@ func serializeTuneOptions(p parser.Parser, options *models.TuneOptions, configOp
37673776
if err := serializeBoolOption(p, "tune.fail-alloc", options.FailAlloc); err != nil {
37683777
return err
37693778
}
3779+
if err := serializeInt64POption(p, "tune.glitches.kill.cpu-usage", options.GlitchesKillCPUUsage); err != nil {
3780+
return err
3781+
}
37703782
if err := serializeInt64Option(p, "tune.h2.header-table-size", options.H2HeaderTableSize); err != nil {
37713783
return err
37723784
}

models/tune_options.go

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/tune_options_compare.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/tune_options_compare_test.go

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/build/haproxy_spec.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,12 @@ definitions:
15111511
- disabled
15121512
type: string
15131513
x-display-name: Edge-triggered polling mode
1514+
glitches_kill_cpu_usage:
1515+
maximum: 100
1516+
minimum: 0
1517+
type: integer
1518+
x-display-name: CPU Usage Kill glitched Connections
1519+
x-nullable: true
15141520
h1_zero_copy_fwd_recv:
15151521
enum:
15161522
- enabled
@@ -1701,6 +1707,7 @@ definitions:
17011707
- restricted
17021708
- full
17031709
type: string
1710+
x-display-name: Takeover Other Thread Groups Connections
17041711
type: object
17051712
tune_quic_options:
17061713
properties:

specification/models/configuration/global.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,12 @@ tune_options:
481481
fail_alloc:
482482
type: boolean
483483
x-display-name: Failed Allocation Chance
484+
glitches_kill_cpu_usage:
485+
type: integer
486+
minimum: 0
487+
maximum: 100
488+
x-nullable: true
489+
x-display-name: CPU Usage Kill glitched Connections
484490
h1_zero_copy_fwd_recv:
485491
type: string
486492
enum: [enabled, disabled]
@@ -651,6 +657,7 @@ tune_options:
651657
takeover_other_tg_connections:
652658
type: string
653659
enum: ["none", "restricted", "full"]
660+
x-display-name: Takeover Other Thread Groups Connections
654661
fd_edge_triggered:
655662
type: string
656663
enum: [enabled, disabled]

test/configuration_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ global
6060
tune.disable-zero-copy-forwarding
6161
tune.events.max-events-at-once 10
6262
tune.fail-alloc
63+
tune.glitches.kill.cpu-usage 75
6364
tune.fd.edge-triggered on
6465
tune.h1.zero-copy-fwd-recv on
6566
tune.h1.zero-copy-fwd-send on

test/expected/structured.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@
285285
],
286286
"events_max_events_at_once": 10,
287287
"fail_alloc": true,
288+
"glitches_kill_cpu_usage": 75,
288289
"fd_edge_triggered": "enabled",
289290
"h1_zero_copy_fwd_recv": "enabled",
290291
"h1_zero_copy_fwd_send": "enabled",

test/global_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ func getGlobalBase() models.GlobalBase {
185185
TuneOptions: &models.TuneOptions{
186186
DisableZeroCopyForwarding: true,
187187
EventsMaxEventsAtOnce: 50,
188+
GlitchesKillCPUUsage: misc.Int64P(25),
188189
H1ZeroCopyFwdRecv: "disabled",
189190
H1ZeroCopyFwdSend: "disabled",
190191
H2ZeroCopyFwdSend: "disabled",

0 commit comments

Comments
 (0)