Skip to content

Add candlepin tuning - #695

Open
Imaanpreet wants to merge 1 commit into
theforeman:masterfrom
Imaanpreet:add-candlepin-tuning
Open

Add candlepin tuning#695
Imaanpreet wants to merge 1 commit into
theforeman:masterfrom
Imaanpreet:add-candlepin-tuning

Conversation

@Imaanpreet

@Imaanpreet Imaanpreet commented Jul 22, 2026

Copy link
Copy Markdown

Why are you introducing these changes? (Problem description, related links)

Candlepin JVM heap is hardcoded in tomcat.conf. It should scale with the tuning profile like other components (httpd, PostgreSQL).

What are the changes introduced in this pull request?

How to test this pull request

  1. foremanctl deploy --tuning default
  2. podman exec candlepin cat /proc/1/cmdline | tr '\0' ' ' → verify -Xms1g -Xmx4g
  3. foremanctl deploy --tuning extra-large (32+ cores, 128GB+) → verify -Xms1g -Xmx8g

Steps to reproduce:

Checklist

  • Tests added/updated (if applicable)
  • Documentation updated (if applicable)

@pablomh

pablomh commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

+1

@Imaanpreet
Imaanpreet force-pushed the add-candlepin-tuning branch from f735a0a to 5216fa8 Compare July 22, 2026 17:36
Comment thread src/roles/candlepin/defaults/main.yml Outdated
candlepin_database_ssl_ca_path: /etc/candlepin/certs/db-ca.crt

candlepin_xms: 1g
candlepin_xmx: 4g

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about including java_opts?

Suggested change
candlepin_xmx: 4g
candlepin_java_opts_xmx: 4g

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done! Renamed to candlepin_java_opts_xms / candlepin_java_opts_xmx.
Thanks @ehelms

@evgeni

evgeni commented Jul 27, 2026

Copy link
Copy Markdown
Member

In puppet-candlepin, we used to just have a single java_opts string, that you could fill with whatever you wanted: https://github.com/theforeman/puppet-candlepin/blob/072f08a2e3d9bb1f5dc15bcb768151ec0015476c/manifests/init.pp#L216
It's basically a tradeoff between "being able to selectively override defaults" (this PR) and "be free to pass any opt you want" (puppet-candlepin).

My Tomcat knowledge is super rusty, so maybe @Imaanpreet and @pablomh know better: what are the odds that you want to alter only ms or only mx values (looking at this PR and the tuning in foreman-installer: high?)? and do we ever recommend adding any other options?

I only could find https://access.redhat.com/solutions/6999123 which adds -XX:+UseParallelGC -XX:ParallelGCThreads=16 but looks rather old (Satellite 6.9 on EL7)

@Imaanpreet Imaanpreet closed this Jul 27, 2026
@Imaanpreet

Copy link
Copy Markdown
Author

In puppet-candlepin, we used to just have a single java_opts string, that you could fill with whatever you wanted: https://github.com/theforeman/puppet-candlepin/blob/072f08a2e3d9bb1f5dc15bcb768151ec0015476c/manifests/init.pp#L216 It's basically a tradeoff between "being able to selectively override defaults" (this PR) and "be free to pass any opt you want" (puppet-candlepin).

My Tomcat knowledge is super rusty, so maybe @Imaanpreet and @pablomh know better: what are the odds that you want to alter only ms or only mx values (looking at this PR and the tuning in foreman-installer: high?)? and do we ever recommend adding any other options?

I only could find https://access.redhat.com/solutions/6999123 which adds -XX:+UseParallelGC -XX:ParallelGCThreads=16 but looks rather old (Satellite 6.9 on EL7)

Thanks for raising this, @evgeni !

The separate variables work well for our use case since tuning profiles only need to adjust heap sizes — for example, XL and XXL just override xmx to 8g while keeping the default xms. The other JAVA_OPTS flags (-Dcom.redhat.fips=false, --enable-native-access=ALL-UNNAMED) are fixed in the template and don't change across profiles.

I don't think there's a current need for passing additional JVM options through tuning profiles. The GC tuning example you found looks like it was specific to Satellite 6.9/EL7. But if that need comes up in the future, we could always add something like candlepin_java_opts_extra without changing the existing setup.

Happy to hear what you and @pablomh think!

@Imaanpreet Imaanpreet reopened this Jul 27, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Imaanpreet
Imaanpreet force-pushed the add-candlepin-tuning branch from 5216fa8 to 24bdfc2 Compare July 27, 2026 17:00
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