RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2052886 - better conntrack configuration for ocp-related profiles
Summary: better conntrack configuration for ocp-related profiles
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: tuned
Version: 8.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: Robin Hack
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-10 08:54 UTC by Paolo Abeni
Modified: 2022-05-10 16:56 UTC (History)
5 users (show)

Fixed In Version: tuned-2.18.0-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 15:31:16 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-111797 0 None None None 2022-02-10 08:57:28 UTC
Red Hat Product Errata RHBA-2022:2106 0 None None None 2022-05-10 15:31:30 UTC

Description Paolo Abeni 2022-02-10 08:54:09 UTC
The openshift, atomic-guest and atomic-host profiles have sub-optimal setting WRT conntrack: they set the maximum number of netfilter
conntrack entries (net.netfilter.nf_conntrack_max) to 1M, while the corresponding hash table size (nf_conntrack_hashsize) is set to 128K.

Under significant network load with an high number of active network connections, the conntrack hash table will see a very high
load, leading to bad performances.

The solution would be setting nf_conntrack_hashsize to 1M, too

Comment 5 Jaroslav Škarvada 2022-02-10 20:48:41 UTC
Upstream PR:
https://github.com/redhat-performance/tuned/pull/413

Comment 15 Jaroslav Škarvada 2022-02-11 12:33:17 UTC
On the 4.18.0-364.el8.x86_64 it seems the /sys/module/nf_conntrack/parameters/hashsize changes are not propagated to the /proc/sys/net/netfilter/nf_conntrack_buckets:

# cat /sys/module/nf_conntrack/parameters/hashsize
16384

# cat /proc/sys/net/netfilter/nf_conntrack_buckets
16384

# echo 1048576 > /sys/module/nf_conntrack/parameters/hashsize
# cat /sys/module/nf_conntrack/parameters/hashsize
1048576

# cat /proc/sys/net/netfilter/nf_conntrack_buckets
16384

On the other hand on the 5.16.5-100.fc34.x86_64:

# cat /sys/module/nf_conntrack/parameters/hashsize
16384

# cat /proc/sys/net/netfilter/nf_conntrack_buckets
16384

# echo 1048576 > /sys/module/nf_conntrack/parameters/hashsize
# cat /sys/module/nf_conntrack/parameters/hashsize
1048576

# cat /proc/sys/net/netfilter/nf_conntrack_buckets
1048576

Is it kernel bug? I haven't checked the kernel code yet.

Comment 16 Jaroslav Škarvada 2022-02-11 13:01:16 UTC
Yup, it seems like RHEL-8.6.0 kernel bug:
/* size the user *wants to set */
 static unsigned int nf_conntrack_htable_size_user __read_mostly;
 
 static int
 nf_conntrack_hash_sysctl(struct ctl_table *table, int write,
-			 void __user *buffer, size_t *lenp, loff_t *ppos)
+			 void *buffer, size_t *lenp, loff_t *ppos)
 {
 	int ret;
 
+	/* module_param hashsize could have changed value */
+	nf_conntrack_htable_size_user = nf_conntrack_htable_size;
+
 	ret = proc_dointvec(table, write, buffer, lenp, ppos);
 	if (ret < 0 || !write)
 		return ret;

So the question is @Paolo Abeni does the TuneD fix work for you and can we just change the test (i.e. to check the sysfs, not the sysctl)?

Comment 17 Paolo Abeni 2022-02-11 14:41:28 UTC
(In reply to Jaroslav Škarvada from comment #16)
> Yup, it seems like RHEL-8.6.0 kernel bug:
> /* size the user *wants to set */
>  static unsigned int nf_conntrack_htable_size_user __read_mostly;
>  
>  static int
>  nf_conntrack_hash_sysctl(struct ctl_table *table, int write,
> -			 void __user *buffer, size_t *lenp, loff_t *ppos)
> +			 void *buffer, size_t *lenp, loff_t *ppos)
>  {
>  	int ret;
>  
> +	/* module_param hashsize could have changed value */
> +	nf_conntrack_htable_size_user = nf_conntrack_htable_size;
> +
>  	ret = proc_dointvec(table, write, buffer, lenp, ppos);
>  	if (ret < 0 || !write)
>  		return ret;
> 
> So the question is @Paolo Abeni does the TuneD fix work for you 

Do you mean tuned mr/413? it WFM, but I tested it on a rhel-9 kernel, but we need it to be effective on rhel-8 too.

> and can we
> just change the test (i.e. to check the sysfs, not the sysctl)?

uhmm... then the data exposed by the kernel will be confusing. Userspace usually check only sysctl.

I think we need to use 'sys.net.netfilter.nf_conntrack_buckets' in tuned profiles instead of 'nf_conntrack_hashsize' or to patch the rhel-8 kernel. The latter can take quite a long timeframe and will need and explicit exception at this point. I think the first option is more doable.

Comment 18 Paolo Abeni 2022-02-11 14:53:13 UTC
(In reply to Paolo Abeni from comment #17)
> (In reply to Jaroslav Škarvada from comment #16)
> > Yup, it seems like RHEL-8.6.0 kernel bug:
> > /* size the user *wants to set */
> >  static unsigned int nf_conntrack_htable_size_user __read_mostly;
> >  
> >  static int
> >  nf_conntrack_hash_sysctl(struct ctl_table *table, int write,
> > -			 void __user *buffer, size_t *lenp, loff_t *ppos)
> > +			 void *buffer, size_t *lenp, loff_t *ppos)
> >  {
> >  	int ret;
> >  
> > +	/* module_param hashsize could have changed value */
> > +	nf_conntrack_htable_size_user = nf_conntrack_htable_size;
> > +
> >  	ret = proc_dointvec(table, write, buffer, lenp, ppos);
> >  	if (ret < 0 || !write)
> >  		return ret;
> > 
> > So the question is @Paolo Abeni does the TuneD fix work for you 
> 
> Do you mean tuned mr/413? it WFM, but I tested it on a rhel-9 kernel, but we
> need it to be effective on rhel-8 too.
> 
> > and can we
> > just change the test (i.e. to check the sysfs, not the sysctl)?
> 
> uhmm... then the data exposed by the kernel will be confusing. Userspace
> usually check only sysctl.
> 
> I think we need to use 'sys.net.netfilter.nf_conntrack_buckets' in tuned
> profiles instead of 'nf_conntrack_hashsize' or to patch the rhel-8 kernel.
> The latter can take quite a long timeframe and will need and explicit
> exception at this point. I think the first option is more doable.

Thinking again about it, this scenario is not different from what we had before (e.g. tuned behavior did not change). So we could just update the test to check '/sys/module/nf_conntrack/parameters/hashsize'  instead of net.netfilter.nf_conntrack_buckets. In the longer run, I think it would be better additionally fix the kernel, so that the system view is consistent.

@Robin: could you please modify the test as described above?

Comment 19 Jaroslav Škarvada 2022-02-14 09:18:45 UTC
Thanks for filling the kernel bug 2053628.

Comment 22 errata-xmlrpc 2022-05-10 15:31:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (tuned bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2106


Note You need to log in before you can comment on or make changes to this bug.