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

Feature added autotune #140

Merged
merged 4 commits into from
Feb 6, 2017
Merged

Conversation

alexbacchin
Copy link
Contributor

@alexbacchin alexbacchin commented Jan 10, 2017

I am using this cookbook for the last few days and setting up jvm memory can be tricky if you don't have much Java experience.
As this was based on the Jira cookbook, I have ported the autotune recipe to the confluence cookbook.
Even the default setting for autotune is false. When used, it will make confluence run better and utilize better the server memory.

@legal90
Copy link
Contributor

legal90 commented Jan 11, 2017

Hi @alexbacchin
Thank you for the contribution! Yes, setting up the memory for java applications is tricky.
But currently, I'm not sure that we need to add such autotune logic to this community cookbook.

My concerns:

  • There are no any rules or "silver bullet" examples of JRE memory settings for Confluence. Atlassian recommends tuning Xms & Xmx according to the server load, not to the total memory available on the node. Actually, these settings are really specific for each concrete server instance in production.
  • In Confluence 6 there was added a new component, Synchrony (for Collaborative Editing feature), which runs as a separate java container. Its Xmx is set to 1g, so it means that there are no any simple formulae applicable for everyone.

I really appreciate your effort and honestly, I would be happy if we can use such universal formulae everywhere. But unfortunately, in a real production we need to tune such settings manually for each concrete installation.

@bflad @patcon, what do you think?

@alexbacchin
Copy link
Contributor Author

Hi @legal90,
I believe the idea with the autotune is to provide an good enough JVM setting so the admin does not have to worry about this initially. It was not designed to be the perfect setting, but it can be a starting point.
Also if you consider scalability, as you Confluence environment grows memory is added to the host (or VM) but JMV settings can be changed automatically by Chef with the autotune suggestions.
As it is disabled by default, we are not enforcing this to be used.

In regards the Synchrony, I can change the calculation to leave memory for it.

@patcon
Copy link
Contributor

patcon commented Jan 30, 2017

Seems reasonable in principle :) although have not tested, and not sure the maintenance burden

Copy link
Contributor

@anuriq anuriq left a comment

Choose a reason for hiding this comment

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

Overall, this is a lot of code for something which could be set by admin after 1 min thinking. Do we really need this?

@@ -22,6 +22,7 @@
include_recipe 'confluence::database' if settings['database']['host'] == '127.0.0.1'
include_recipe "confluence::linux_#{node['confluence']['install_type']}"
include_recipe 'confluence::configuration'
include_recipe 'confluence::autotune' if settings['autotune']['enabled'] == true

This comment was marked as outdated.


# If you don't want total system memory to be automatically discovered through
# Ohai, uncomment the following line and set your own value in kB.
# default['jira']['autotune']['total_memory'] = '1048576kB' # 1024m

This comment was marked as outdated.

@@ -60,6 +60,17 @@
default['confluence']['database']['type'] = 'mysql'
default['confluence']['database']['user'] = 'confluence'

# Types include: 'mixed', 'dedicated', 'shared'
# 'mixed' - Confluence and DB run on the same system

This comment was marked as outdated.

@alexbacchin
Copy link
Contributor Author

I performed the updates based on @anuriq feedback.
In regards the usefulness of this feature. I have found this quite useful when testing different server memory settings. Therefore, the JVM memory adapts when you need to vertically scale the server.
Nevertheless, if you all still don't feel useful, I will keep it on my fork. No worries at all.

@anuriq anuriq merged commit dbdd76f into sous-chefs:master Feb 6, 2017
@anuriq
Copy link
Contributor

anuriq commented Feb 6, 2017

thanks!

@mvdkleijn
Copy link
Contributor

Cool to see this go in. I authored the auto tune feature in the Jira cookbook. For future readers: it was heavily based on the auto tune feature of the Postgresql cookbook. 😄

@lock
Copy link

lock bot commented Oct 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants