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 1046189 - Libvirtd's Max open files value can not be overwritten by using LIBVIRTD_NOFILES_LIMIT variable
Summary: Libvirtd's Max open files value can not be overwritten by using LIBVIRTD_NOFI...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Libvirt Maintainers
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-24 02:34 UTC by Hu Jianwei
Modified: 2014-07-14 07:40 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-06 14:44:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Hu Jianwei 2013-12-24 02:34:54 UTC
Description of probl
Libvirtd's Max open files value can not be overwritten by using LIBVIRTD_NOFILES_LIMIT variable

Version-Release number of selected component (if applicable):
libvirt-1.1.1-16.el7.x86_64
qemu-kvm-rhev-1.5.3-21.el7.x86_64
kernel-3.10.0-60.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Modify LIBVIRTD_NOFILES_LIMIT=2048
[root@ibm-x3650m3-03 ~]# grep ^[^#] /etc/sysconfig/libvirtd
LIBVIRTD_NOFILES_LIMIT=2048

2. Restart libvirtd
[root@ibm-x3650m3-03 ~]# service libvirtd restart
Redirecting to /bin/systemctl restart  libvirtd.service

3. Check the value of Max open files
[root@ibm-x3650m3-03 ~]# cat /proc/`pidof libvirtd`/limits
Limit                     Soft Limit           Hard Limit           Units    
...(snipped)
Max open files            1024                 4096                 files        <=======the value should be changed to 2048
...(snipped)  
[root@ibm-x3650m3-03 ~]#


Actual results:
We can't modify max open files for Libvirtd by using LIBVIRTD_NOFILES_LIMIT variable.

Expected results:
The max open files value should be modified by LIBVIRTD_NOFILES_LIMIT.

On rhel6 host, I can't reproduce it.
version:
libvirt-0.10.2-29.el6_5.2.x86_64
qemu-kvm-rhev-0.12.1.2-2.415.el6_5.3.x86_64
kernel-2.6.32-431.3.1.el6.x86_64

[root@amd-9600b-8-2 ~]# cat /proc/`pidof libvirtd`/limits
Limit                     Soft Limit           Hard Limit           Units    
...(snipped)
Max open files            3000                 3000                 files    
...(snipped)     
[root@amd-9600b-8-2 ~]# grep ^[^#] /etc/sysconfig/libvirtd
LIBVIRTD_NOFILES_LIMIT=2048
[root@amd-9600b-8-2 ~]# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
[root@amd-9600b-8-2 ~]# cat /proc/`pidof libvirtd`/limits
Limit                     Soft Limit           Hard Limit           Units    
Max cpu time              unlimited            unlimited            seconds  
Max file size             unlimited            unlimited            bytes    
Max data size             unlimited            unlimited            bytes    
Max stack size            10485760             unlimited            bytes    
Max core file size        0                    unlimited            bytes    
Max resident set          unlimited            unlimited            bytes    
Max processes             62300                62300                processes
Max open files            2048                 2048                 files     <===== the value has been updated.  
Max locked memory         65536                65536                bytes    
Max address space         unlimited            unlimited            bytes    
Max file locks            unlimited            unlimited            locks    
Max pending signals       62300                62300                signals  
Max msgqueue size         819200               819200               bytes    
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us

Comment 2 Hu Jianwei 2013-12-25 06:50:17 UTC
This bug only reproduced on rhel7 host, didn't reproduce on rhel6 host. 
I'd like to point out this, maybe there is a regression issue on rhel7.

Comment 3 Jiri Denemark 2014-01-06 14:44:39 UTC
RHEL-7 uses systemd which uses a different way of changing limits for started services. You need to use Limit* directives in libvirtd.service unit file. To be more specific, set LimitNOFILE=2048 in libvirtd.service.

Comment 4 Hu Jianwei 2014-01-07 02:21:14 UTC
(In reply to Jiri Denemark from comment #3)
> RHEL-7 uses systemd which uses a different way of changing limits for
> started services. You need to use Limit* directives in libvirtd.service unit
> file. To be more specific, set LimitNOFILE=2048 in libvirtd.service.

If there is a new way of changing limits for LimitNOFILE of libvirtd, I think we should remove LIBVIRTD_NOFILES_LIMIT variable from default configuration in below file. 

cat /etc/sysconfig/libvirtd
# Override the maximum number of opened files
#LIBVIRTD_NOFILES_LIMIT=2048

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
And retesting it with LimitNOFILE in /usr/lib/systemd/system/libvirtd.service.

[root@ibm-x3850x5-05 ~]# grep "LimitNOFILE" /usr/lib/systemd/system/libvirtd.service
LimitNOFILE=2048
[root@ibm-x3850x5-05 ~]# service libvirtd restart
Redirecting to /bin/systemctl restart  libvirtd.service

[root@ibm-x3850x5-05 ~]# cat /proc/`pidof libvirtd`/limits
Limit                     Soft Limit           Hard Limit           Units     
Max cpu time              unlimited            unlimited            seconds   
Max file size             unlimited            unlimited            bytes     
Max data size             unlimited            unlimited            bytes     
Max stack size            8388608              unlimited            bytes     
Max core file size        0                    unlimited            bytes     
Max resident set          unlimited            unlimited            bytes     
Max processes             1030174              1030174              processes 
Max open files            2048                 2048                 files     
...(clipped)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Comment 5 Jiri Denemark 2014-02-10 14:31:22 UTC
I made a patch pointing to the right place for systemd setups: https://www.redhat.com/archives/libvir-list/2014-February/msg00493.html

We can't just remove LIBVIRTD_NOFILES_LIMIT from /etc/sysconfig/libvirtd since that's the way how it works on systems without systemd (e.g., RHEL-6).

Comment 6 Alex Jia 2014-02-11 06:02:10 UTC
(In reply to Jiri Denemark from comment #5)

Jiri, BTW, I filed a doc bug for LXC guide, https://bugzilla.redhat.com/show_bug.cgi?id=1059518

Comment 7 Hu Jianwei 2014-07-14 07:40:20 UTC
(In reply to Jiri Denemark from comment #5)
> I made a patch pointing to the right place for systemd setups:
> https://www.redhat.com/archives/libvir-list/2014-February/msg00493.html
> 
> We can't just remove LIBVIRTD_NOFILES_LIMIT from /etc/sysconfig/libvirtd
> since that's the way how it works on systems without systemd (e.g., RHEL-6).

For above mentioned patch, I'll test it on rhel-7.1.0 version.


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