Showing posts with label Performance. Show all posts
Showing posts with label Performance. Show all posts

6/16/14

truncate live file

How to truncate a live log file? 
Some situations force us to truncate live log file.
Simple way to truncate a live log file is -
as the owner of the file
> logfilename

this truncates the log

Thread Dumps

Aften as process admin, we need to take thread dump.
Thread dump gives you what the jvm threads are doing, what are their status and so on info.

1. WebSphere
We can take WebSphere JVM thread by using this command
kill -3 jvmpid

This generates thread dump, by default dumps the threads to jvm/logs/jvmname/natviestdout
You can configure the jvm to generate generate file in your configured path.
2. Tomcat
/path/to/jdk/bin/jstack -l pid > nameoffile.log
You need to take thread dump as the owner of the pid. Better to use the same jdk as tomcat. As the owner of tomcat, you can say "which java" or ps -ef | grep -i java gives which java tomcat process pointed to.

3. WebLogic
kill -3 or jstack can be used.

[There are several ways. These are few]

1/10/13

java core dump

Java Core Dump

Download the file windows_hang.py and copy the file to your <PROFILE_ROOT>\bin directory. If instead copied to <WAS_HOME>\bin, the default server, which may be the deployment manger (dmgr), will be accessed when wsadmin.bat is launched.


NOTE: This script only works for WebSphere Application Server 6.1 and higher.


If you are looking for the older windows_hang.bat that works with older releases of WebSphere Application Server, see the FAQ section.


To launch the script to produce 3 javacores spaced 2 minutes apart, run this command:

wsadmin -lang jython -f windows_hang.py -j -s SERVER_NAME

Replacing SERVER_NAME with your server's name.

If you have to run this number of times, on windows, you can write a batch file and run the batch file as Administrator.

<WAS_HOME>\profiles\<PROFILE_NAME>\bin\wsadmin -lang jython -username <username> -password <password> -f \<path_to_windows_hang.py>\windows_hang.py -j -s SERVER_NAME

ex.,
\"Program Files"\ibm\WebSphere\AppServer\profiles\AppSrv01\bin\wsadmin -lang jython -username blahblah -password blahblah -f \users\bramaraju\desktop\windows_hang.py -j -s server01

http://www-01.ibm.com/support/docview.wss?uid=swg21111364