Skip to content

Commit

Permalink
Merge pull request #803 from fabiolb/feature/changedefaultGOGC
Browse files Browse the repository at this point in the history
Updating the default GOGC to 100.  800 proves to be a bit insane.
  • Loading branch information
nathanejohnson committed Dec 1, 2020
2 parents 019ad7a + d69d99f commit 38b22e3
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

0 comments on commit 38b22e3

Please sign in to comment.