terraform-aws-couchbase icon indicating copy to clipboard operation
terraform-aws-couchbase copied to clipboard

calculate_memory_settings_automatically always gives all memory to data service

Open tinomen opened this issue 4 years ago • 7 comments

It looks like memory is always being allocated based on all the services regardless if you pass in the --node-services argument.

https://github.com/gruntwork-io/terraform-aws-couchbase/blob/027eb19e57a7bc2522a1287c4adf008d655afc40/modules/run-couchbase-server/run-couchbase-server#L754

Is there a reason this is ignoring the $node_services argument passed in and always using local cluster_services="$DEFAULT_SERVICES"?

tinomen avatar Jan 13 '21 21:01 tinomen

Is the run-couchbase-server module/script actually setting up the _ramsize for services on the cluster then it tells the node what to allocate when it's added to the cluster?

tinomen avatar Jan 13 '21 21:01 tinomen

Are you using --manage-memory-manually?

brikis98 avatar Jan 14 '21 10:01 brikis98

I am for the data nodes but the index nodes are not.

I spent yesterday tracing out what is going on. I thought that we were setting the resources for each node (type) based on those settings, however, if I understand correctly now it's really just the first data node that setts the resources for the entire cluster. 🤯 Obviously I've not read every single doc on the couchbase's site. (still not sure where this is mentioned, perhaps assumed)

tinomen avatar Jan 14 '21 16:01 tinomen

This function reads like it came from an example that had all services on every node. Shouldn't it give index more memory in the MDS example since it is on a separate node?

I'm assuming this will need to be re-written to work in production.

tinomen avatar Jan 14 '21 21:01 tinomen

Please see the documentation here and let me know if that helps!

brikis98 avatar Jan 18 '21 18:01 brikis98

Please see the documentation here and let me know if that helps!

Yeah, saw that. It should be more explicit that you must use the --manage-memory-manually flag when separating services and nodes like the MDS example. The calculate_memory_settings_automatically function isn't smart enough to deal with anything but running all services on every node.

tinomen avatar Jan 18 '21 21:01 tinomen

A PR to improve the docs and make that clearer is very welcome!

brikis98 avatar Jan 19 '21 08:01 brikis98

This repo is being archived, feel free to use a fork if necessary.

ellisonc avatar Mar 29 '23 18:03 ellisonc