community.sap_install
community.sap_install copied to clipboard
sap_hana_preconfigure: net.core.wmem_max and net.core.rmem_max kernel parameters are always set from current system values
Currently, for applying SAP note 2382421, net.core.wmem_max and net.core.rmem_max kernel parameters are always set from the current, loaded, maximum values of net.ipv4.tcp_wmem and net.ipv4.tcp_wmem kernel parameters, respectively.
With this implementation, if we add net.ipv4.tcp_wmem and net.ipv4.tcp_rmem to __sap_hana_preconfigure_kernel_parameters_default variable, it needs two runs of the role in order to apply the values (as the reload happens at the very end), and if we would add them directly, they would never be applied.
As a suggestion, a new specific variable for not triggering the block if we are going to define the values here would an easy solution.
@GutiPerez Thanks for your suggestion, which makes sense to me. The purpose of the current code is to guarantee the following requirement mentioned in SAP note 2382421: ... it must be ensured that the wmem_max and rmem_max values are at least the same as the respective maximum value of the parameters net.ipv4.tcp_wmem and net.ipv4.tcp_rmem.
Instead of introducing a new role parameter, I am thinking of running the tasks which are getting the current values of net.core.wmem_max and/or net.core.rmem_max tunables only if net.ipv4.tcp_wmem or net.ipv4.tcp_rmem have not been defined in the playbook or inventory. Do you see any possible issues with this approach?
Hello @berndfinger
Thanks a lot for the quick response.
I do not see any issue in your approach. That would solve the issue of not being able to set the max values despite being defined in the __sap_hana_preconfigure_kernel_parameters_defaultvariable.
A more complete approach, that may be worth looking into, would be that:
- If 'net.ipv4.tcp_wmem' and 'net.ipv4.tcp_rmem' are defined in the playbook or inventory,
net.core.wmem_maxandnet.core.rmem_maxare set from the max values of the former variables. - If 'net.ipv4.tcp_wmem' and 'net.ipv4.tcp_rmem' are not defined in the playbook or inventory,
net.core.wmem_maxandnet.core.rmem_maxare set from the current system values (as they are now).
That way, you enforce the SAP note requirement in the two situations. Obviously, this workflow is more complex to do in Ansible, so maybe it is not worth the trouble.