Help creating a timestamp script to record mem usage


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help creating a timestamp script to record mem usage
# 1  
Old 06-29-2012
Help creating a timestamp script to record mem usage

Hi,

I'm looking into doing a few performance tweaks by adjusting my max memory on a few lpars.

I would to create a time stamp script so i could review it for a week and determine how much space i can lower my max memory to so i could reclaim and allocate that memory to where it is needed the most.

I know the command I need is
Code:
svmon -P -v -t 10 | more

I am not sure how to create a timestamp in ksh. I've tried a few things but not working.

Basically I want to capture my real memory usage every hour... I will create my cronjob to run it every hour on the hour, I also need it output to a file.

Your help is greatly appreciated!

Thanks in advance!
# 2  
Old 06-29-2012
Code:
(echo "\n" ;date; echo "\n") >svmon-P-v-t20.out
 svmon -P -v -t 10 >>svmon-P-v-t20.out 
#
more svmon-P-v-t20.out


Fri Jun 29 17:26:12 DFT 2012


-------------------------------------------------------------------------------
     Pid Command          Inuse      Pin     Pgsp  Virtual 64-bit Mthrd  16MB
 1491100 svmon            41250     7232       49    41192      Y     N     N

     PageSize                Inuse        Pin       Pgsp    Virtual
     s    4 KB                3074          0         49       3016
     m   64 KB                2386        452          0       2386

    Vsid      Esid Type Description              PSize  Inuse   Pin Pgsp Virtual
  188060  90000000 work fork tree                    m   1897     0    0    1897
                   children=5a74d0, 0
    8002         0 work fork tree                    m    484   449    0     484
                   children=802760, 0
   14005  9ffffffd work fork tree                   sm   1775     0   34    1807
                   children=7f12a0, 0
   a532d  90020014 work shared library               s    835     0   13     837
   8262a        11 work text data BSS heap          sm    152     0    0     152
   3000c  9ffffffe work fork tree                   sm    151     0    2     151
                   children=5a8fb0, 0
   7ce95 f00000002 work process private              m      5     3    0       5
   d273d  9001000a work shared library data         sm     45     0    0      45
   3d785  80020014 work USLA heap                   sm     16     0    0      16
   61611  8fffffff work private load data            s      5     0    0       5
...

This User Gave Thanks to vbe For This Post:
# 3  
Old 06-29-2012
Just to make sure too, if you're going to run it hourly you want to change the date to append instead of replace. Your output file will be a little short otherwise. Smilie

Quote:
Originally Posted by vbe
Code:
(echo "\n" ;date; echo "\n") >svmon-P-v-t20.out
 svmon -P -v -t 10 >>svmon-P-v-t20.out

Code:
(echo "\n" ;date; echo "\n") >>svmon-P-v-t20.out
 svmon -P -v -t 10 >>svmon-P-v-t20.out

This User Gave Thanks to jtollefson For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to record max memory usage of program

Hello, I am working on an application that uses allot of memory depending on the input. I am also working on more than one processing algorithm. The program has a long processing time (hours) so it would be nice to be able to monitor the maximum memory footprint of the application during runs... (1 Reply)
Discussion started by: LMHmedchem
1 Replies

2. Shell Programming and Scripting

Extract timestamp from first record in xml file and it checks if not it will replace first record

I have test.xml <emp><id>101</id><name>AAA</name><date>06/06/14 1811</date></emp> <Join><id>101</id><city>london</city><date>06/06/14 2011</date></join> <Join><id>101</id><city>new york</city><date>06/06/14 1811</date></join> <Join><id>101</id><city>sydney</city><date>06/06/14... (2 Replies)
Discussion started by: vsraju
2 Replies

3. Shell Programming and Scripting

Creating repeating record in between file through script

apprecieate your help to resove this. My source file looke like 1001 000 HEADER 1001 001 RAJESH 1001 002 100 1001 002 200 1001 002 500 1001 006 FOOTER 1002 000 HEADER 1002 001 RAMESH 1002 002 100 1002 002 200 1002 002 500 1002 006 FOOTER my... (8 Replies)
Discussion started by: Ganesh L
8 Replies

4. UNIX for Dummies Questions & Answers

Creating a function for timestamp in shell script

I have the following code for installing a BSD application stack: #!/bin/sh # install dos2unix and unix2dos utilities echo `date "+%Y-%m-%d %H:%M:%S"` "unix2dos and dos2unix: installing..." >> ~/post_install.log pkg_add -r unix2dos # install xfce4 desktop environment echo `date "+%Y-%m-%d... (3 Replies)
Discussion started by: figaro
3 Replies

5. UNIX for Advanced & Expert Users

Checking mem usage at specific times in a program

Hi all, I'm running a simulator and I'm noticing an slow increase in memory for long simulations such that the simulation has to end because of a lack of memory. A colleague of mine ran Valgrind memcheck and reported that nothing of interest was reported other than known mem leaks. My advisor... (2 Replies)
Discussion started by: pl4u
2 Replies

6. Gentoo

cpu%/mem% usage, scripting, dzen2: howto learn bash the hard way

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

7. UNIX for Dummies Questions & Answers

Creating new file with new record length

Hi there, using the command below > cat file1 | tr "\001" " " > tmp2 how can I alter the record length of tmp2 to fix length of 350 bytes ? Thanks a lot! (7 Replies)
Discussion started by: mrjunsy
7 Replies

8. Linux

Linux Mem Usage

What is amount of free RAM i have now? total used free shared buffers cached Mem: 1010 963 46 0 215 256 -/+ buffers/cache: 491 518 Swap: 1983 0 1983 Above is the output of... (1 Reply)
Discussion started by: new2ss
1 Replies

9. UNIX for Dummies Questions & Answers

Difference in Mem usage ?

Hi All, I have a pair of sun ultra 5_10 with SunOS 5.5.1. Both are almost equally patched and set up with simillar applications. host# uname -a SunOS host 5.5.1 Generic_103640-24 sun4u sparc SUNW,Ultra-5_10 Even though both have same amount of RAM ( 512 Mb ) , ... (1 Reply)
Discussion started by: shibz
1 Replies

10. Shell Programming and Scripting

Creating file with date/timestamp in it

I need to create a file through a c-shell script which contains only the date and time that the file was created. Does anyone know a simple way to do this? Thank you, Paula (7 Replies)
Discussion started by: ccpjr29
7 Replies
Login or Register to Ask a Question