Ps ef command runs slow11/13/2023 ![]() ![]() If there are any processes found, kill them. Use awk again to pull out the PID of the script. 1 Answer Sorted by: 31 -e and -f are options to the ps command, and pipes take the output of one command and pass it as the input to another. Use grep to find the lines that contain the name of the script that you want to kill. This may be because it is taking up too much process time, causing the system to slow down. After read some online materials, I also run the command strace -o stracereport.txt top. It is sometimes necessary to kill an executing process. I have checked the usage of disk space, memory, and CPU, all of them are OK. /bin/bash SYSTEMDPID(ps -ef grep /lib/systemd/systemd -system-unitbasic.target grep -v. processname - the pattern for grep to search. f - show processes in full format (more detailed than default) command 1 command 2 - pass output of command 1 as input to command 2. I am not familiar with the output meaning of strace. ![]() Could anyone teach me how to figure out where the problem is Based on berndbausch 's suggestion, I summarize the strace output via stracestats. I also tested commands like ls and get the output immediately. e - show all processes, not just those belonging to the user. It is weird that not all commands are running slowly. One, is the list ars route-chosen and list aar. Pass the list of PIDs back to ps to get the full process listing. Recently, I find when I run commands like top or ps -aux on a server, it is very slow to show the result (STDOUT). Here is a full breakdown of this command: ps - list processes. (Doc ID 1304023.1) Last updated on MAApplies to: Solaris Operating System - Version 8 6/00 U1 to 10 9/10 U9 Release 8.0 to 10.0 Information in this document applies to any platform. In CMS looged in as root you can type ps - ef grep winio This will give you a list of loged in users. Use awk to only select lines where the elapsed seconds are greater than 43200s (12 hours), and to strip out just the first column with the PIDs. This is the terminal from which the process was started. Use ps to get a list of all processes ( -e) and only output the pid and the elapsed number of seconds ( -o pid,etimes). If you want to know full year and time of a lone running process, fire the command with this option ps efo user, pid, ppid, etime, args etime will tell for last how many days process has been running. PROGRAM_THAT_NEEDS_TO_DIE=bad-python-script.py To kill all processes older than X seconds where any part of the full running command matches a string, you can run this as root: MAX_SECONDS=43200 If you have a Python/Perl/Ruby script you want to kill, killall won't help you since killall will just look for "python" or "perl", it can't match the name of a specific script. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |