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

Add Mosquitto tuning #1747

Merged

Conversation

Imaanpreet
Copy link
Contributor

@Imaanpreet Imaanpreet commented Oct 31, 2022

Please cherry-pick my commits into:

  • Foreman 3.4/Katello 4.6
  • Foreman 3.3/Katello 4.5
  • Foreman 3.2/Katello 4.4
  • Foreman 3.1/Katello 4.3
  • For Foreman 3.0 or older, please create a separate PR.
  • We do not accept PRs for Foreman 2.3 or older.

----
cat >/etc/systemd/system/mosquitto.service.d/limits.conf <<__EOF__
[Service]
LimitNOFILE=5000
Copy link
Member

Choose a reason for hiding this comment

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

If this is common (and I'm quite sure it is), I'd prefer to support this properly in our installer. I'm worried our installer actually purges this file again.

Having said that: EL8 has a default file limit of 262144 so you're SERIOUSLY lowering it. See systemctl show -p DefaultLimitNOFILE and systemctl show -p LimitNOFILE foreman-mosquitto.service as well.

Are you sure you weren't testing this on EL7 which has a much lower limit of 4096?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @ekohl , we are already calling it here [1] right?

[1] https://github.com/theforeman/foreman-documentation/blob/master/guides/common/modules/con_performance-tuning-quickstart.adoc.

@pablomh could you please answer about the 4096 limit thing ?

Copy link
Member

Choose a reason for hiding this comment

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

What I mean is that in our documentation we want to avoid users managing individual files. If this is something that we want to support, the installer should have some option to do so. It may take tuning profiles into account, depending on how we choose to implement it.

Copy link

Choose a reason for hiding this comment

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

Hi @ekohl. In our mosquitto testing we found the following issue in a medium tuned (not that it matters in this case) capsule when trying to register the 1015th client:

Unable to accept new connection, system socket count has been exceeded. Try increasing "ulimit -n" or equivalent.

We were able to overcome the issue making the modifications that we propose in this PR, so maybe the mosquitto system unit is not inheriting properly that property.

Copy link
Member

Choose a reason for hiding this comment

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

https://github.com/systemd/systemd/blob/23f3a6f5ff864fd26063c6c35fdaa6d85de566c7/NEWS#L5880-L5914 does have quite a bit to say on this.

Note that the soft limit remains at 1024 for compatibility reasons: the
traditional UNIX select() call cannot deal with file descriptors >=
1024 and increasing the soft limit globally might thus result in
programs unexpectedly allocating a high file descriptor and thus
failing abnormally when attempting to use it with select() (of
course, programs shouldn't use select() anymore, and prefer
poll()/epoll, but the call unfortunately remains undeservedly popular
at this time).

Then later:

Programs that want to take benefit of the increased limit have to "opt-in" into
high file descriptors explicitly by raising their soft limit.

That 1015 is seriously close to 1024 that it makes me suspect it's observing the soft limit by default and I suspect that if Mosquitto was modified to raise its soft limit, it would automatically get a lot more file descriptors.

I think we should pursue the path of fixing it upstream first. For now I've opened eclipse/mosquitto#2674 to see if it's a viable solution.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you Ewoud! Do we want to add a reference to that upstream ticket to the Tuning Guide in this PR?

guides/common/modules/proc_mqtt-tuning.adoc Outdated Show resolved Hide resolved
guides/common/modules/proc_mqtt-tuning.adoc Outdated Show resolved Hide resolved
guides/common/modules/proc_mqtt-tuning.adoc Outdated Show resolved Hide resolved
@mjivraja
Copy link
Contributor

mjivraja commented Nov 3, 2022

Hi @Imaanpreet

I have comments on some lines adhering to the style guide. I hope, it will be helpful to you.

@maximiliankolb
Copy link
Contributor

@Imaanpreet Thanks for applying feedback. I've restarted the GHA pipeline. Please also have a look at used upstream terminology such as "Foreman" or "Katello" in your PR. In Foreman documentation, we generally use attributes, see https://github.com/theforeman/foreman-documentation/blob/master/guides/common/attributes-base.adoc

@jhutar
Copy link
Contributor

jhutar commented Nov 11, 2022

Hello @maximiliankolb and @mjivraja . Please does this look OK now?

Copy link
Contributor

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

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

This procedure still needs to make use of attributes, e.g. "satellite-installer" > "{foreman-installer}" and so on.

Also, it's not included, therefore we cannot see the built HTML output.

I also feel like the introduction is more of a background story then technical documentation. Would you mind rewording it?

Please also stick to "one sentence per line" as per our conventions.

@ekohl ekohl changed the title Foreman 3.3.0.17 1.el8sat.noarch Add Mosquitto tuning Nov 11, 2022
@mjivraja
Copy link
Contributor

Hello @maximiliankolb and @mjivraja . Please does this look OK now?

Some comments are yet to be addressed. Can you have a look once again?

@Imaanpreet
Copy link
Contributor Author

Hello @maximiliankolb & @mjivraja : could you please check now?

@ehelms
Copy link
Member

ehelms commented Nov 17, 2022

@adamruzicka Would you mind having a glance over this?

Copy link
Contributor

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

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

Made some suggestions.

guides/common/modules/proc_rex-pull-based-provider.adoc Outdated Show resolved Hide resolved
guides/common/modules/proc_rex-pull-based-provider.adoc Outdated Show resolved Hide resolved
guides/common/modules/proc_rex-pull-based-provider.adoc Outdated Show resolved Hide resolved
guides/common/modules/proc_rex-pull-based-provider.adoc Outdated Show resolved Hide resolved
guides/common/modules/proc_rex-pull-based-provider.adoc Outdated Show resolved Hide resolved
@Imaanpreet
Copy link
Contributor Author

Hello @maximiliankolb : I have applied some more changes as per the suggestions. Could you please check now? Please correct me if I have missed anything. Thank you in advance :)

Copy link
Contributor

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

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

A few more comments:

Right now, the first four lines are four paragraphs. It's probably best to remove the empty lines 5, 7, and 9 so that it'll be one paragraph.
Second, you have to actually include your procedure in an assembly. Right now, your content is not part of any guide.
Also, please ensure the file name, anchor, and title match.

guides/common/modules/proc_rex-pull-based-transport.adoc Outdated Show resolved Hide resolved
@Imaanpreet
Copy link
Contributor Author

A few more comments:

Right now, the first four lines are four paragraphs. It's probably best to remove the empty lines 5, 7, and 9 so that it'll be one paragraph. Second, you have to actually include your procedure in an assembly. Right now, your content is not part of any guide. Also, please ensure the file name, anchor, and title match.

I hope now made changes will help.

@maximiliankolb
Copy link
Contributor

Looks like there is a merge conflict right now. Please rebase to master & then we can trigger the GHA so you'll see your change rendered.

@Imaanpreet Imaanpreet force-pushed the foreman-3.3.0.17-1.el8sat.noarch branch from 0f22e16 to 449a090 Compare November 30, 2022 14:26
@Imaanpreet
Copy link
Contributor Author

Looks like there is a merge conflict right now. Please rebase to master & then we can trigger the GHA so you'll see your change rendered.

done. could you please check now.

[id="REX_pull_based_transport_{context}"]
= REX pull-based transport

Remote Execution (REX) has been around for a while now and has served SSH-based execution very well.
Copy link
Member

Choose a reason for hiding this comment

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

I think we can drop this line, as it won't age well release to release.

= REX pull-based transport

Remote Execution (REX) has been around for a while now and has served SSH-based execution very well.
Now, {Project} has a pull-based transport that has the features of REX but with a deployment model similar to katello-agent.
Copy link
Member

Choose a reason for hiding this comment

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

I think we should drop the temporal part of this statement:

Suggested change
Now, {Project} has a pull-based transport that has the features of REX but with a deployment model similar to katello-agent.
{Project} has a pull-based transport that has the features of REX but with a deployment model similar to katello-agent.

@ehelms
Copy link
Member

ehelms commented Dec 13, 2022

@Imaanpreet If you could address my two comments, and then also squash into a single commit we should be good to go.

@Imaanpreet
Copy link
Contributor Author

@Imaanpreet If you could address my two comments, and then also squash into a single commit we should be good to go.

done @ehelms
thank you

@Imaanpreet Imaanpreet force-pushed the foreman-3.3.0.17-1.el8sat.noarch branch from 3d130f7 to 77b2446 Compare December 15, 2022 10:43
@Imaanpreet
Copy link
Contributor Author

@ehelms : Hello, could you please check once? I have all the commits in one commit.
77b2446

@ehelms
Copy link
Member

ehelms commented Dec 16, 2022

This can be merged -- I am not doing so at present as I cannot open the cherry picks presently.

@maximiliankolb maximiliankolb merged commit b31e4e5 into theforeman:master Dec 16, 2022
9 checks passed
maximiliankolb pushed a commit that referenced this pull request Dec 16, 2022
maximiliankolb pushed a commit that referenced this pull request Dec 16, 2022
maximiliankolb pushed a commit that referenced this pull request Dec 16, 2022
@maximiliankolb
Copy link
Contributor

Thanks @Imaanpreet for your PR! Merged to master and cherry-picked: ✔️
84a5bd0..9fe3e5f 3.5 -> 3.5
a351fd5..60b7f60 3.4 -> 3.4
0f62814..ac07b9b 3.3 -> 3.3

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.

None yet

8 participants