当前位置:网站首页>Tongweb crawl performance log script
Tongweb crawl performance log script
2022-06-13 05:44:00 【t007321】
You can see from the previous article , In case of performance problems, in addition to opening TongWeb Monitoring function , You also need to manually execute a series of performance analysis commands to troubleshoot problems , because TongWeb The monitoring function of is not enough to analyze the problem . This manual operation is difficult for the project operation and maintenance personnel , Often eager to restore the system , restart TongWeb To solve . Here is a script , Try to crawl all logs once .
# This step is mainly aimed at performance problems , Not all log fetching commands are executed at one time , Even the problem of incomplete parameters .
# Put the script in TongWeb Of bin Under the table of contents , Execute the record once when slow occurs CPU,netstat, Handle ,jstack,kill -3,busy,jmap, If the execution error occurs, skip to continue the execution .
# If you do not have permission to execute under the classified aircraft , Through . ./slowlog.sh The way to carry out , Notice that there are spaces at two points .
# After the execution TongWeb Of logs The contents are packed and kept at the bottom .
# if JDK Incorrect environment variables , Remember to set PATH Variable . Want to have jstack、jmap、jstat Commands can't just be installed jre.
tongwebhome=`pwd`
export tongwebhome
tongpid=`ps -ef | grep java | grep $tongwebhome | awk '{print $2}'`
export tongpid
echo "execute top command"
top -H -b -d 3 -n 3 > ../logs/top`date +%Y%m%d%H%M`.log
echo "execute nestat command"
netstat -antlp > ../logs/netstat`date +%Y%m%d%H%M`.log
echo "execute lsof command"
lsof -p $tongpid > ../logs/lsof`date +%Y%m%d%H%M`.log
echo "execute jstat command"
jstat -gcutil $tongpid 1000 10 > ../logs/jstat`date +%Y%m%d%H%M`.log
echo "execute jstack command"
jstack $tongpid > ../logs/jstack`date +%Y%m%d%H%M`.log
echo "execute kill -3 command"
kill -3 $tongpid >/dev/null 2>&1
cp ../logs/jvm.log ../logs/jvm`date +%Y%m%d%H%M`.log
echo "execute thread-profiler.sh command"
./thread-profiler.sh -F -p $tongpid -c 500 -a ../logs/busy`date +%Y%m%d%H%M`.log 3 3 >/dev/null 2>&1
echo "execute jmap command"
jmap -histo $tongpid > ../logs/heap`date +%Y%m%d%H%M`.log
jmap -dump:live,format=b,file=../logs/heap`date +%Y%m%d%H%M`.bin $tongpid
echo "complete......... "边栏推荐
- High availability of Nacos series
- mongo
- Django uploads local binaries to the database filefield field
- Customer information management system - C language
- Float type value range
- Pyqt5 module
- Django uses redis to store sessions starting from 0
- Getclassloader() returns null, getclassloader() gets null
- Shell instance
- About Evaluation Metrics
猜你喜欢

Course outline of market drawing 1- basic knowledge

为什么那么多人讨厌A-Spice

Agile conflicts and benefits

Service fusing and degradation of Note Series

Case - traversing the directory (file class & recursive call)

20 flowable container (event sub process, things, sub process, pool and pool)

1 Introduction to drools rule engine (usage scenarios and advantages)

MySQL transactions and foreign keys

One of PowerShell optimizations: prompt beautification

A simple recursion problem of linked list
随机推荐
Working principle of sentinel series (source code analysis)
Use the browser to cut the entire page (take chrome as an example)
OpenGL Mosaic (8)
Etcd fast cluster building
Case - count the number of occurrences of each string in the string
Browser screenshot method (long screenshot, node screenshot, designated area screenshot)
Case - simulated landlords (primary version)
2021.9.30 learning log -postman
15 inclusivegateway and eventgateway of flowable gateway
How to Algorithm Evaluation Methods
Case - simulated landlords (upgraded version)
AUTOSAR实战教程pdf版
Celery understands
Hump naming and underlining
3. Postman easy to use
顶部下滑沉浸式dialog
Mysql database crud operation
Pyqt5 controls qpixmap, qlineedit qsplitter, qcombobox
About Evaluation Metrics
Cross compile HelloWorld with cmake