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?)
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
add a comment |
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
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
add a comment |
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
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
memory cpu sar
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
add a comment |
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
add a comment |
3 Answers
3
active
oldest
votes
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.
add a comment |
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!!
New contributor
becausetop
runs repeatedly in the terminal untilq
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 yourexit 0
will never happen.
– ron
yesterday
add a comment |
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
- cpu %
- process id
- user name
- command running
- 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.
Is this the best Practice to have this kind of steps on Production Machines?
– Santosh Garole
20 hours ago
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered yesterday
ArchemarArchemar
20.4k93973
20.4k93973
add a comment |
add a comment |
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!!
New contributor
becausetop
runs repeatedly in the terminal untilq
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 yourexit 0
will never happen.
– ron
yesterday
add a comment |
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!!
New contributor
becausetop
runs repeatedly in the terminal untilq
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 yourexit 0
will never happen.
– ron
yesterday
add a comment |
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!!
New contributor
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!!
New contributor
New contributor
answered yesterday
Vivek KanadiyaVivek Kanadiya
3579
3579
New contributor
New contributor
becausetop
runs repeatedly in the terminal untilq
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 yourexit 0
will never happen.
– ron
yesterday
add a comment |
becausetop
runs repeatedly in the terminal untilq
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 yourexit 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
add a comment |
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
- cpu %
- process id
- user name
- command running
- 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.
Is this the best Practice to have this kind of steps on Production Machines?
– Santosh Garole
20 hours ago
add a comment |
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
- cpu %
- process id
- user name
- command running
- 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.
Is this the best Practice to have this kind of steps on Production Machines?
– Santosh Garole
20 hours ago
add a comment |
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
- cpu %
- process id
- user name
- command running
- 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.
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
- cpu %
- process id
- user name
- command running
- 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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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