Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Add --disable_watches flag
Browse files Browse the repository at this point in the history
Setting this flag to true makes fleet not set any watches in etcd. This
should aid in making fleet scale better.
  • Loading branch information
Miek Gieben committed Feb 10, 2016
1 parent 7b2a547 commit 62458cf
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Documentation/fleet-scaling.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,9 @@ wins:
* Making some defaults exported and allow them to be overridden. For instance
fleet's tokenLimit controls how many Units are listed per "page". *See the
`--token-limit` flag.*

* Removing watches from fleet: By removing the watches from fleet we stop
the entire cluster from walking up whenever a new job is to be scheduled.
The downside of this change is that fleet's responsiveness is lower.
*See the `--disable-watches` flag.*

1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type Config struct {
AgentTTL string
TokenLimit int
DisableEngine bool
DisableWatches bool
VerifyUnits bool
AuthorizedKeysFile string
}
Expand Down
2 changes: 2 additions & 0 deletions fleetd/fleetd.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func main() {
cfgset.String("agent_ttl", agent.DefaultTTL, "TTL in seconds of fleet machine state in etcd")
cfgset.Int("token_limit", 100, "Maximum number of entries per page returned from API requests")
cfgset.Bool("disable_engine", false, "Disable the engine entirely, use with care")
cfgset.Bool("disable_watches", false, "Disable the use of etcd watches. Increases scheduling latency")
cfgset.Bool("verify_units", false, "DEPRECATED - This option is ignored")
cfgset.String("authorized_keys_file", "", "DEPRECATED - This option is ignored")

Expand Down Expand Up @@ -195,6 +196,7 @@ func getConfig(flagset *flag.FlagSet, userCfgFile string) (*config.Config, error
RawMetadata: (*flagset.Lookup("metadata")).Value.(flag.Getter).Get().(string),
AgentTTL: (*flagset.Lookup("agent_ttl")).Value.(flag.Getter).Get().(string),
DisableEngine: (*flagset.Lookup("disable_engine")).Value.(flag.Getter).Get().(bool),
DisableWatches: (*flagset.Lookup("disable_watches")).Value.(flag.Getter).Get().(bool),
VerifyUnits: (*flagset.Lookup("verify_units")).Value.(flag.Getter).Get().(bool),
TokenLimit: (*flagset.Lookup("token_limit")).Value.(flag.Getter).Get().(int),
AuthorizedKeysFile: (*flagset.Lookup("authorized_keys_file")).Value.(flag.Getter).Get().(string),
Expand Down
5 changes: 4 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ func New(cfg config.Config) (*Server, error) {

a := agent.New(mgr, gen, reg, mach, agentTTL)

rStream := registry.NewEtcdEventStream(kAPI, cfg.EtcdKeyPrefix)
var rStream pkg.EventStream
if !cfg.DisableWatches {
rStream = registry.NewEtcdEventStream(kAPI, cfg.EtcdKeyPrefix)
}
lManager := lease.NewEtcdLeaseManager(kAPI, cfg.EtcdKeyPrefix, etcdRequestTimeout)

ar := agent.NewReconciler(reg, rStream)
Expand Down

0 comments on commit 62458cf

Please sign in to comment.