nofile ulimit -n on Ubuntu 14.04 LTS












6















➜ sudo sysctl -a|grep file

fs.file-max = 2037581
fs.file-nr = 2784 0 2037581

➜ ~ cat /proc/sys/fs/file-max
2037581

➜ ~ cat /proc/sys/fs/file-nr
2720 0 2037581


/etc/security/limits.conf



* hard nofile 2037581
* soft nofile 2037581
root hard nofile 2037581
root soft nofile 2037581


/etc/pam.d/su



session required pam_limits.so


/etc/pam.d/common-session



session required pam_limits.so


then reboot.



but ulimit -n got 1024 again.



only can ulimit -n 4096 as max value



or got error



 ulimit: value exceeds hard limit









share|improve this question























  • Did you try setting a minimally changed limit instead?

    – Josip Rodin
    Jul 9 '16 at 22:32
















6















➜ sudo sysctl -a|grep file

fs.file-max = 2037581
fs.file-nr = 2784 0 2037581

➜ ~ cat /proc/sys/fs/file-max
2037581

➜ ~ cat /proc/sys/fs/file-nr
2720 0 2037581


/etc/security/limits.conf



* hard nofile 2037581
* soft nofile 2037581
root hard nofile 2037581
root soft nofile 2037581


/etc/pam.d/su



session required pam_limits.so


/etc/pam.d/common-session



session required pam_limits.so


then reboot.



but ulimit -n got 1024 again.



only can ulimit -n 4096 as max value



or got error



 ulimit: value exceeds hard limit









share|improve this question























  • Did you try setting a minimally changed limit instead?

    – Josip Rodin
    Jul 9 '16 at 22:32














6












6








6








➜ sudo sysctl -a|grep file

fs.file-max = 2037581
fs.file-nr = 2784 0 2037581

➜ ~ cat /proc/sys/fs/file-max
2037581

➜ ~ cat /proc/sys/fs/file-nr
2720 0 2037581


/etc/security/limits.conf



* hard nofile 2037581
* soft nofile 2037581
root hard nofile 2037581
root soft nofile 2037581


/etc/pam.d/su



session required pam_limits.so


/etc/pam.d/common-session



session required pam_limits.so


then reboot.



but ulimit -n got 1024 again.



only can ulimit -n 4096 as max value



or got error



 ulimit: value exceeds hard limit









share|improve this question














➜ sudo sysctl -a|grep file

fs.file-max = 2037581
fs.file-nr = 2784 0 2037581

➜ ~ cat /proc/sys/fs/file-max
2037581

➜ ~ cat /proc/sys/fs/file-nr
2720 0 2037581


/etc/security/limits.conf



* hard nofile 2037581
* soft nofile 2037581
root hard nofile 2037581
root soft nofile 2037581


/etc/pam.d/su



session required pam_limits.so


/etc/pam.d/common-session



session required pam_limits.so


then reboot.



but ulimit -n got 1024 again.



only can ulimit -n 4096 as max value



or got error



 ulimit: value exceeds hard limit






14.04 ulimit






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 7 '14 at 6:14









sharewindsharewind

131112




131112













  • Did you try setting a minimally changed limit instead?

    – Josip Rodin
    Jul 9 '16 at 22:32



















  • Did you try setting a minimally changed limit instead?

    – Josip Rodin
    Jul 9 '16 at 22:32

















Did you try setting a minimally changed limit instead?

– Josip Rodin
Jul 9 '16 at 22:32





Did you try setting a minimally changed limit instead?

– Josip Rodin
Jul 9 '16 at 22:32










2 Answers
2






active

oldest

votes


















0














If u set root hard nofile 65535 it will only change root users limit.
If you want to change another users limit add that users username for example,



sharewind hard nofile 65535
Or add * for username which will change all users limit. But it is not recommended.






share|improve this answer



















  • 1





    It doesn't work

    – sharewind
    May 8 '14 at 1:54











  • Did you change both soft and hard file limits. If not add the soft file limit too. I used hard limit only as an example

    – Manula Waidyanatha
    May 11 '14 at 9:17











  • I have the same experience as @ManulaWaidyanatha

    – Jeune
    Jan 27 '15 at 7:47



















0














I found that if the service is launched under an upstart init script you must use the stanza limit to control this!



See: http://bryanmarty.com/2012/02/10/setting-nofile-limit-upstart/






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f462112%2fnofile-ulimit-n-on-ubuntu-14-04-lts%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    If u set root hard nofile 65535 it will only change root users limit.
    If you want to change another users limit add that users username for example,



    sharewind hard nofile 65535
    Or add * for username which will change all users limit. But it is not recommended.






    share|improve this answer



















    • 1





      It doesn't work

      – sharewind
      May 8 '14 at 1:54











    • Did you change both soft and hard file limits. If not add the soft file limit too. I used hard limit only as an example

      – Manula Waidyanatha
      May 11 '14 at 9:17











    • I have the same experience as @ManulaWaidyanatha

      – Jeune
      Jan 27 '15 at 7:47
















    0














    If u set root hard nofile 65535 it will only change root users limit.
    If you want to change another users limit add that users username for example,



    sharewind hard nofile 65535
    Or add * for username which will change all users limit. But it is not recommended.






    share|improve this answer



















    • 1





      It doesn't work

      – sharewind
      May 8 '14 at 1:54











    • Did you change both soft and hard file limits. If not add the soft file limit too. I used hard limit only as an example

      – Manula Waidyanatha
      May 11 '14 at 9:17











    • I have the same experience as @ManulaWaidyanatha

      – Jeune
      Jan 27 '15 at 7:47














    0












    0








    0







    If u set root hard nofile 65535 it will only change root users limit.
    If you want to change another users limit add that users username for example,



    sharewind hard nofile 65535
    Or add * for username which will change all users limit. But it is not recommended.






    share|improve this answer













    If u set root hard nofile 65535 it will only change root users limit.
    If you want to change another users limit add that users username for example,



    sharewind hard nofile 65535
    Or add * for username which will change all users limit. But it is not recommended.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered May 7 '14 at 6:33









    Manula WaidyanathaManula Waidyanatha

    6,07711619




    6,07711619








    • 1





      It doesn't work

      – sharewind
      May 8 '14 at 1:54











    • Did you change both soft and hard file limits. If not add the soft file limit too. I used hard limit only as an example

      – Manula Waidyanatha
      May 11 '14 at 9:17











    • I have the same experience as @ManulaWaidyanatha

      – Jeune
      Jan 27 '15 at 7:47














    • 1





      It doesn't work

      – sharewind
      May 8 '14 at 1:54











    • Did you change both soft and hard file limits. If not add the soft file limit too. I used hard limit only as an example

      – Manula Waidyanatha
      May 11 '14 at 9:17











    • I have the same experience as @ManulaWaidyanatha

      – Jeune
      Jan 27 '15 at 7:47








    1




    1





    It doesn't work

    – sharewind
    May 8 '14 at 1:54





    It doesn't work

    – sharewind
    May 8 '14 at 1:54













    Did you change both soft and hard file limits. If not add the soft file limit too. I used hard limit only as an example

    – Manula Waidyanatha
    May 11 '14 at 9:17





    Did you change both soft and hard file limits. If not add the soft file limit too. I used hard limit only as an example

    – Manula Waidyanatha
    May 11 '14 at 9:17













    I have the same experience as @ManulaWaidyanatha

    – Jeune
    Jan 27 '15 at 7:47





    I have the same experience as @ManulaWaidyanatha

    – Jeune
    Jan 27 '15 at 7:47













    0














    I found that if the service is launched under an upstart init script you must use the stanza limit to control this!



    See: http://bryanmarty.com/2012/02/10/setting-nofile-limit-upstart/






    share|improve this answer




























      0














      I found that if the service is launched under an upstart init script you must use the stanza limit to control this!



      See: http://bryanmarty.com/2012/02/10/setting-nofile-limit-upstart/






      share|improve this answer


























        0












        0








        0







        I found that if the service is launched under an upstart init script you must use the stanza limit to control this!



        See: http://bryanmarty.com/2012/02/10/setting-nofile-limit-upstart/






        share|improve this answer













        I found that if the service is launched under an upstart init script you must use the stanza limit to control this!



        See: http://bryanmarty.com/2012/02/10/setting-nofile-limit-upstart/







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 8 '18 at 0:29









        Richard MauriRichard Mauri

        1




        1






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f462112%2fnofile-ulimit-n-on-ubuntu-14-04-lts%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

            ComboBox Display Member on multiple fields

            Is it possible to collect Nectar points via Trainline?