Skip to content

yaml: use float64 for durations#6250

Merged
sougou merged 3 commits intovitessio:masterfrom
planetscale:ss-yaml-floats
Jun 2, 2020
Merged

yaml: use float64 for durations#6250
sougou merged 3 commits intovitessio:masterfrom
planetscale:ss-yaml-floats

Conversation

@sougou
Copy link
Copy Markdown
Contributor

@sougou sougou commented May 31, 2020

There are some use cases where users needed to specify a sub-second
duration. I tried changing the units of all the variables to Ms
but that made everything else worse because some of the numbers
were becoming non human readable.

Instead, we'll use float64 values that also support whole numbers
up to 53 bits.

To further standardize, I've changed HeartbeatIntervalMilliseconds
to Seconds.

Finally, added support for a new flag that allows setting of timeouts
for olap pools. Some users want this option in the command line until
they migrate to using yamls.

@sougou sougou requested review from deepthi and enisoc May 31, 2020 00:37
sougou added 3 commits May 30, 2020 22:46
There are some use cases where users needed to specify a sub-second
duration. I tried changing the units of all the variables to Ms
but that made everything else worse because some of the numbers
were becoming non human readable.

Instead, we'll use float64 values that also support whole numbers
up to 53 bits.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Now that we allow fractional seconds, let's use this as a
standardized unit.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
This flag didn't previously exist, but there are users that want
to fine tune this setting.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
flag.IntVar(&currentConfig.OltpReadPool.IdleTimeoutSeconds, "queryserver-config-idle-timeout", defaultConfig.OltpReadPool.IdleTimeoutSeconds, "query server idle timeout (in seconds), vttablet manages various mysql connection pools. This config means if a connection has not been used in given idle timeout, this connection will be removed from pool. This effectively manages number of connection objects and optimize the pool performance.")
flag.Float64Var(&currentConfig.SchemaReloadIntervalSeconds, "queryserver-config-schema-reload-time", defaultConfig.SchemaReloadIntervalSeconds, "query server schema reload time, how often vttablet reloads schemas from underlying MySQL instance in seconds. vttablet keeps table schemas in its own memory and periodically refreshes it from MySQL. This config controls the reload time.")
flag.Float64Var(&currentConfig.Oltp.QueryTimeoutSeconds, "queryserver-config-query-timeout", defaultConfig.Oltp.QueryTimeoutSeconds, "query server query timeout (in seconds), this is the query timeout in vttablet side. If a query takes more than this timeout, it will be killed.")
flag.Float64Var(&currentConfig.OltpReadPool.TimeoutSeconds, "queryserver-config-query-pool-timeout", defaultConfig.OltpReadPool.TimeoutSeconds, "query server query pool timeout (in seconds), it is how long vttablet waits for a connection from the query pool. If set to 0 (default) then the overall query timeout is used instead.")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How are the params grouped? I would have expected a grouping either by type (BoolVar/IntVar/Float64Var) or by "config group" (Oltp/OltpReadPool) etc..

Copy link
Copy Markdown
Collaborator

@deepthi deepthi left a comment

Choose a reason for hiding this comment

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

LGTM

flag.Float64Var(&currentConfig.SchemaReloadIntervalSeconds, "queryserver-config-schema-reload-time", defaultConfig.SchemaReloadIntervalSeconds, "query server schema reload time, how often vttablet reloads schemas from underlying MySQL instance in seconds. vttablet keeps table schemas in its own memory and periodically refreshes it from MySQL. This config controls the reload time.")
flag.Float64Var(&currentConfig.Oltp.QueryTimeoutSeconds, "queryserver-config-query-timeout", defaultConfig.Oltp.QueryTimeoutSeconds, "query server query timeout (in seconds), this is the query timeout in vttablet side. If a query takes more than this timeout, it will be killed.")
flag.Float64Var(&currentConfig.OltpReadPool.TimeoutSeconds, "queryserver-config-query-pool-timeout", defaultConfig.OltpReadPool.TimeoutSeconds, "query server query pool timeout (in seconds), it is how long vttablet waits for a connection from the query pool. If set to 0 (default) then the overall query timeout is used instead.")
flag.Float64Var(&currentConfig.OlapReadPool.TimeoutSeconds, "queryserver-config-stream-pool-timeout", defaultConfig.OlapReadPool.TimeoutSeconds, "query server stream pool timeout (in seconds), it is how long vttablet waits for a connection from the stream pool. If set to 0 (default) then there is no timeout.")
Copy link
Copy Markdown
Collaborator

@deepthi deepthi Jun 2, 2020

Choose a reason for hiding this comment

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

Looks like this adds a new command line param to expose an existing yaml config param?

@dasl-
Copy link
Copy Markdown
Member

dasl- commented Jun 2, 2020

yes! this will be great for us at etsy.

@sougou sougou merged commit 5078438 into vitessio:master Jun 2, 2020
@sougou sougou deleted the ss-yaml-floats branch June 3, 2020 02:25
@sougou sougou restored the ss-yaml-floats branch June 3, 2020 02:25
@sougou sougou deleted the ss-yaml-floats branch June 3, 2020 02:26
deepthi added a commit that referenced this pull request Jun 16, 2020
@deepthi deepthi added this to the v7.0 milestone Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants