Figure out which process forks too many threads

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












I have a process in a Linux installation that at some point has some kind of spike and passes the max allowed number of threads/processes allowed by the system. I found this by checking ps -elfT | wc -l repeatedly.



But what I don't know is what exactly is it that causes this spike.

The output of ps -elfT has a lot of information, but I cannot easily understand if there is some child process that does some kind of "blurp" in forking and makes a mess.



How could I figure that out?



Example: ps -elfT | cut -d' ' -f3 | sort |uniq gives me the processes running at the time. How could I add a count to see how much each contributes to the total?







share|improve this question


























    up vote
    3
    down vote

    favorite












    I have a process in a Linux installation that at some point has some kind of spike and passes the max allowed number of threads/processes allowed by the system. I found this by checking ps -elfT | wc -l repeatedly.



    But what I don't know is what exactly is it that causes this spike.

    The output of ps -elfT has a lot of information, but I cannot easily understand if there is some child process that does some kind of "blurp" in forking and makes a mess.



    How could I figure that out?



    Example: ps -elfT | cut -d' ' -f3 | sort |uniq gives me the processes running at the time. How could I add a count to see how much each contributes to the total?







    share|improve this question
























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I have a process in a Linux installation that at some point has some kind of spike and passes the max allowed number of threads/processes allowed by the system. I found this by checking ps -elfT | wc -l repeatedly.



      But what I don't know is what exactly is it that causes this spike.

      The output of ps -elfT has a lot of information, but I cannot easily understand if there is some child process that does some kind of "blurp" in forking and makes a mess.



      How could I figure that out?



      Example: ps -elfT | cut -d' ' -f3 | sort |uniq gives me the processes running at the time. How could I add a count to see how much each contributes to the total?







      share|improve this question














      I have a process in a Linux installation that at some point has some kind of spike and passes the max allowed number of threads/processes allowed by the system. I found this by checking ps -elfT | wc -l repeatedly.



      But what I don't know is what exactly is it that causes this spike.

      The output of ps -elfT has a lot of information, but I cannot easily understand if there is some child process that does some kind of "blurp" in forking and makes a mess.



      How could I figure that out?



      Example: ps -elfT | cut -d' ' -f3 | sort |uniq gives me the processes running at the time. How could I add a count to see how much each contributes to the total?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 13 '17 at 20:46









      terdon♦

      122k28230403




      122k28230403










      asked Dec 13 '17 at 19:54









      Jim

      39011




      39011




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          ps -eo nlwp,pid,args --sort nlwp


          Would show a list of processes sorted by their number of threads.



          For a top-like view of that, you can always do:



          watch -n 1 'ps -eo nlwp,pid,args --sort -nlwp | head'


          Or you could use... top.



          • press f to select the fields to display.

          • locate nTH (the number of threads) and press d to display it and s to make it the sort order

          • you can adjust its display position with → and then ↑ and ↓ and ⏎.


          • q to get back to the process list

          • press H if you want to see all the threads.


          • d to adjust the delay.


          • ? for help.





          share|improve this answer






















          • Would I see for all users? And also would that show also threads like with the T in the command in my post?
            – Jim
            Dec 13 '17 at 20:36










          • How can I view this information constantly instead of running it constanly? I.e. keep it refreshing like top?
            – Jim
            Dec 13 '17 at 21:29










          • @Jim, see edit.
            – Stéphane Chazelas
            Dec 13 '17 at 22:27










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f410727%2ffigure-out-which-process-forks-too-many-threads%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          4
          down vote



          accepted










          ps -eo nlwp,pid,args --sort nlwp


          Would show a list of processes sorted by their number of threads.



          For a top-like view of that, you can always do:



          watch -n 1 'ps -eo nlwp,pid,args --sort -nlwp | head'


          Or you could use... top.



          • press f to select the fields to display.

          • locate nTH (the number of threads) and press d to display it and s to make it the sort order

          • you can adjust its display position with → and then ↑ and ↓ and ⏎.


          • q to get back to the process list

          • press H if you want to see all the threads.


          • d to adjust the delay.


          • ? for help.





          share|improve this answer






















          • Would I see for all users? And also would that show also threads like with the T in the command in my post?
            – Jim
            Dec 13 '17 at 20:36










          • How can I view this information constantly instead of running it constanly? I.e. keep it refreshing like top?
            – Jim
            Dec 13 '17 at 21:29










          • @Jim, see edit.
            – Stéphane Chazelas
            Dec 13 '17 at 22:27














          up vote
          4
          down vote



          accepted










          ps -eo nlwp,pid,args --sort nlwp


          Would show a list of processes sorted by their number of threads.



          For a top-like view of that, you can always do:



          watch -n 1 'ps -eo nlwp,pid,args --sort -nlwp | head'


          Or you could use... top.



          • press f to select the fields to display.

          • locate nTH (the number of threads) and press d to display it and s to make it the sort order

          • you can adjust its display position with → and then ↑ and ↓ and ⏎.


          • q to get back to the process list

          • press H if you want to see all the threads.


          • d to adjust the delay.


          • ? for help.





          share|improve this answer






















          • Would I see for all users? And also would that show also threads like with the T in the command in my post?
            – Jim
            Dec 13 '17 at 20:36










          • How can I view this information constantly instead of running it constanly? I.e. keep it refreshing like top?
            – Jim
            Dec 13 '17 at 21:29










          • @Jim, see edit.
            – Stéphane Chazelas
            Dec 13 '17 at 22:27












          up vote
          4
          down vote



          accepted







          up vote
          4
          down vote



          accepted






          ps -eo nlwp,pid,args --sort nlwp


          Would show a list of processes sorted by their number of threads.



          For a top-like view of that, you can always do:



          watch -n 1 'ps -eo nlwp,pid,args --sort -nlwp | head'


          Or you could use... top.



          • press f to select the fields to display.

          • locate nTH (the number of threads) and press d to display it and s to make it the sort order

          • you can adjust its display position with → and then ↑ and ↓ and ⏎.


          • q to get back to the process list

          • press H if you want to see all the threads.


          • d to adjust the delay.


          • ? for help.





          share|improve this answer














          ps -eo nlwp,pid,args --sort nlwp


          Would show a list of processes sorted by their number of threads.



          For a top-like view of that, you can always do:



          watch -n 1 'ps -eo nlwp,pid,args --sort -nlwp | head'


          Or you could use... top.



          • press f to select the fields to display.

          • locate nTH (the number of threads) and press d to display it and s to make it the sort order

          • you can adjust its display position with → and then ↑ and ↓ and ⏎.


          • q to get back to the process list

          • press H if you want to see all the threads.


          • d to adjust the delay.


          • ? for help.






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 14 '17 at 21:38

























          answered Dec 13 '17 at 20:24









          Stéphane Chazelas

          282k53520854




          282k53520854











          • Would I see for all users? And also would that show also threads like with the T in the command in my post?
            – Jim
            Dec 13 '17 at 20:36










          • How can I view this information constantly instead of running it constanly? I.e. keep it refreshing like top?
            – Jim
            Dec 13 '17 at 21:29










          • @Jim, see edit.
            – Stéphane Chazelas
            Dec 13 '17 at 22:27
















          • Would I see for all users? And also would that show also threads like with the T in the command in my post?
            – Jim
            Dec 13 '17 at 20:36










          • How can I view this information constantly instead of running it constanly? I.e. keep it refreshing like top?
            – Jim
            Dec 13 '17 at 21:29










          • @Jim, see edit.
            – Stéphane Chazelas
            Dec 13 '17 at 22:27















          Would I see for all users? And also would that show also threads like with the T in the command in my post?
          – Jim
          Dec 13 '17 at 20:36




          Would I see for all users? And also would that show also threads like with the T in the command in my post?
          – Jim
          Dec 13 '17 at 20:36












          How can I view this information constantly instead of running it constanly? I.e. keep it refreshing like top?
          – Jim
          Dec 13 '17 at 21:29




          How can I view this information constantly instead of running it constanly? I.e. keep it refreshing like top?
          – Jim
          Dec 13 '17 at 21:29












          @Jim, see edit.
          – Stéphane Chazelas
          Dec 13 '17 at 22:27




          @Jim, see edit.
          – Stéphane Chazelas
          Dec 13 '17 at 22:27












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f410727%2ffigure-out-which-process-forks-too-many-threads%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?