- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: system script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 11:26 PM
10-06-2011 11:26 PM
system script
In my unix / linux server , there are always many process running in high CPU and use much memory , it makes the system run very slow .
Can advise if I would like to find it out , find and kill the processes which are
1) running over 3 hours with 90% CPU .
2) the process run over 12 hours
Can advise how can I write it ? or I guess these are very useful unix admin script , can advise where I can find the similiar one ?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2011 02:45 AM
10-07-2011 02:45 AM
Re: system script
>there are always many process running in high CPU and use much memory, it makes the system run very slow.
Normally, it's your job to add more CPUs and memory to your machine, not kill arbitrary processes.
How do you know these processes are useless?
Take a look at the ps(1) output for the processes:
ps -ef
And look at the stime and time fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2011 01:06 AM
10-10-2011 01:06 AM
Re: system script
thx reply , I am not familiar with writing shell script , can advise what can I do ? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2011 10:48 PM - edited 10-24-2011 10:02 PM
10-14-2011 10:48 PM - edited 10-24-2011 10:02 PM
Re: system script
>I am not familiar with writing shell script, can advise what can I do?
If you execute the following ps(1) command you can get an entry for each process to make a decision. Here is the
ps(1) output that may be helpful:
# 0 0 34-08:49:31 00:51 swapper 0.02
UNIX95=EXTENDED_PS ps -e -opid= -ouid= -oetime= -otime= -opcpu= -ocomm= |
while read pid uid etime otime pcpu comm; do
# echo "$pid $pcpu" # debugging
pcpu=${pcpu%.*} # strip fractions
if [ $pcpu -ge 90 ]; then
echo "$pid is $pcpu %"
fi
done