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 1744559 - netstat -anl runs very slow when there are many socket established
Summary: netstat -anl runs very slow when there are many socket established
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: net-tools
Version: 6.8
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Michal Ruprich
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-22 12:30 UTC by w
Modified: 2019-08-26 09:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-26 08:56:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description w 2019-08-22 12:30:03 UTC
Description of problem:
netstat -ant runs very slow when there are many socket established. which i run netstat command in docker container.


Version-Release number of selected component (if applicable):

net-tools-1.60-114.el6.x86_64


How reproducible:

running a docker container which the centos6 images in the Centos7 host. then create as many as socket connections.

runs netstat -ant will be very slow


Steps to Reproduce:
1. Find an CenOS7/RHEL7 host.
2. Install docker
3. create a docker container with centos:6

docker run  -tid -p 8080:8080 --ulimit nofile=102400:102400 centos:6 bash 

4.  exec into the container

docker exec -ti <contaienr-id> bash

5. create as many as socket connections(about 28000+ )

6. run netstat  commmand.

time netstat -anl | wc -l 

Actual results:
# time netstat -anl | wc -l 
28005

real	0m9.900s
user	0m0.096s
sys	0m9.793s

about 9 seconds, very slow.

Expected results: (using the new version of net-tools, which i build by myself in container)

# time ./netstat -anl | wc -l
28005

real	0m0.105s
user	0m0.065s
sys	0m0.044s

the command runs very quickly.

Additional info:

I debug this issue, and found that the new version of net-tools has the following patch:

https://sourceforge.net/p/net-tools/code/ci/b9963e73a1af57ecbb2e11507b6644796131aea6/

this patch use proc_fopen instead of fopen. 

```
FILE *proc_fopen(const char *name)
{
    static char *buffer;
    static size_t pagesz;
    FILE *fd = fopen(name, "r");

    if (fd == NULL)
      return NULL;

    if (!buffer) {
      pagesz = getpagesize();
      buffer = malloc(pagesz);
    }

    setvbuf(fd, buffer, _IOFBF, pagesz);
    return fd;
}
```

Can RHEL update this net-tools packages in RHEL6?

Comment 2 RHEL Program Management 2019-08-23 10:04:56 UTC
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.

Comment 3 w 2019-08-26 06:42:26 UTC
I think that there are still many user run container using centos:6 images in the CentOS7/RHEL7 Hosts. So It better to backport this patch.

Comment 4 Tomáš Hozza 2019-08-26 08:56:14 UTC
(In reply to w from comment #3)
> I think that there are still many user run container using centos:6 images
> in the CentOS7/RHEL7 Hosts. So It better to backport this patch.

Hi.

Red Hat Enterprise Linux 6 transitioned to the Maintenance Support 2 Phase on May 10, 2017.  During the Maintenance Support 2, Critical impact Security Advisories (RHSAs) and SELECTED Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria. Feel free to use our customer support to escalate this request if it is important for you.

However for community members, I'm afraid that there is not much we can do in official RHEL-6 release. You can use newer major version of RHEL (e.g. 7 or 8) or rebuild e.g. Fedora package for EPEL-6, e.g. in COPR (https://copr.fedorainfracloud.org/), which is of course unsupported.

Honestly, there is no chance that this will be resolved in RHEL-6 without a strong business case.

Comment 5 w 2019-08-26 09:06:30 UTC
(In reply to Tomáš Hozza 🤓 from comment #4)
> (In reply to w from comment #3)
> > I think that there are still many user run container using centos:6 images
> > in the CentOS7/RHEL7 Hosts. So It better to backport this patch.
> 
> Hi.
> 
> Red Hat Enterprise Linux 6 transitioned to the Maintenance Support 2 Phase
> on May 10, 2017.  During the Maintenance Support 2, Critical impact Security
> Advisories (RHSAs) and SELECTED Urgent Priority Bug Fix Advisories (RHBAs)
> may be released as they become available.
> 
> The official life cycle policy can be reviewed here:
> 
> http://redhat.com/rhel/lifecycle
> 
> This issue does not meet the inclusion criteria. Feel free to use our
> customer support to escalate this request if it is important for you.
> 
> However for community members, I'm afraid that there is not much we can do
> in official RHEL-6 release. You can use newer major version of RHEL (e.g. 7
> or 8) or rebuild e.g. Fedora package for EPEL-6, e.g. in COPR
> (https://copr.fedorainfracloud.org/), which is of course unsupported.
> 
> Honestly, there is no chance that this will be resolved in RHEL-6 without a
> strong business case.

Thank you for the information.


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