05-19-2008
Quote:
Originally Posted by
blakekr
I have a dedicated server running centos. It is "slightly managed" meaning I get a little help if I desperately need it; otherwise on my own.
Many of the programs on this server I've had to write myself (less than optimal code for sure). Others are commercial but some are renowned
resource hogs. I find lately that the load is well above 1.0 even during slow times, and I'd really like to find a way to start looking at server usage and hacking away at egregious wastes of resources. Obviously my trouble areas are apache and mysql.
Unfortunately the older I get the less technically adept I get at working from the command line without pretty graphs etc and seem to be figuring out next to nothing from things like ps -aux. If someone could recommend something simple I could start with to get a better picture of my server's usage, I would appreciate it. I'm sure all this has a technical name I could google further on but not sure what that would be.
Thanks!
I use a combination of top , ptree and sar to look at CPU hogs.
Top provides the pids of CPU intensive processes which works well with ptree to work out what they are doing.
Sar, google for ksar as a nice graphing tool, identifies times fo day to go investigate.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
1. If I want to check directory INPUT which files are not update within
5 minutes then move them to DATA1 directory
$ echo a > A.20060321.txt;echo b > B.20060321.txt;echo c > C.20060321.txt;
echo d > D.20060321.txt
$touch control_time; sleep 300
$find . ! -newer control_time -name "*.txt"... (1 Reply)
Discussion started by: sabercats
1 Replies
2. Gentoo
I am trying to write a small (and rather simple) script to gather some info about the system and piping it to dzen2
first, i want to explain some things.
I know i could have used conky, but my intention was to expand my knowledge of bash, pipes and redirections inside a script, and to have fun... (14 Replies)
Discussion started by: broli
14 Replies
3. UNIX for Dummies Questions & Answers
Hi There,
I'm trying to find a way to gather resource usage information (CPU, Memory & Virtual Memory) for a single process in a scripted way.
I've looked at vmstat & top but I can't figure out how to use them to get the information for a single process.
can any one help with this?
... (2 Replies)
Discussion started by: Murph
2 Replies
4. AIX
How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies
5. UNIX for Dummies Questions & Answers
Hi. First of all, would 4 or 5 websites, 1 ftp server (when downloading by someone or a few persons or one, concretize) and one mail server (not many emails, just to sound official and have a nice, spam-free email for myself). Websites with not that many, but some, later more visitors, quite... (0 Replies)
Discussion started by: newn
0 Replies
6. Linux
Hi,
I have just now started working with a company.
I am working on black screen and earlier I didn't knew whether it was unix or linux but today I searched google and found uname command and found that I am using Linux kernel :D .
As you all must've figured out that I am a real ultra newbie and... (5 Replies)
Discussion started by: csrohit
5 Replies
7. UNIX for Dummies Questions & Answers
Hi there,
I'm looking at learning about Red Hat, I am a beginner, can anyone point me in the direction of the best books/manuals to purchase? there are so many available at the moment.
Thanks in advance
PJ (4 Replies)
Discussion started by: Paul John
4 Replies
8. Solaris
Hello, I looking for becoming a Solaris system administrator. Background: I consider myself an entry-level Linux system administrator.
I don't know if I start my studies with Solaris 10 or 11. Maybe Solaris 11 because it's the new thing and the future, and Solaris 10 because since Solaris is... (2 Replies)
Discussion started by: albertoridolfi
2 Replies
9. Infrastructure Monitoring
I need to record min and max resources for RAM, & CPU for each command's execution in a shell script. Maybe going in details I would also be interested to capture plots with resource usage i.e.start to end of individual command with respect to time in a shell script.
Please share ideas. (0 Replies)
Discussion started by: vaibhavvsk
0 Replies
10. UNIX for Advanced & Expert Users
hello all,
on linux servers sometimes any of these resources (cpu,memory,disk) get a spike when you are not in front of the server.
the duration of these spikes might be 5 mins or even whole weekend.
my question is there a good way of capturing the events that caused these issues ( cpu or... (5 Replies)
Discussion started by: coolatt
5 Replies
LEARN ABOUT OPENDARWIN
ptree
ptree(1) ptree(1)
NAME
ptree - print process trees
SYNOPSIS
/usr/bin/ptree [-a] [-c] [-z zone] [pid | user] ...
ptree prints the process trees containing the specified pids or users, with child processes indented from their respective parent pro-
cesses. An argument of all digits is taken to be a process-id, otherwise it is assumed to be a user login name. The default is all pro-
cesses.
The following options are supported:
-a All. Print all processes, including children of process 0.
-c Contracts. Print process contract memberships in addition to parent-child relationships. See process(4). This option
implies the -a option.
-z zone Zones. Print only processes in the specified zone. Each zone ID can be specified as either a zone name or a numerical zone
ID.
This option is only useful when executed in the global zone.
The following operands are supported:
pid Process-id or a list of process-ids. ptree also accepts /proc/nnn as a process-id, so the shell expansion /proc/* can be
used to specify all processes in the system.
user Username or list of usernames. Processes whose effective user IDs match those given are displayed.
Example 1: Using ptree
The following example prints the process tree (including children of process 0) for processes which match the command name ssh:
$ ptree -a `pgrep ssh`
1 /sbin/init
100909 /usr/lib/ssh/sshd
569150 /usr/lib/ssh/sshd
569157 /usr/lib/ssh/sshd
569159 -ksh
569171 bash
569173 /bin/ksh
569193 bash
The following exit values are returned:
0 Successful operation.
non-zero An error has occurred.
/proc/* process files
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu |
+-----------------------------+-----------------------------+
|Interface Stability |See below. |
+-----------------------------+-----------------------------+
The human readable output is Unstable. The options are Evolving.
gcore(1), ldd(1), pargs(1), pgrep(1), pkill(1), plimit(1), pmap(1), preap(1), proc(1), ps(1), ppgsz(1), pwd(1), rlogin(1), time(1),
truss(1), wait(1), fcntl(2), fstat(2), setuid(2), dlopen(3C), signal.h(3HEAD), core(4), proc(4), process(4), attributes(5), zones(5)
11 Oct 2005 ptree(1)