Skip to content

Commit

Permalink
Updating the default GOGC to 100. 800 proves to be a bit insane.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanejohnson committed Dec 1, 2020
1 parent 019ad7a commit d69d99f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 28 deletions.
2 changes: 1 addition & 1 deletion config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var defaultConfig = &Config{
Retry: 500 * time.Millisecond,
},
Runtime: Runtime{
GOGC: 800,
GOGC: 100,
GOMAXPROCS: runtime.NumCPU(),
},
UI: UI{
Expand Down
15 changes: 3 additions & 12 deletions docs/content/ref/runtime.gogc.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,9 @@ the value from the config file.
Increasing this value means fewer but longer GC cycles
since there is more garbage to collect.

The default of `GOGC=100` works for Go 1.4 but shows
a significant performance drop for Go 1.5 since the
concurrent GC kicks in more often.

During benchmarking I have found the following values
to work for my setup and for now I consider them sane
defaults for both Go 1.4 and Go 1.5.

GOGC=100: Go 1.5 40% slower than Go 1.4
GOGC=200: Go 1.5 == Go 1.4 with GOGC=100 (default)
GOGC=800: both Go 1.4 and 1.5 significantly faster (40%/go1.4, 100%/go1.5)
NOTE - the default for fabio up to 1.5.14 was 800. This changed
to 100 in version 1.5.15

The default is

runtime.gogc = 800
runtime.gogc = 100
18 changes: 3 additions & 15 deletions fabio.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1184,24 +1184,12 @@
# environment variable which also takes precedence over
# the value from the config file.
#
# Increasing this value means fewer but longer GC cycles
# since there is more garbage to collect.
#
# The default of GOGC=100 works for Go 1.4 but shows
# a significant performance drop for Go 1.5 since the
# concurrent GC kicks in more often.
#
# During benchmarking I have found the following values
# to work for my setup and for now I consider them sane
# defaults for both Go 1.4 and Go 1.5.
#
# GOGC=100: Go 1.5 40% slower than Go 1.4
# GOGC=200: Go 1.5 == Go 1.4 with GOGC=100 (default)
# GOGC=800: both Go 1.4 and 1.5 significantly faster (40%/go1.4, 100%/go1.5)
# NOTE - the default for fabio up to 1.5.14 was 800. This changed
# to 100 in version 1.5.15
#
# The default is
#
# runtime.gogc = 800
# runtime.gogc = 100


# runtime.gomaxprocs configures GOMAXPROCS.
Expand Down

1 comment on commit d69d99f

@analytically
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test this? We're seeing much larger latency with this change.

Please sign in to comment.