Check what process is spiking the average load with atop












3















In trying to find the culprit of a high load average on a system during night (which does not seem to be related to logrotate) I installed atop to write a raw file with a specific interval. While reading the file, it seems the processlist stands still, can I somehow go back and forth between the samples to see what sticks out, and further sort by any column (like cpu usage)?










share|improve this question





























    3















    In trying to find the culprit of a high load average on a system during night (which does not seem to be related to logrotate) I installed atop to write a raw file with a specific interval. While reading the file, it seems the processlist stands still, can I somehow go back and forth between the samples to see what sticks out, and further sort by any column (like cpu usage)?










    share|improve this question



























      3












      3








      3








      In trying to find the culprit of a high load average on a system during night (which does not seem to be related to logrotate) I installed atop to write a raw file with a specific interval. While reading the file, it seems the processlist stands still, can I somehow go back and forth between the samples to see what sticks out, and further sort by any column (like cpu usage)?










      share|improve this question
















      In trying to find the culprit of a high load average on a system during night (which does not seem to be related to logrotate) I installed atop to write a raw file with a specific interval. While reading the file, it seems the processlist stands still, can I somehow go back and forth between the samples to see what sticks out, and further sort by any column (like cpu usage)?







      load-average atop






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 7 '14 at 2:06









      Braiam

      23.2k1976139




      23.2k1976139










      asked Sep 3 '13 at 13:31









      user135361user135361

      7816




      7816






















          3 Answers
          3






          active

          oldest

          votes


















          0














          Regarding your second question, the list printed by atop is sorted by cpu usage by default. If you want to sort it by other parameter (like resident memory consumption) you can do that (man atop tells you how for both the interactive and the raw file modes).



          Regarding your first question, this small AWK script may help:



          BEGIN {
          printline = "false"
          }
          {
          if (printline == "true") { print($0); printline = "false" }
          if ($1 == "PID") { printline = "true" }
          }


          Run it as awk -f myScript.awk logFromAtop.log and it will give you the top line of atop for every interval; it will probably be easy to see the few lines that stand out. (The script just looks for the lines that start with PID and prints the next ones.)



          Depending on your version of atop, it may give you an ASCII or binary raw file depending on the flags when you run it. In the latter case, you can get an ASCII version with atop itself, e.g. atop -r binary.raw > logFromAtop.log.






          share|improve this answer


























          • Thanks, but I use the raw mode of atop since I thought that would be a lot cleaner given I could forward and reverse between the takings. I might try writing the output to a file instead for sake of simplicity, unless you know how to properly use the raw files.

            – 3molo
            Sep 3 '13 at 14:31











          • I am not sure I understand. My answer is about the raw file produced by atop, not about atop's interactive mode.

            – sergut
            Sep 3 '13 at 16:51











          • @sergut - I'm confused, is that comment from the OP? The usernames don't match. You answer sounds fine to me too.

            – slm
            Sep 3 '13 at 18:57











          • Thanks, @slm. I am a bit confused as well, and unsure whether my answer was useful or not...

            – sergut
            Sep 4 '13 at 9:58











          • atop raw file is, at least on my system which is linux 2.6, produces some kind of binary format.

            – user135361
            Sep 11 '13 at 12:34



















          0














          You will never discover what process is causing high average loads looking at the CPU % usage. Load average depends on whenever a process is running (R) or waiting for I/O (D). So the actual option you should use is s:




          s
          Show scheduling characteristics.



          Per process the following fields are shown in case of a window-width of 80 positions: process-id, number of threads in state
          'running' (R), number of threads in state 'interruptible sleeping'
          (S), number of threads in state 'uninterruptible sleeping' (D),
          scheduling policy
          (normal timesharing, realtime round-robin, realtime
          fifo), nice value, priority, realtime priority, current processor,
          status, exit code, state, the occupation percentage for the choosen
          resource and the process name.



          When more than 80 positions are available, other information is added.




          Just change your configuration to show scheduling characteristics and you will find the culprit.






          share|improve this answer































            0














            Run atop with the -r argument followed by your log file :



            Then, while atop is running you can use ctrl+F to see the next page, or ctrl+B to see the previous one.






            share|improve this answer























              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',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              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%2funix.stackexchange.com%2fquestions%2f89259%2fcheck-what-process-is-spiking-the-average-load-with-atop%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              Regarding your second question, the list printed by atop is sorted by cpu usage by default. If you want to sort it by other parameter (like resident memory consumption) you can do that (man atop tells you how for both the interactive and the raw file modes).



              Regarding your first question, this small AWK script may help:



              BEGIN {
              printline = "false"
              }
              {
              if (printline == "true") { print($0); printline = "false" }
              if ($1 == "PID") { printline = "true" }
              }


              Run it as awk -f myScript.awk logFromAtop.log and it will give you the top line of atop for every interval; it will probably be easy to see the few lines that stand out. (The script just looks for the lines that start with PID and prints the next ones.)



              Depending on your version of atop, it may give you an ASCII or binary raw file depending on the flags when you run it. In the latter case, you can get an ASCII version with atop itself, e.g. atop -r binary.raw > logFromAtop.log.






              share|improve this answer


























              • Thanks, but I use the raw mode of atop since I thought that would be a lot cleaner given I could forward and reverse between the takings. I might try writing the output to a file instead for sake of simplicity, unless you know how to properly use the raw files.

                – 3molo
                Sep 3 '13 at 14:31











              • I am not sure I understand. My answer is about the raw file produced by atop, not about atop's interactive mode.

                – sergut
                Sep 3 '13 at 16:51











              • @sergut - I'm confused, is that comment from the OP? The usernames don't match. You answer sounds fine to me too.

                – slm
                Sep 3 '13 at 18:57











              • Thanks, @slm. I am a bit confused as well, and unsure whether my answer was useful or not...

                – sergut
                Sep 4 '13 at 9:58











              • atop raw file is, at least on my system which is linux 2.6, produces some kind of binary format.

                – user135361
                Sep 11 '13 at 12:34
















              0














              Regarding your second question, the list printed by atop is sorted by cpu usage by default. If you want to sort it by other parameter (like resident memory consumption) you can do that (man atop tells you how for both the interactive and the raw file modes).



              Regarding your first question, this small AWK script may help:



              BEGIN {
              printline = "false"
              }
              {
              if (printline == "true") { print($0); printline = "false" }
              if ($1 == "PID") { printline = "true" }
              }


              Run it as awk -f myScript.awk logFromAtop.log and it will give you the top line of atop for every interval; it will probably be easy to see the few lines that stand out. (The script just looks for the lines that start with PID and prints the next ones.)



              Depending on your version of atop, it may give you an ASCII or binary raw file depending on the flags when you run it. In the latter case, you can get an ASCII version with atop itself, e.g. atop -r binary.raw > logFromAtop.log.






              share|improve this answer


























              • Thanks, but I use the raw mode of atop since I thought that would be a lot cleaner given I could forward and reverse between the takings. I might try writing the output to a file instead for sake of simplicity, unless you know how to properly use the raw files.

                – 3molo
                Sep 3 '13 at 14:31











              • I am not sure I understand. My answer is about the raw file produced by atop, not about atop's interactive mode.

                – sergut
                Sep 3 '13 at 16:51











              • @sergut - I'm confused, is that comment from the OP? The usernames don't match. You answer sounds fine to me too.

                – slm
                Sep 3 '13 at 18:57











              • Thanks, @slm. I am a bit confused as well, and unsure whether my answer was useful or not...

                – sergut
                Sep 4 '13 at 9:58











              • atop raw file is, at least on my system which is linux 2.6, produces some kind of binary format.

                – user135361
                Sep 11 '13 at 12:34














              0












              0








              0







              Regarding your second question, the list printed by atop is sorted by cpu usage by default. If you want to sort it by other parameter (like resident memory consumption) you can do that (man atop tells you how for both the interactive and the raw file modes).



              Regarding your first question, this small AWK script may help:



              BEGIN {
              printline = "false"
              }
              {
              if (printline == "true") { print($0); printline = "false" }
              if ($1 == "PID") { printline = "true" }
              }


              Run it as awk -f myScript.awk logFromAtop.log and it will give you the top line of atop for every interval; it will probably be easy to see the few lines that stand out. (The script just looks for the lines that start with PID and prints the next ones.)



              Depending on your version of atop, it may give you an ASCII or binary raw file depending on the flags when you run it. In the latter case, you can get an ASCII version with atop itself, e.g. atop -r binary.raw > logFromAtop.log.






              share|improve this answer















              Regarding your second question, the list printed by atop is sorted by cpu usage by default. If you want to sort it by other parameter (like resident memory consumption) you can do that (man atop tells you how for both the interactive and the raw file modes).



              Regarding your first question, this small AWK script may help:



              BEGIN {
              printline = "false"
              }
              {
              if (printline == "true") { print($0); printline = "false" }
              if ($1 == "PID") { printline = "true" }
              }


              Run it as awk -f myScript.awk logFromAtop.log and it will give you the top line of atop for every interval; it will probably be easy to see the few lines that stand out. (The script just looks for the lines that start with PID and prints the next ones.)



              Depending on your version of atop, it may give you an ASCII or binary raw file depending on the flags when you run it. In the latter case, you can get an ASCII version with atop itself, e.g. atop -r binary.raw > logFromAtop.log.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Sep 11 '13 at 16:19

























              answered Sep 3 '13 at 14:25









              sergutsergut

              839511




              839511













              • Thanks, but I use the raw mode of atop since I thought that would be a lot cleaner given I could forward and reverse between the takings. I might try writing the output to a file instead for sake of simplicity, unless you know how to properly use the raw files.

                – 3molo
                Sep 3 '13 at 14:31











              • I am not sure I understand. My answer is about the raw file produced by atop, not about atop's interactive mode.

                – sergut
                Sep 3 '13 at 16:51











              • @sergut - I'm confused, is that comment from the OP? The usernames don't match. You answer sounds fine to me too.

                – slm
                Sep 3 '13 at 18:57











              • Thanks, @slm. I am a bit confused as well, and unsure whether my answer was useful or not...

                – sergut
                Sep 4 '13 at 9:58











              • atop raw file is, at least on my system which is linux 2.6, produces some kind of binary format.

                – user135361
                Sep 11 '13 at 12:34



















              • Thanks, but I use the raw mode of atop since I thought that would be a lot cleaner given I could forward and reverse between the takings. I might try writing the output to a file instead for sake of simplicity, unless you know how to properly use the raw files.

                – 3molo
                Sep 3 '13 at 14:31











              • I am not sure I understand. My answer is about the raw file produced by atop, not about atop's interactive mode.

                – sergut
                Sep 3 '13 at 16:51











              • @sergut - I'm confused, is that comment from the OP? The usernames don't match. You answer sounds fine to me too.

                – slm
                Sep 3 '13 at 18:57











              • Thanks, @slm. I am a bit confused as well, and unsure whether my answer was useful or not...

                – sergut
                Sep 4 '13 at 9:58











              • atop raw file is, at least on my system which is linux 2.6, produces some kind of binary format.

                – user135361
                Sep 11 '13 at 12:34

















              Thanks, but I use the raw mode of atop since I thought that would be a lot cleaner given I could forward and reverse between the takings. I might try writing the output to a file instead for sake of simplicity, unless you know how to properly use the raw files.

              – 3molo
              Sep 3 '13 at 14:31





              Thanks, but I use the raw mode of atop since I thought that would be a lot cleaner given I could forward and reverse between the takings. I might try writing the output to a file instead for sake of simplicity, unless you know how to properly use the raw files.

              – 3molo
              Sep 3 '13 at 14:31













              I am not sure I understand. My answer is about the raw file produced by atop, not about atop's interactive mode.

              – sergut
              Sep 3 '13 at 16:51





              I am not sure I understand. My answer is about the raw file produced by atop, not about atop's interactive mode.

              – sergut
              Sep 3 '13 at 16:51













              @sergut - I'm confused, is that comment from the OP? The usernames don't match. You answer sounds fine to me too.

              – slm
              Sep 3 '13 at 18:57





              @sergut - I'm confused, is that comment from the OP? The usernames don't match. You answer sounds fine to me too.

              – slm
              Sep 3 '13 at 18:57













              Thanks, @slm. I am a bit confused as well, and unsure whether my answer was useful or not...

              – sergut
              Sep 4 '13 at 9:58





              Thanks, @slm. I am a bit confused as well, and unsure whether my answer was useful or not...

              – sergut
              Sep 4 '13 at 9:58













              atop raw file is, at least on my system which is linux 2.6, produces some kind of binary format.

              – user135361
              Sep 11 '13 at 12:34





              atop raw file is, at least on my system which is linux 2.6, produces some kind of binary format.

              – user135361
              Sep 11 '13 at 12:34













              0














              You will never discover what process is causing high average loads looking at the CPU % usage. Load average depends on whenever a process is running (R) or waiting for I/O (D). So the actual option you should use is s:




              s
              Show scheduling characteristics.



              Per process the following fields are shown in case of a window-width of 80 positions: process-id, number of threads in state
              'running' (R), number of threads in state 'interruptible sleeping'
              (S), number of threads in state 'uninterruptible sleeping' (D),
              scheduling policy
              (normal timesharing, realtime round-robin, realtime
              fifo), nice value, priority, realtime priority, current processor,
              status, exit code, state, the occupation percentage for the choosen
              resource and the process name.



              When more than 80 positions are available, other information is added.




              Just change your configuration to show scheduling characteristics and you will find the culprit.






              share|improve this answer




























                0














                You will never discover what process is causing high average loads looking at the CPU % usage. Load average depends on whenever a process is running (R) or waiting for I/O (D). So the actual option you should use is s:




                s
                Show scheduling characteristics.



                Per process the following fields are shown in case of a window-width of 80 positions: process-id, number of threads in state
                'running' (R), number of threads in state 'interruptible sleeping'
                (S), number of threads in state 'uninterruptible sleeping' (D),
                scheduling policy
                (normal timesharing, realtime round-robin, realtime
                fifo), nice value, priority, realtime priority, current processor,
                status, exit code, state, the occupation percentage for the choosen
                resource and the process name.



                When more than 80 positions are available, other information is added.




                Just change your configuration to show scheduling characteristics and you will find the culprit.






                share|improve this answer


























                  0












                  0








                  0







                  You will never discover what process is causing high average loads looking at the CPU % usage. Load average depends on whenever a process is running (R) or waiting for I/O (D). So the actual option you should use is s:




                  s
                  Show scheduling characteristics.



                  Per process the following fields are shown in case of a window-width of 80 positions: process-id, number of threads in state
                  'running' (R), number of threads in state 'interruptible sleeping'
                  (S), number of threads in state 'uninterruptible sleeping' (D),
                  scheduling policy
                  (normal timesharing, realtime round-robin, realtime
                  fifo), nice value, priority, realtime priority, current processor,
                  status, exit code, state, the occupation percentage for the choosen
                  resource and the process name.



                  When more than 80 positions are available, other information is added.




                  Just change your configuration to show scheduling characteristics and you will find the culprit.






                  share|improve this answer













                  You will never discover what process is causing high average loads looking at the CPU % usage. Load average depends on whenever a process is running (R) or waiting for I/O (D). So the actual option you should use is s:




                  s
                  Show scheduling characteristics.



                  Per process the following fields are shown in case of a window-width of 80 positions: process-id, number of threads in state
                  'running' (R), number of threads in state 'interruptible sleeping'
                  (S), number of threads in state 'uninterruptible sleeping' (D),
                  scheduling policy
                  (normal timesharing, realtime round-robin, realtime
                  fifo), nice value, priority, realtime priority, current processor,
                  status, exit code, state, the occupation percentage for the choosen
                  resource and the process name.



                  When more than 80 positions are available, other information is added.




                  Just change your configuration to show scheduling characteristics and you will find the culprit.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 7 '14 at 2:06









                  BraiamBraiam

                  23.2k1976139




                  23.2k1976139























                      0














                      Run atop with the -r argument followed by your log file :



                      Then, while atop is running you can use ctrl+F to see the next page, or ctrl+B to see the previous one.






                      share|improve this answer




























                        0














                        Run atop with the -r argument followed by your log file :



                        Then, while atop is running you can use ctrl+F to see the next page, or ctrl+B to see the previous one.






                        share|improve this answer


























                          0












                          0








                          0







                          Run atop with the -r argument followed by your log file :



                          Then, while atop is running you can use ctrl+F to see the next page, or ctrl+B to see the previous one.






                          share|improve this answer













                          Run atop with the -r argument followed by your log file :



                          Then, while atop is running you can use ctrl+F to see the next page, or ctrl+B to see the previous one.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 4 '15 at 17:41









                          VinzVinz

                          1,569716




                          1,569716






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • 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%2funix.stackexchange.com%2fquestions%2f89259%2fcheck-what-process-is-spiking-the-average-load-with-atop%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

                              How to make a Squid Proxy server?

                              Is this a new Fibonacci Identity?

                              19世紀