Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New memory defaults #1906

Merged
merged 6 commits into from
Sep 13, 2017
Merged

New memory defaults #1906

merged 6 commits into from
Sep 13, 2017

Conversation

jseldess
Copy link
Contributor

  • Update cockroach start docs
  • Update cache and sql memory section of recommended prod settings
  • Remove rec to reduce memory from local deployment tutorials
  • Update prod deployment tutorials with new memory settings
  • Update FAQ about memory usage

Fixes #1904

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jseldess jseldess force-pushed the new-memory-defaults branch 2 times, most recently from a880b9d to c6a2347 Compare September 12, 2017 20:41
~~~

This command specifies the location of certificates and the address at which other nodes can reach it. It also increases the node's cache and temporary SQL memory size to 25% of available system memory in order to improve read performance and prevent out-of-memory errors.
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps prevent out-of-memory errors when performing large queries. @knz?


If you run multiple applications on the same machine as a CockroachDB node, you might consider manually setting the cache size instead of using the default 25% of available memory.
By default, each node's cache and temporary SQL memory size is `128MiB` respectively. This default is optimal for running a local development cluster with multiple nodes on a single host. When running a production cluster with one node per host, however, these defaults may lead to out-of-memory errors. To prevent such errors and improve read performance, it's recommended to manually increase the cache and SQL memory size to 25% or more of available system memory.
Copy link
Contributor

Choose a reason for hiding this comment

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

I shy away from using the term optimal. Perhaps This default is reasonable for running....

I think it is worthwhile to distinguish the effects of the flags. --cache will improve read performance. --max-sql-memory will increase the number of concurrent SQL queries that can be processed and the complexity of the queries that can be processed.

Cc @knz

@knz
Copy link
Contributor

knz commented Sep 13, 2017

increasing --max-sql-size can be done for any combination of the following two reasons:

  • increase the number of simultaneous client connections per node (the default of 128MB supports up to 6200 connections max)
  • increase the capacity for in-memory processing of rows when using ORDER BY, GROUP BY, DISTINCT, joins and window functions.

Reviewed 1 of 1 files at r1, 1 of 1 files at r2, 3 of 3 files at r3, 10 of 10 files at r4.
Review status: 15 of 16 files reviewed at latest revision, 3 unresolved discussions, all commit checks successful.


v1.1/deploy-cockroachdb-on-aws-insecure.md, line 131 at r4 (raw file):

	~~~

	This command sets the node to insecure and identifies the address at which other nodes can reach it. It also increases the node's cache and temporary SQL memory size to 25% of available system memory in order to improve read performance and prevent out-of-memory errors.

I'm not sure the phrasing "sets a node to insecure" is accurate or informative. I would suggest "This commands starts an insecure node and identifies ..."


v1.1/deploy-cockroachdb-on-aws.md, line 272 at r5 (raw file):

Previously, petermattis (Peter Mattis) wrote…

Perhaps prevent out-of-memory errors when performing large queries. @knz?

See my note above.

Also could you find a way to share this text across the different deployment docs? The current redundancy makes reviewing difficult.


v1.1/recommended-production-settings.md, line 49 at r5 (raw file):

This default is optimal for running a local development cluster with multiple nodes on a single host.

Replace this sentence by "This default was chosen to facilitate development and testing, where users are likely to run multiple CockroachDB nodes on a single computer."


Comments from Reviewable

@knz
Copy link
Contributor

knz commented Sep 13, 2017

Reviewed 1 of 1 files at r5.
Review status: all files reviewed at latest revision, 3 unresolved discussions, all commit checks successful.


Comments from Reviewable

@jseldess
Copy link
Contributor Author

Added these details to recommended-production-settings.md, @knz. Thank you.


Review status: all files reviewed at latest revision, 3 unresolved discussions, all commit checks successful.


v1.1/deploy-cockroachdb-on-aws-insecure.md, line 131 at r4 (raw file):

Previously, knz (kena) wrote…

I'm not sure the phrasing "sets a node to insecure" is accurate or informative. I would suggest "This commands starts an insecure node and identifies ..."

Done.


v1.1/deploy-cockroachdb-on-aws.md, line 272 at r5 (raw file):

Previously, knz (kena) wrote…

See my note above.

Also could you find a way to share this text across the different deployment docs? The current redundancy makes reviewing difficult.

Done.

I know it's hard to review so much redundant content, and I appreciate your patience and tolerance here. We have an issue in the backlog to consolidate with includes: #1718


v1.1/recommended-production-settings.md, line 49 at r5 (raw file):

Previously, knz (kena) wrote…

This default is optimal for running a local development cluster with multiple nodes on a single host.

Replace this sentence by "This default was chosen to facilitate development and testing, where users are likely to run multiple CockroachDB nodes on a single computer."

Done.


Comments from Reviewable

@jseldess
Copy link
Contributor Author

Btw, I spoke to @a-robinson about required changes to k8 and docker swarm. He's going to open a separate PR updating the docker swarm docs (with new memory defaults as well as the --init command), and he's going to update the k8 configuration in conjunction with the actual 1.1 release.


Comments from Reviewable

@knz
Copy link
Contributor

knz commented Sep 13, 2017

:lgtm:


Reviewed 14 of 14 files at r6.
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful.


Comments from Reviewable

@jseldess
Copy link
Contributor Author

Merging so I can start work on the --init command. @petermattis, if you have further feedback, I can integrate changes in a follow-up PR.

@jseldess jseldess merged commit 5ea3760 into master Sep 13, 2017
@jseldess jseldess deleted the new-memory-defaults branch September 13, 2017 19:48
@petermattis
Copy link
Contributor

:lgtm:


Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


v1.1/deploy-cockroachdb-on-aws.md, line 272 at r5 (raw file):

Previously, jseldess wrote…

Done.

I know it's hard to review so much redundant content, and I appreciate your patience and tolerance here. We have an issue in the backlog to consolidate with includes: #1718

The new wording SGTM.


Comments from Reviewable

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.

4 participants