Know  about your System

When you start working for Middleware installation task on a Solaris/Linux or any other operating environment you must know about the Processor information. After everything going fine Servers are in running state then you will start thinking about how they are performing what is going to cause the issue for CPU spike some issues might demands that.

Here in this page we are going to illustrate few commands that helps you to identify facts about Processor and running processes and their outcomes will be considered for your best configuration and performances of your WebLogic/WebSphere/Jboss/Tcat servers.

1. Processor Information

You may need to know sometime about your middleware server existing running machine's CPU details, that might be one of the  following aspects:

1. CPU type

2. CPU Speed

3. CPU Architecture

4. Num of CPU

 

In Solaris, you cna use psrinfo command to know more about your Processors information.

[WLA@ur.server.com~]$ psrinfo -v

Status of virtual processor 0 as of: 11/13/2010 11:16:29

  on-line since 09/10/2010 11:13:26.

  The sparcv9 processor operates at 1200 MHz,

        and has a sparcv9 floating point processor.

... output truncated it will go on till the last processor detials

 

One more best command I prefer to use is uname -X, it is going to give clear information

[WLA@ur.server.com~]$ uname -X

System = SunOS

Node = ur.sever.com

Release = 5.10

KernelID = Generic_139555-08

Machine = sun4v

BusType = <unknown>

Serial = <unknown>

Users = <unknown>

OEM# = 0

Origin# = 1

NumCPU = 32

 

Operating System

 

$ uname

will give you the Operating System

 

OS Kernal  Release version is the important thing you need to consider. The latest stable version will less issues. So need to maintain the stable kernal versions in case of Linux.

 

$ uname -i

will give you the platform information

2. How do you know your system have a Oracle Database client installed? What is the Version of it?

Whenever such question arises for any auditing or capacity planning activities as a Administrator you need to check two things. First, you need to check sqlplus command is functioning or not. If it prompts for database username then it is also display the Oracle Client version installed on that Unix machine. Second, sometimes ORACLE_HOME may be not in the PATH. Verify this path from your DBA.Your DBA not available you can try type sqlplus or which sqlplus commands on your prompt.

Sample command run gives as follows:

$ sqlplus

 

SQL*Plus: Release 9.2.0.5.0 - Production on Wed Aug 24 23:54:53 2011 

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved. 

Enter user-name:

The UNIX command type will be giving you the location  of the file or Shell built-ins. The type command with option -a will give you all the paths where given executable file exists. Let us try the same for searching the path of sqlplus

$ type sqlplus

sqlplus is /opt/oracle/product/9.2.0/bin/sqlplus

The UNIX command which will gives you the path of the executable file. Sample command execution is as follows;

$ which sqlplus

/opt/oracle/product/9.2.0/bin/sqlplus

 

3. Process details.

To know what are the JVM arguments assigned for a running WebLogic Server or WebSphere or a Tomcat server you can use he useful commands in solaris to get the details of a running process.

pargs: Lists out all the arguments related to that particular process

           Syntax: pargs <pid>

Example: Let me try on a WebLogic instance

$ pargs 26145

26145:  /opt/Oracle/Middleware/11.1.1.5/jdk160_24/bin/java -server -Xms256m -Xmx5

argv[0]: /opt/Oracle/Middleware/11.1.1.5/jdk160_24/bin/java

argv[1]: -server

argv[2]: -Xms256m

argv[3]: -Xmx512m

argv[4]: -XX:MaxPermSize=128m

argv[5]: -Dweblogic.Name=WlAdminServer

argv[6]: -Djava.security.policy=/opt/Oracle/Middleware/11.1.1.5/wlserver_10.3/server/lib/weblogic.policy

argv[7]: -Dweblogic.ProductionModeEnabled=true

argv[8]: -da

argv[9]: -Dplatform.home=/opt/Oracle/Middleware/11.1.1.5/wlserver_10.3

argv[10]: -Dwls.home=/opt/Oracle/Middleware/11.1.1.5/wlserver_10.3/server

argv[11]: -Dweblogic.home=/opt/Oracle/Middleware/11.1.1.5/wlserver_10.3/server

argv[12]: -Dweblogic.management.discover=true

argv[13]: -Dwlw.iterativeDev=false

argv[14]: -Dwlw.testConsole=false

argv[15]: -Dwlw.logErrorsToConsole=false

argv[16]: -Dweblogic.ext.dirs=/opt/Oracle/Middleware/11.1.1.5/patch_wls1035/profiles/default/sysext_manifest_classpath:/opt/Oracle/Middleware/11.1.1.5/patch_ocp360/profiles/default/sysext_manifest_classpath

argv[17]: -Dweblogic.management.username=myAdminUser

argv[18]: -Dweblogic.management.password=secret

argv[19]: weblogic.Server

 

pfiles: This command lists out all the files associated with a running process.

    I use this command with the grep combination to know the port number associated with a process.

    Usage: pfiles <pid>

    Port number associated with a process:

    Let me try this on a weblogic instance to retrive the port number associated with a process

[MyWeblogicServer ~]$ pfiles 26672|grep sockname|grep 192.168.1.5

sockname: AF_INET 192.168.1.5  port: 7212

sockname: AF_INET 192.168.1.5  port: 7212 

 

jstack: This command will display the java stack trace of a process, It can also be used to take the thread dumps with redirections to a file.

 

jstack PID 1> FILENAME