Sar 用法
MEM%计算方法:
%actmemused=(kbmemused - kbbuffers - kbcached)/1024/MEM(M)*100
Here are files installed on Suse (RHEL is very similar, see below).
/etc/init.d/sysstat start/stop
[root@tempdb sysconfig]# cat /etc/cron.d/sysstat
# run system activity accounting tool every 10 minutes
#*/10 * * * * root /usr/lib64/sa/sa1 1 1
*/1 * * * * root /usr/lib64/sa/sa1 1 1
# generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib64/sa/sa2 -A
/etc/sysconfig/sysstat
# How long to keep log files (days), maximum is a month
HISTORY=7
http://www.softpanorama.org/Admin/Monitoring/Sar/linux_implementation_of_sar.shtml
tomcat jvm例子
JAVA_OPTS="$JAVA_OPTS -server -Xms1024M -Xmx1024M -Xmn128M -XX:PermSize=128M -XX:MaxPermSize=128M -XX:SurvivorRatio=65536 -XX:MaxTenuringThreshold=0 -Xnoclassgc -XX:+PrintHeapAtGC -Xloggc:gc.log -XX:+DisableExplicitGC -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled"
http://www.doc88.com/p-185434279239.html
Types of OutOfMemoryError in Java
1) Java.lang.OutOfMemoryError: Java heap space
2) Java.lang.OutOfMemoryError: PermGen space
http://javarevisited.blogspot.com/2011/09/javalangoutofmemoryerror-permgen-space.html
How to solve Java.lang.OutOfMemoryError: PermGen space
export JVM_ARGS="-Xmx1024m -XX:MaxPermSize=256m"
How to solve java.lang.OutOfMemoryError: Java heap space
export JVM_ARGS="-Xms1024m -Xmx1024m"
new loadtest server settings更新中...
1) 同步Server时间crontab(root用户)
crontab -l
0 8 * * * /usr/sbin/ntpdate 172.18.133.201 | mail -s "Time Sync of ydctest03" root
2) 设置sar
[root@ydcvml03 cron.d]# cat /etc/cron.d/sysstat
#run system activity accounting tool every 1 minutes
#*/10 * * * * root /usr/lib/sa/sa1 1 1
*/1 * * * * root /usr/local/lib/sa/sa1 1 1
# generate a daily summary of process accounting at 23:50
50 23 * * * root /usr/local/lib/sa/sa2 -A
3) 去消dummy job
[root@ydcvmapp02 ~]# crontab -l
#set a cronjob to run
#"/usr/bin/cancel -a XXXXX" every 10 min. where XXXXX is the print queue name
10 * * * * /usr/bin/cancel -a dummy