How to find top memory & CPU consuming process for particular time?How does cached memory work for executables?How to monitor top applications using CPU (and IO if possible) in a graph?Execution time and resources after processes that has been running for so longHow can I find the amount of memory consumed by a process?detect process eating cpu without: top, htop, ps?Resource (CPU time and memory) limitation and termination of a process upon violation in Linuxsar command vs /proc/stat for cpu usageHow much RAM, Diskspace and CPU time is used by a scriptFind out exact cause of a process' high CPU usage (gnome-shell)How does ps measure %CPU per process (and can this be changed?)

Is there any reason not to eat food that's been dropped on the surface of the moon?

How was Earth single-handedly capable of creating 3 of the 4 gods of chaos?

Are there any comparative studies done between Ashtavakra Gita and Buddhim?

What would happen if the UK refused to take part in EU Parliamentary elections?

What is difference between behavior and behaviour

What's a natural way to say that someone works somewhere (for a job)?

What is the oldest known work of fiction?

Is the destination of a commercial flight important for the pilot?

Why are on-board computers allowed to change controls without notifying the pilots?

How do I keep an essay about "feeling flat" from feeling flat?

What to do with wrong results in talks?

What's the purpose of "true" in bash "if sudo true; then"

Was the picture area of a CRT a parallelogram (instead of a true rectangle)?

Can somebody explain Brexit in a few child-proof sentences?

Applicability of Single Responsibility Principle

Is there an Impartial Brexit Deal comparison site?

Increase performance creating Mandelbrot set in python

Print name if parameter passed to function

Tiptoe or tiphoof? Adjusting words to better fit fantasy races

How does it work when somebody invests in my business?

Using parameter substitution on a Bash array

How do I define a right arrow with bar in LaTeX?

is this a spam?

I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?



How to find top memory & CPU consuming process for particular time?


How does cached memory work for executables?How to monitor top applications using CPU (and IO if possible) in a graph?Execution time and resources after processes that has been running for so longHow can I find the amount of memory consumed by a process?detect process eating cpu without: top, htop, ps?Resource (CPU time and memory) limitation and termination of a process upon violation in Linuxsar command vs /proc/stat for cpu usageHow much RAM, Diskspace and CPU time is used by a scriptFind out exact cause of a process' high CPU usage (gnome-shell)How does ps measure %CPU per process (and can this be changed?)













0















I have checked the sar report and found that CPU & Memory is getting utilized much more at particular time (for ex. day ago).



Is it possible to find which process was taking much CPU & Mem?
How do we found which process were consuming that Memory & CPU.










share|improve this question
























  • What interval you are looking for ?

    – Vivek Kanadiya
    yesterday











  • Suppose we had an incident on 25th of Feb and we got to know on 26th morning?

    – Santosh Garole
    19 hours ago











  • Well, From my understanding there is no was that you will be able to see history as by default it's not logged but you can script is to output in the file to look back! I would say it's better to run it every 2 mins as it will only create text file and then purge it every 5 days.

    – Vivek Kanadiya
    15 hours ago















0















I have checked the sar report and found that CPU & Memory is getting utilized much more at particular time (for ex. day ago).



Is it possible to find which process was taking much CPU & Mem?
How do we found which process were consuming that Memory & CPU.










share|improve this question
























  • What interval you are looking for ?

    – Vivek Kanadiya
    yesterday











  • Suppose we had an incident on 25th of Feb and we got to know on 26th morning?

    – Santosh Garole
    19 hours ago











  • Well, From my understanding there is no was that you will be able to see history as by default it's not logged but you can script is to output in the file to look back! I would say it's better to run it every 2 mins as it will only create text file and then purge it every 5 days.

    – Vivek Kanadiya
    15 hours ago













0












0








0








I have checked the sar report and found that CPU & Memory is getting utilized much more at particular time (for ex. day ago).



Is it possible to find which process was taking much CPU & Mem?
How do we found which process were consuming that Memory & CPU.










share|improve this question
















I have checked the sar report and found that CPU & Memory is getting utilized much more at particular time (for ex. day ago).



Is it possible to find which process was taking much CPU & Mem?
How do we found which process were consuming that Memory & CPU.







memory cpu sar






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Prvt_Yadv

2,92531327




2,92531327










asked yesterday









Santosh GaroleSantosh Garole

62




62












  • What interval you are looking for ?

    – Vivek Kanadiya
    yesterday











  • Suppose we had an incident on 25th of Feb and we got to know on 26th morning?

    – Santosh Garole
    19 hours ago











  • Well, From my understanding there is no was that you will be able to see history as by default it's not logged but you can script is to output in the file to look back! I would say it's better to run it every 2 mins as it will only create text file and then purge it every 5 days.

    – Vivek Kanadiya
    15 hours ago

















  • What interval you are looking for ?

    – Vivek Kanadiya
    yesterday











  • Suppose we had an incident on 25th of Feb and we got to know on 26th morning?

    – Santosh Garole
    19 hours ago











  • Well, From my understanding there is no was that you will be able to see history as by default it's not logged but you can script is to output in the file to look back! I would say it's better to run it every 2 mins as it will only create text file and then purge it every 5 days.

    – Vivek Kanadiya
    15 hours ago
















What interval you are looking for ?

– Vivek Kanadiya
yesterday





What interval you are looking for ?

– Vivek Kanadiya
yesterday













Suppose we had an incident on 25th of Feb and we got to know on 26th morning?

– Santosh Garole
19 hours ago





Suppose we had an incident on 25th of Feb and we got to know on 26th morning?

– Santosh Garole
19 hours ago













Well, From my understanding there is no was that you will be able to see history as by default it's not logged but you can script is to output in the file to look back! I would say it's better to run it every 2 mins as it will only create text file and then purge it every 5 days.

– Vivek Kanadiya
15 hours ago





Well, From my understanding there is no was that you will be able to see history as by default it's not logged but you can script is to output in the file to look back! I would say it's better to run it every 2 mins as it will only create text file and then purge it every 5 days.

– Vivek Kanadiya
15 hours ago










3 Answers
3






active

oldest

votes


















1














No.



Unless you have set some (complex) monitoring you won't be able to find out which process used CPU once process has exited.



there is no such "standard" thing as a table with



exec path;exec name;stime,etime,%sys,%io,%wait,%idle,...


you must catch the process during exec time.






