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?)

Time travel short story where a man arrives in the late 19th century in a time machine and then sends the machine back into the past

There is only s̶i̶x̶t̶y one place he can be

Is it correct to write "is not focus on"?

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

Do there exist finite commutative rings with identity that are not Bézout rings?

Bash method for viewing beginning and end of file

If you attempt to grapple an opponent that you are hidden from, do they roll at disadvantage?

Trouble understanding overseas colleagues

How could Frankenstein get the parts for his _second_ creature?

The baby cries all morning

How will losing mobility of one hand affect my career as a programmer?

Where in the Bible does the greeting ("Dominus Vobiscum") used at Mass come from?

voltage of sounds of mp3files

Modify casing of marked letters

Your magic is very sketchy

Using parameter substitution on a Bash array

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

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

Should my PhD thesis be submitted under my legal name?

What is the intuitive meaning of having a linear relationship between the logs of two variables?

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

Understanding "audieritis" in Psalm 94

Student evaluations of teaching assistants

Is there a problem with hiding "forgot password" until it's needed?



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
      20 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
              20 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
              20 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
              20 hours ago

















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

              – Santosh Garole
              20 hours ago
















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

            – Santosh Garole
            20 hours ago





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

            – Santosh Garole
            20 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







            Popular posts from this blog

            getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

            Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

            Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.