share|improve this answer






























    0














    This can be achieved by saving the output of top command in file:



    Script:



    NOW=`date "%y%m%d_%H%M%S"` ## to print the time.

    echo "$NOW"
    top > <PATH_TO_FILE>
    exit 0


    Once done you can put this script in cron to run at specific internal!!






    share|improve this answer








    New contributor




    Vivek Kanadiya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.




















    • because top runs repeatedly in the terminal until q is pressed, generally updating every second or every 3 seconds, it will make a heck of a mess redirected into any output file. As well as never quit, so your exit 0 will never happen.

      – ron
      yesterday



















    0














    crontab -e



    # min hr day month day_of_week

    # every minute run :
    1 * * * * /root/watch_processes.sh


    one time do manually: mkdir /root/process_watch



    create simple script /root/watch_processes.sh



    #!/bin/bash

    # %cpu pid command args

    ps -eo "%C %P %U %c %a" > /root/process_watch/`date +%Y%m%d_%H%M`


    The above will create a text file, every minute, having only the date as the filename but they will all be under the given folder which in the example above is /mkdir/process_watch. Adjust accordingly.



    http://linuxcommand.org/lc3_man_pages/ps1.html



    tweak the output as needed of ps -eo for every process, using %C %P %U %c %a will result in these 5 columns of data



    1. cpu %

    2. process id

    3. user name

    4. command running

    5. arguments given to command running

    In each file you will get a lot of listing with 0.0 in the first column. Someone good with awk or sed can maybe add syntax to the above to filter out the 0% cpu processes.



    like was said you have to catch the process when it happens, once the process finishes there is no record of pid# having taken %cpu when. You will have to do a process watch like this then go back and find the offenders.






    share|improve this answer

























    • Is this the best Practice to have this kind of steps on Production Machines?

      – Santosh Garole
      19 hours ago










    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%2f508518%2fhow-to-find-top-memory-cpu-consuming-process-for-particular-time%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









    1














    No.



    Unless you have set some (complex) monitoring you won't be able to find out which process used CPU once process has exited.



    there is no such "standard" thing as a table with



    exec path;exec name;stime,etime,%sys,%io,%wait,%idle,...


    you must catch the process during exec time.






    share|improve this answer



























      1














      No.



      Unless you have set some (complex) monitoring you won't be able to find out which process used CPU once process has exited.



      there is no such "standard" thing as a table with



      exec path;exec name;stime,etime,%sys,%io,%wait,%idle,...


      you must catch the process during exec time.






      share|improve this answer

























        1












        1








        1







        No.



        Unless you have set some (complex) monitoring you won't be able to find out which process used CPU once process has exited.



        there is no such "standard" thing as a table with



        exec path;exec name;stime,etime,%sys,%io,%wait,%idle,...


        you must catch the process during exec time.






        share|improve this answer













        No.



        Unless you have set some (complex) monitoring you won't be able to find out which process used CPU once process has exited.



        there is no such "standard" thing as a table with



        exec path;exec name;stime,etime,%sys,%io,%wait,%idle,...


        you must catch the process during exec time.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        ArchemarArchemar

        20.4k93973




        20.4k93973























            0














            This can be achieved by saving the output of top command in file:



            Script:



            NOW=`date "%y%m%d_%H%M%S"` ## to print the time.

            echo "$NOW"
            top > <PATH_TO_FILE>
            exit 0


            Once done you can put this script in cron to run at specific internal!!






            share|improve this answer








            New contributor




            Vivek Kanadiya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.




















            • because top runs repeatedly in the terminal until q is pressed, generally updating every second or every 3 seconds, it will make a heck of a mess redirected into any output file. As well as never quit, so your exit 0 will never happen.

              – ron
              yesterday
















            0














            This can be achieved by saving the output of top command in file:



            Script:



            NOW=`date "%y%m%d_%H%M%S"` ## to print the time.

            echo "$NOW"
            top > <PATH_TO_FILE>
            exit 0


            Once done you can put this script in cron to run at specific internal!!






            share|improve this answer








            New contributor




            Vivek Kanadiya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.




















            • because top runs repeatedly in the terminal until q is pressed, generally updating every second or every 3 seconds, it will make a heck of a mess redirected into any output file. As well as never quit, so your exit 0 will never happen.

              – ron
              yesterday














            0












            0








            0







            This can be achieved by saving the output of top command in file:



            Script:



            NOW=`date "%y%m%d_%H%M%S"` ## to print the time.

            echo "$NOW"
            top > <PATH_TO_FILE>
            exit 0


            Once done you can put this script in cron to run at specific internal!!






            share|improve this answer








            New contributor




            Vivek Kanadiya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.










            This can be achieved by saving the output of top command in file:



            Script:



            NOW=`date "%y%m%d_%H%M%S"` ## to print the time.

            echo "$NOW"
            top > <PATH_TO_FILE>
            exit 0


            Once done you can put this script in cron to run at specific internal!!







            share|improve this answer








            New contributor




            Vivek Kanadiya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            share|improve this answer



            share|improve this answer






            New contributor




            Vivek Kanadiya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            answered yesterday









            Vivek KanadiyaVivek Kanadiya

            3579




            3579




            New contributor




            Vivek Kanadiya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





            New contributor





            Vivek Kanadiya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            Vivek Kanadiya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.












            • because top runs repeatedly in the terminal until q is pressed, generally updating every second or every 3 seconds, it will make a heck of a mess redirected into any output file. As well as never quit, so your exit 0 will never happen.

              – ron
              yesterday


















            • because top runs repeatedly in the terminal until q is pressed, generally updating every second or every 3 seconds, it will make a heck of a mess redirected into any output file. As well as never quit, so your exit 0 will never happen.

              – ron
              yesterday

















            because top runs repeatedly in the terminal until q is pressed, generally updating every second or every 3 seconds, it will make a heck of a mess redirected into any output file. As well as never quit, so your exit 0 will never happen.

            – ron
            yesterday






            because top runs repeatedly in the terminal until q is pressed, generally updating every second or every 3 seconds, it will make a heck of a mess redirected into any output file. As well as never quit, so your exit 0 will never happen.

            – ron
            yesterday












            0














            crontab -e



            # min hr day month day_of_week

            # every minute run :
            1 * * * * /root/watch_processes.sh


            one time do manually: mkdir /root/process_watch



            create simple script /root/watch_processes.sh



            #!/bin/bash

            # %cpu pid command args

            ps -eo "%C %P %U %c %a" > /root/process_watch/`date +%Y%m%d_%H%M`


            The above will create a text file, every minute, having only the date as the filename but they will all be under the given folder which in the example above is /mkdir/process_watch. Adjust accordingly.



            http://linuxcommand.org/lc3_man_pages/ps1.html



            tweak the output as needed of ps -eo for every process, using %C %P %U %c %a will result in these 5 columns of data



            1. cpu %

            2. process id

            3. user name

            4. command running

            5. arguments given to command running

            In each file you will get a lot of listing with 0.0 in the first column. Someone good with awk or sed can maybe add syntax to the above to filter out the 0% cpu processes.



            like was said you have to catch the process when it happens, once the process finishes there is no record of pid# having taken %cpu when. You will have to do a process watch like this then go back and find the offenders.






            share|improve this answer

























            • Is this the best Practice to have this kind of steps on Production Machines?

              – Santosh Garole
              19 hours ago















            0














            crontab -e



            # min hr day month day_of_week

            # every minute run :
            1 * * * * /root/watch_processes.sh


            one time do manually: mkdir /root/process_watch



            create simple script /root/watch_processes.sh



            #!/bin/bash

            # %cpu pid command args

            ps -eo "%C %P %U %c %a" > /root/process_watch/`date +%Y%m%d_%H%M`


            The above will create a text file, every minute, having only the date as the filename but they will all be under the given folder which in the example above is /mkdir/process_watch. Adjust accordingly.



            http://linuxcommand.org/lc3_man_pages/ps1.html



            tweak the output as needed of ps -eo for every process, using %C %P %U %c %a will result in these 5 columns of data



            1. cpu %

            2. process id

            3. user name

            4. command running

            5. arguments given to command running

            In each file you will get a lot of listing with 0.0 in the first column. Someone good with awk or sed can maybe add syntax to the above to filter out the 0% cpu processes.



            like was said you have to catch the process when it happens, once the process finishes there is no record of pid# having taken %cpu when. You will have to do a process watch like this then go back and find the offenders.






            share|improve this answer

























            • Is this the best Practice to have this kind of steps on Production Machines?

              – Santosh Garole
              19 hours ago













            0












            0








            0







            crontab -e



            # min hr day month day_of_week

            # every minute run :
            1 * * * * /root/watch_processes.sh


            one time do manually: mkdir /root/process_watch



            create simple script /root/watch_processes.sh



            #!/bin/bash

            # %cpu pid command args

            ps -eo "%C %P %U %c %a" > /root/process_watch/`date +%Y%m%d_%H%M`


            The above will create a text file, every minute, having only the date as the filename but they will all be under the given folder which in the example above is /mkdir/process_watch. Adjust accordingly.



            http://linuxcommand.org/lc3_man_pages/ps1.html



            tweak the output as needed of ps -eo for every process, using %C %P %U %c %a will result in these 5 columns of data



            1. cpu %

            2. process id

            3. user name

            4. command running

            5. arguments given to command running

            In each file you will get a lot of listing with 0.0 in the first column. Someone good with awk or sed can maybe add syntax to the above to filter out the 0% cpu processes.



            like was said you have to catch the process when it happens, once the process finishes there is no record of pid# having taken %cpu when. You will have to do a process watch like this then go back and find the offenders.






            share|improve this answer















            crontab -e



            # min hr day month day_of_week

            # every minute run :
            1 * * * * /root/watch_processes.sh


            one time do manually: mkdir /root/process_watch



            create simple script /root/watch_processes.sh



            #!/bin/bash

            # %cpu pid command args

            ps -eo "%C %P %U %c %a" > /root/process_watch/`date +%Y%m%d_%H%M`


            The above will create a text file, every minute, having only the date as the filename but they will all be under the given folder which in the example above is /mkdir/process_watch. Adjust accordingly.



            http://linuxcommand.org/lc3_man_pages/ps1.html



            tweak the output as needed of ps -eo for every process, using %C %P %U %c %a will result in these 5 columns of data



            1. cpu %

            2. process id

            3. user name

            4. command running

            5. arguments given to command running

            In each file you will get a lot of listing with 0.0 in the first column. Someone good with awk or sed can maybe add syntax to the above to filter out the 0% cpu processes.



            like was said you have to catch the process when it happens, once the process finishes there is no record of pid# having taken %cpu when. You will have to do a process watch like this then go back and find the offenders.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited yesterday

























            answered yesterday









            ronron

            1,1702817




            1,1702817












            • Is this the best Practice to have this kind of steps on Production Machines?

              – Santosh Garole
              19 hours ago

















            • Is this the best Practice to have this kind of steps on Production Machines?

              – Santosh Garole
              19 hours ago
















            Is this the best Practice to have this kind of steps on Production Machines?

            – Santosh Garole
            19 hours ago





            Is this the best Practice to have this kind of steps on Production Machines?

            – Santosh Garole
            19 hours ago

















            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%2f508518%2fhow-to-find-top-memory-cpu-consuming-process-for-particular-time%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







            -cpu, memory, sar

            Popular posts from this blog

            Identify plant with long narrow paired leaves and reddish stems Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?What is this plant with long sharp leaves? Is it a weed?What is this 3ft high, stalky plant, with mid sized narrow leaves?What is this young shrub with opposite ovate, crenate leaves and reddish stems?What is this plant with large broad serrated leaves?Identify this upright branching weed with long leaves and reddish stemsPlease help me identify this bulbous plant with long, broad leaves and white flowersWhat is this small annual with narrow gray/green leaves and rust colored daisy-type flowers?What is this chilli plant?Does anyone know what type of chilli plant this is?Help identify this plant

            fontconfig warning: “/etc/fonts/fonts.conf”, line 100: unknown “element blank” The 2019 Stack Overflow Developer Survey Results Are In“tar: unrecognized option --warning” during 'apt-get install'How to fix Fontconfig errorHow do I figure out which font file is chosen for a system generic font alias?Why are some apt-get-installed fonts being ignored by fc-list, xfontsel, etc?Reload settings in /etc/fonts/conf.dTaking 30 seconds longer to boot after upgrade from jessie to stretchHow to match multiple font names with a single <match> element?Adding a custom font to fontconfigRemoving fonts from fontconfig <match> resultsBroken fonts after upgrading Firefox ESR to latest Firefox

            Shilpa Shastras Contents Description In painting In carpentry In metallurgy Shilpa Shastra education in ancient India Treatises on Shilpa Shastras See also References Further reading External links Navigation menueOverviewTraditions of the Indian Craftsman251930242ŚilpinŚilpiniTraditions of the Indian CraftsmanThe Technique of Wall Painting in Ancient IndiaEssay on the Architecture of the HindusThe Journal of the Society of Arts10.1007/s11837-998-0378-3The role of India in the diffusion of early culturesTraditions of the Indian CraftsmanAn Encyclopedia of Hindu ArchitectureBibliography of Vastu Shastra Literature, 1834-2009The Technique of Wall Painting in Ancient India4483067Les lapidaires indiens