Vous êtes sur la page 1sur 22

How to increase the heap size other than admin console?

Go to C:\IBM_ND_6.0\WebSphere\AppServer\profiles\AppSrv01\config\cells\dmgrcell\nodes\
appnode\servers\server1\server.xml
Here you can find an entry like <jvmEntries xmi:id="JavaVirtualMachine_1359459476485"
verboseModeClass="false" verboseModeGarbageCollection="false" verboseModeJNI="false"
initialHeapSize="100" maximumHeapSize="200" runHProf="false" debugMode="false" debugArgs="-
Djava.compiler=NONE -Xdebug Xnoagent Xrunjdwp:transport =dt_socket,server =y,suspend=n ,
address=7777" disableJIT="false"/>
Here you can change initial and maximum heap size.

Maximum heap size?


For 32 bit the Max heap size is 2GB AND for 64 bit the Max heap size unlimited.

What is heap memory?


Objects storage space for objects references created at run time in a jvm is heap memory. Initial
Heap Size: 50 MB .Maximum Heap Size: 256 MB
Out of memory exception is there, how to handle that exception?
To increase heap memory size.

Increasing the WebSphere Application Server Node Agent Heap Size?


You might need to increase the WebSphere Application Server Node Agent heap size.

Procedure
1. Open the Integrated Solutions Console.
2. On the left-hand side, expand the System Administration heading and click Deployment
manager.
3. Click the name of the node agent that you want to modify.
4. Under Server Infrastructure, expand the Java and Process Management heading and
click Process Definition.
5. Under Additional properties, select Java Virtual Machine.
6. In the Maximum Heap Size text box, specify the new maximum heap size.
7. Click OK and save.
8. Restart the deployment manager for the changes to take effect.

Increasing the WebSphere Application Server Heap Size?

You might need to increase the WebSphere Application Server heap size.
Procedure
1. Open the Integrated Solutions Console.
2. On the left-hand side, expand the Servers heading and click Application servers.
3. Click the name of the WebSphere Application Server you want to modify.
4. Under Server Infrastructure, expand the Java and Process Management heading and
click Process Definition.
5. Under Additional properties, select Java Virtual Machine.
6. In the Maximum Heap Size text box, specify the new maximum heap size.
7. Click OK and save.
8. Restart the application server for the changes to take effect.

Increasing the WebSphere Application Server Node Agent Heap Size?

You might need to increase the WebSphere Application Server Node Agent heap size.
Procedure
1. Open the Integrated Solutions Console.
2. On the left-hand side, expand the System Administration heading and click Deployment
manager.
3. Click the name of the node agent that you want to modify.
4. Under Server Infrastructure, expand the Java and Process Management heading and
click Process Definition.
5. Under Additional properties, select Java Virtual Machine.
6. In the Maximum Heap Size text box, specify the new maximum heap size.
7. Click OK and save.
8. Restart the deployment manager for the changes to take effect.

If we give heap size value same for both min and max then what are the
advantages and what are the disadvantages?

The Java heap parameters influence the behaviour of garbage collection. Increasing the heap size
supports more object creation. Because a large heap takes longer to fill, the application runs longer
before a garbage collection occurs. However, a larger heap also takes longer to compact and causes
garbage collection to take longer.

The JVM has thresholds it uses to manage the JVM's storage. When the thresholds are
reached, the garbage collector gets invoked to free up unused storage. Therefore, garbage collection
can cause significant degradation of Java performance. Before changing the initial and maximum
heap sizes, you should consider the following information:

In the majority of cases you should set the maximum JVM heap size to value higher than the
initial JVM heap size. This allows for the JVM to operate efficiently during normal, steady state
periods within the confines of the initial heap but also to operate effectively during periods of high
transaction volume by expanding the heap up to the maximum JVM heap size.

In some rare cases where absolute optimal performance is required you might want to
specify the same value for both the initial and maximum heap size. This will eliminate some
overhead that occurs when the JVM needs to expand or contract the size of the JVM heap. Make
sure the region is large enough to hold the specified JVM heap.

Beware of making the Initial Heap Size too large. While a large heap size initially improves
performance by delaying garbage collection, a large heap size ultimately affects response time when
garbage collection eventually kicks in because the collection process takes more time.

What is the maximum heap size and how you are going to set maximum heap size?

1. For 32 bit the Max heap size is 2GB AND for 64 bit the Max heap size unlimited.
2. The Heap size assign for the particular server depends of requirement.
In general in work area we have to fallow Min heap 1024MB, Max heap 2048 MB.
How you going to configure these parameters to server.
Go to Server--> Java and Process Management --> Process Definition--> Java Virtual
Machine under this we have initial heap size and maximum heap size here we can give min
and max heap size and also here we can enable verbose garbage collection.

WebSphere Application Server offers valuable options for a fast and flexible Java application server
runtime environment and enhanced reliability and resiliency

OutOfMemory errors with WebSphere Portal:-


WebSphere Portal server might throw OutOfMemory (OOM) errors and might got hung and
unresponsive when serving or dowloading large documents through WCM (IBM Workplace Web
Content Management ) which are stored in PDM (Portal Document Manager). You might see the
following error in SystemErr.log and the JVM might have produced a heapdump,
[5/14/08 14:35:32:984 PDT] 00000086 ModuleManager E IWKCT1382X: Major exception caught:
com.presence.connect.business.module.ErrorExecutingRequestException: IWKMU1062X: Message:
IWKCT1366X: Exception caught servicing a Servlet request for PDMProxy, Cause:
java.lang.OutOfMemoryError
[5/14/08 14:35:32:985 PDT] 00000086 ModuleManager E IWKCT1383X: Unexpected error from
Module. Details of cause to follow:
[5/14/08 14:35:32:986 PDT] 00000086 ModuleManager E java.lang.OutOfMemoryError
at com.presence.connect.connector.content.ContentAPIConnection.getBytes
(ContentAPIConnection.java(CompiledCode))
at com.presence.connect.connector.content.ContentAPIConnection.getItemContents
(ContentAPIConnection.java:516)
at com.presence.connect.connector.content.ContentAPIConnector.getItemContents
(ContentAPIConnector.java:216)
at com.aptrix.pluto.resource.PDMResourceUtils.createPDMMime(PDMResourceUtils.java:632)
at com.aptrix.pluto.resource.PDMResourceUtils.getPDMData(PDMResourceUtils.java:419)
at com.aptrix.pluto.resource.PDMResourceServerModule.getResourceMime
(PDMResourceServerModule.java:968)
atcom.aptrix.pluto.resource.PDMResourceServerModule.buildResponse
(PDMResourceServerModule.java:516)
at com.presence.connect.RequestExecutable.execute(RequestExecutable.java:84)
at com.presence.connect.dispatcher.Task.run(Task.java:151)
at com.presence.connect.ConnectClient.processSynchronous(ConnectClient.java:167
at com.presence.connect.ConnectServlet.process(ConnectServlet.java:298)

In order to resolve the issue please apply the IBM recommended ifix PK66778 and tune the JVM
heap size, xloratio , pCluster & kCluster based on your application needs, expected load and the
optimum performance. IBM Monitoring and Diagnostic Tools for Java - Garbage Collection and
Memory Visualizer (GCMV) which is a part of IBM Support Assistant Tools can help you tune these
parameters based on the Garbage Collection logs history.

WSADMIN and OutOfMemory:


WSADMIN throws out of memory and generates heap dumps during the deployment using
python/jython scripts.
Problem
When deploying large files using wsadmin scripts, wsadmin throws out of memory error and
deployment fails. This issue has been observed while using our deployment automation scripts.
Resolution
WSADMIN creates it own JVM for running scripts and deployments and hence the JVM heap size for
the actual server will not come into picture.
The default value for WSADMIN JVM is 256MB.
To increase the maximum heap size for WSADMIN,
open the was_install_root/bin/wsadmin.sh file and look for PERFJAVAOPTION.
Change it to the following
PERFJAVAOPTION=-Xms512m -Xmx1024m -Xquickstart

And now retry the deployment.


If the deployment still fails with 'out of memory', then add the following option to the command
line while running the wsadmin scripts.
jvmMaxMemory="1024M"
This option will set the max heap size to 1GB.
Example: wsadmin.bat f deploy.py - jvmMaxMemory="1024M"

How to get JVM heap size/properties by using wsadmin utility?

1. Type below command from wsadmin prompt


wsadmin>$AdminTask showJVMProperties {-serverName server1 -nodeName myhostNode01}

Output:
{classpath {}} {bootClasspath {}} {verboseModeClass false} {verboseModeGarbageCollection false}
{verboseModeJNI false} {initialHeapSize 258} {maximumHeapSize 512} {runHProf false}
{hprofArguments {}} {debugMode false} {debugArgs -
agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777} {genericJvmArguments {}}
{executableJarFileName {}} {disableJIT false} {osName {}} {internalClassAccessMode ALLOW}
OR

2. Type below command from the OS prompt


[root@myhost bin] # ./wsadmin.sh -c '$AdminTask showJVMProperties {-serverName server1 -
nodeName
myhostNode01}'

Output:
Realm/Cell Name: <default>
Username: root
Password:
WASX7209I: Connected to process "dmgr" on node myhostCellManager01 using SOAP connector;
The type of process is: DeploymentManager

{classpath {}} {bootClasspath {}} {verboseModeClass false} {verboseModeGarbageCollection false}


{verboseModeJNI false} {initialHeapSize 258} {maximumHeapSize 512} {runHProf false}
{hprofArguments {}} {debugMode false} {debugArgs -
agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777} {genericJvmArguments {}}
{executableJarFileName {}} {disableJIT false} {osName {}} {internalClassAccessMode ALLOW}

OR

3. Type below command from the OS prompt


-------------------------------------
[root@myhost bin]# ./wsadmin.sh -c "\$AdminTask showJVMProperties {-serverName server1 -
nodeName
myhostNode01}"

Output
Realm/Cell Name: <default>
Username: root
Password:
WASX7209I: Connected to process "dmgr" on node
myhostCellManager01 using SOAP connector; The type of process is: DeploymentManager

{classpath {}} {bootClasspath {}} {verboseModeClass false} {verboseModeGarbageCollection false}


{verboseModeJNI false} {initialHeapSize 258} {maximumHeapSize 512} {runHProf false}
{hprofArguments {}} {debugMode false} {debugArgs -
agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777} {genericJvmArguments {}}
{executableJarFileName {}} {disableJIT false} {osName {}} {internalClassAccessMode ALLOW}

Note:- Kindly note that the difference between second and third command is only the
quotes,Commands inside a double quotes require \ prefix for $ symbol.

java -version -server from the jdk directory

1. What is the difference between Application Server and Portal Server ?


Application servers extend the ability of a Web server to handle Web application requests,
and enables a server to generate a dynamic, customized response to a client request. A
portal server extends the application server by providing a portlet container that can run
portlets and to create portal a website that provides users with a single point of access to
Web-based resources by aggregating those resources in one place.

2. What are the steps involved in deploying themes and skins in a clustered production
websphere portal environment ?

Export the WebSphere wps.ear (Portal EAR) using wsadmin.


Use EarExpander tool to expand the exported wps.ear file.
Copy the updated themes and skins into ../themes/html, ../skins/html folder.
Use EarExpander tool to collapse the EAR directory into an EAR file.
Use wsadmin to update the wps.ear to complete the deployment of updated themes and
skins.

3. What changes needs to be done to view changes to your theme and skins JSPs without
restarting the portal server ?

You need to enable automatic JSP loading by setting reloadingEnable property to true in
ibm-web-ext.xmi file of the wps.ear.

4. What are the 3 different ways of installing a portlet application in WebSphere Portal ?

Install a portlet using the portal administration page using Web Modules portlet.
Install a portlet using xmlaccess tool.
Pre-deploy a portlet as a standard EAR by installing the portlet WAR file in WAS console and
then registering the portlet using xmlaccess.

5. What is the purpose of XMLAccess configuration file Export.xml & ExportRelease.xml ? What
is the difference ? & When will you use one over the other ?

Export.xml exports the complete portal configuration and useful when transferring
configurations between development installations.
ExportRelease.xml exports the complete portal configuration from the release domain as
required by the portal ReleaseBuilder tool and useful when tranaferring different release
configurations between staging and production environments.

6. List me the steps involved in building a release in WebSphere Portal ?

If you have a completely new installation of the staging server and the production server:

Install the staging server, then install the production server.


Develop a release on the staging server.
Build the release on the staging server.
Empty portal contents on the production server by running the WPSconfig.sh|bat action-
empty-portal task.
Import that release onto the production server. Refer to Transferring a complete
configuration for information.

If you already have a production server without a staging system:

Export the release of your production server.


Install an empty staging server using one of the following two methods:
Install the staging server with the flag -W emptyPortal.active=True.
After installing and configuring the staging server, run the WPSconfig.sh|bat action-empty-
portal task.
Import the production release onto the staging server. Refer to Transferring a complete
configuration for information.
Develop and build a new release on the staging server.
Export that new release from the staging server.
Use ReleaseBuilder to generate the differential between the two releases.
Import the differential onto the production server.

7. What is the purpose of ReleaseBuilder tool in WebSphere Portal ?

ReleaseBuilder enables management of release configurations independent of user


configurations and used during staging of follow-on releases of WebSphere portals,
configurations, and artifacts need to be moved between systems.

8. What are the steps involved in editing WebSPhere Member Manager (wmm.xml) files on a
federated node ?

On the primary node of the WebSphere Portal cluster, check out the files using
./WPSconfig.sh check-out-wmm-cfg-files-from-dmgr task.
Make any changes to the Member Manager files. The files can be edited in the
portal_server_root/wmm directory on the WebSphere Portal node.
When you have completed your changes, check the files back in using ./WPSconfig.sh
check-in-wmm-cfg-files-to-dmgr.

9. How to change the default portal URI /wps/portal after installation ?

Set the property WpsContextRoot to the new URI and run ./WPSConfig.sh modify-servlet-
path task.

10. List different types of user registry supported by WebSphere Portal ?

LDAP (includes LDAP with an optional database user registry).


Database user registry.
Custom User registry, (non-LDAP, non-database).

11. What is LDAP realm support and why would I want to use it?

A Realm allows you to group users from one or more LDAP trees of one user registry and
expose them as a coherent user population to WebSphere Portal; this is also referred to as
horizontal partitioning. Realms allow a flexible user management with various configuration
options; for example, you can combine principals from one or more corporate LDAP tree. A
realm must be mapped to a Virtual Portal to allow the realm's defined user population to
login to the Virtual Portal.

12. What is an Application group and why would I want to use it ?

Application groups is a concept that allows you to define user groups within the database
user registry with members (users or groups) contained in the LDAP user registry you
configured. The benefit of application groups is that you can create Groups that are only
used in WebSphere Portal particularly in scenarios where there is Read-only LDAP or special
group setup specific to the portal.

13. What are the two methods to install the empty staging WebSphere portal server ?

Empty portal contents on the staging server by running the ./WPSconfig.sh action-empty-
portal.
Install portal with the ./install.sh -W emptyPortal.active="True" option.

14. How do you stop portal traffic to the node being upgraded in 24x7 cluster upgrade process ?

Locate the cluster member being upgraded, and change the value in the Configured weight
column from a value to zero and make sure the plugin config information is propagated to
webserver to stop traffic.

15. How to set limits on searches for users and groups ?

Setting a maximum number of search results maximumSearchResults="200"


in wmm.xml

16. What portal resources are scoped for virtual portal ?

Portal pages.
Portlet instances.
Portal Search Engine search services and search collections. This includes the search
content sources.

17. What portal resources can't be seperated for virual portal ?

Themes and skins.


Vault segments and vault slots.
Supported clients and markups.
Composite applications and templates.
Policies.

18. How do you enable temporary and extended trace logging for WebSphere Portal ?

Temporary traces can be set for a temporary period by using the administration portlet
Enable Tracing or the IBM WebSphere Application Server administrative console and also
using the Enable Tracing portlet in the portal administration page.

To enable extended trace settings for a longer period of time, that is, for more than one
session, switch them on in the WebSphere Application Server configuration, save the
updates and restart the portal server.

19. What are the different states of the syndication process ?

Idle: No syndication is occurring.


Pending: A request has been made to the syndicator, but it has yet to initiate a request to
the syndication application.
Queued: The syndicator has sent a request to the syndication application, but syndication is
not yet active.
Active: Syndication is occurring between the syndicator and subscriber.
Disabled: Syndication is currently disabled.

20. What are the two types of rendering portlets ?

Local rendering portlet and Remote rendering portlet.

To find the version of IBM JDK installed along with WebSphere


Application Server,

you can run java -fullversion to find the jdk version details

On Windows : run %WAS_HOME%\java\bin\java -fullversion (e.g)


c:\WebSphere\AppServer\java\bin\java -fullversion
On Unix : run $WAS_HOME/java/bin/java -fullversion (e.g)
/opt/WebSphere/AppServer/java/bin/java fullversion

Java Class finder with a UNIX command

Being a Java developer or Java based Application server administrator like WebSphere or WebLogic ,
i am sure you should have come across this exception " Error: java.lang.ClassNotFoundException "
which basically implies that the JVM is unable to find a definition for your class. It is usually resolved
by adding the jar file that contains the class to the classpath or packaging the jar file along with your
EAR or WAR file or placing the jar file in the right locations so that your Application Server
classloader can find and load the class . So inorder to indentify the .jar file where the class file is
present , the following simple UNIX command will help us to indentify the jar file and take
appropiate actions to resolve the issue .

LINUX:

find PATH -name '*.jar' -o -name '*.war' -o -name '*.ear' -type f |xargs -i bash -c "jar -tvf {}| tr / . |
grep CLASSNAME && echo {}"

(e.g)
find /usr/IBM/WebSphere/AppServer/ -name '*.jar' -o -name '*.war' -o -name '*.ear' -type f | xargs -
i bash -c "jar -tvf {}| tr / . | grep org.apache.xerces.dom.DocumentImpl.class && echo {}"

Output:

11160 Fri Feb 20 14:00:34 PST 2004 org.apache.xerces.dom.DocumentImpl.class


/usr/IBM/WebSphere/AppServer/archive_lib/xerces-2.6.2.jar
11160 Fri Oct 06 10:12:24 PDT 2006 org.apache.xerces.dom.DocumentImpl.class
/usr/IBM/WebSphere/AppServer/updateinstaller/update.jar

The above command will recursively search all the jar , EAR and WAR files under the
/usr/IBM/WebSphere/AppServer/ for the class name org.apache.xerces.dom.DocumentImpl.class
and output the location of the .jar file that contains the class.

Although this command is useful only in unix environment but there are other java based utilities to
find the same like Jar Class Finder , Java class finder, etc , but i find this command simple to use
without having to copy addtional jar files to your systems.

Posted by onewebclick at 10:48 AM 1 comments


Labels: class, class finder, jar, jar finder, java, java.lang.ClassNotFoundException, unix
Useful UNIX commands for WebSphere & Portal Administrator
These are some useful commands that i came across when administrating WebSphere Application
Server or WebSphere Portal Server. Note these commands are specifically written for LINUX but
most of them would for other UNIX platforms like Solaris, AIX and other flavours of LINUX like SUSE
or REDHAT.

Performance related Commands to monitor system performance


-------------------------------------------------------------------------
1) Find the process that uses most CPU
ps -eo pcpu,pid,user,args | sort -k 1 -r | head -2
(eg) output of the above command when websphere server process is utilizing the most of the CPU

%CPU PID USER COMMAND


71.7 31237 root /cust/IBM/WebSphere/AppServer/java/bin/java
-
Xbootclasspath/p:/cust/IBM/WebSphere/AppServer/java/jre/lib/ext/ibmorb.jar:/cust/IBM/WebSph
ere

/AppServer/java/jre/lib/ext/ibmext.jar
-Dwas.status.socket=54859 -classpath

/cust/IBM/WebSphere/AppServer/profiles/AppSrv02/properties:/cust/IBM/WebSphere/AppSer

2) Find the last 10 process that use the most CPU


ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10

%CPU PID USER COMMAND


2.1 6375 root /cust/IBM/WebSphere/AppServer/java/bin/java -
Xbootclasspath/p:/cust/IBM/WebSphere/AppServer/java/jre/lib/ext/ibmorb.jar:/cust/IBM/WebSph
ere/AppServer/java/jre/lib/ext/ibmext.jar -Dwas.status.socket=2132 -classpath
/cust/IBM/WebSphere/AppServer/profiles/AppSrv01/properties:/cust/IBM/WebSphere/AppServ
0.3 13886 root /cust/IBM/WebSphere/AppServer/java/bin/java -
Xbootclasspath/p:/cust/IBM/WebSphere/AppServer/java/jre/lib/ext/ibmorb.jar:/cust/IBM/WebSph
ere/AppServer/java/jre/lib/ext/ibmext.jar -Dwas.status.socket=25042 -classpath
/cust/IBM/WebSphere/AppServer/profiles/AppSrv01/properties:/cust/IBM/WebSphere/AppSer
0.2 17271 root /cust/IBM/WebSphere/AppServer/java/bin/java -
Xbootclasspath/p:/cust/IBM/WebSphere/AppServer/java/jre/lib/ext/ibmorb.jar:/cust/IBM/WebSph
ere/AppServer/java/jre/lib/ext/ibmext.jar -Dwas.status.socket=9606 -classpath
/cust/IBM/WebSphere/AppServer/profiles/AppSrv01/properties:/cust/IBM/WebSphere/AppServ
0.2 17871 root /cust/IBM/WebSphere/AppServer/java/bin/java -
Xbootclasspath/p:/cust/IBM/WebSphere/AppServer/java/jre/lib/ext/ibmorb.jar:/cust/IBM/WebSph
ere/AppServer/java/jre/lib/ext/ibmext.jar -Dwas.status.socket=9606 -classpath
/cust/IBM/WebSphere/AppServer/profiles/AppSrv01/properties:/cust/IBM/WebSphere/AppServ
0.2 17713 root /cust/IBM/WebSphere/AppServer/java/bin/java -
Xbootclasspath/p:/cust/IBM/WebSphere/AppServer/java/jre/lib/ext/ibmorb.jar:/cust/IBM/WebSph
ere/AppServer/java/jre/lib/ext/ibmext.jar -Dwas.status.socket=9140 -classpath
/cust/IBM/WebSphere/AppServer/profiles/AppSrv01/properties:/cust/IBM/WebSphere/AppServ
0.1 18499 root /cust/IBM/WebSphere/AppServer/java/bin/java -
Xbootclasspath/p:/cust/IBM/WebSphere/AppServer/java/jre/lib/ext/ibmorb.jar:/cust/IBM/WebSph
ere/AppServer/java/jre/lib/ext/ibmext.jar -Dwas.status.socket=11309 -classpath
/cust/IBM/WebSphere/AppServer/profiles/AppSrv01/properties:/cust/IBM/WebSphere/AppSer
0.1 17504 root /cust/IBM/WebSphere/AppServer/java/bin/java -
Xbootclasspath/p:/cust/IBM/WebSphere/AppServer/java/jre/lib/ext/ibmorb.jar:/cust/IBM/WebSph
ere/AppServer/java/jre/lib/ext/ibmext.jar -Dwas.status.socket=8969 -classpath
/cust/IBM/WebSphere/AppServer/profiles/Dmgr01/properties:/cust/IBM/WebSphere/AppServer

3)Find cpu usage


mpstat -P ALL or mpstat

Linux 2.4.21-27.ELsmp (machine1.www.com) 02/02/2008

11:55:00 AM CPU %user %nice %system %iowait %irq %soft %idle intr/s
11:55:00 AM all 1.51 0.00 0.41 0.04 0.01 0.09 97.94 184.92
11:55:00 AM 0 1.50 0.00 0.41 0.04 0.01 0.11 97.93 123.76
11:55:00 AM 1 1.51 0.00 0.42 0.04 0.00 0.07 97.95 61.16

4)Find CPU usage with the process listing in runtime and much more statistics in terms of memory,
virtual memory, etc.
top
12:00:20 up 118 days, 15:16, 2 users, load average: 0.07, 0.02, 0.00
572 processes: 570 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 2.7% 0.0% 1.1% 0.0% 0.0% 0.0% 95.9%
cpu00 1.9% 0.0% 0.3% 0.0% 0.0% 0.0% 97.6%
cpu01 3.5% 0.0% 1.9% 0.1% 0.0% 0.0% 94.2%
Mem: 11819592k av, 5088092k used, 6731500k free, 0k shrd, 295304k buff
3998132k active, 682312k inactive
Swap: 2048276k av, 0k used, 2048276k free 1258592k cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
17719 root 16 0 306M 306M 3992 S 0.7 2.6 22:14 1 java
19358 root 16 0 2532 2532 896 R 0.5 0.0 0:00 1 top
17771 root 15 0 306M 306M 3992 S 0.4 2.6 3:48 0 java
18058 root 16 0 458M 458M 4032 S 0.1 3.9 12:55 0 java
1 root 15 0 512 512 452 S 0.0 0.0 1:19 0 init
2 root RT 0 0 0 0 SW 0.0 0.0 0:00 0 migration/0

5)Continuous CPU usage monitoring and find the average CPU used.
a) sar -u 2 5
b) sar -o output.file 12 8 >/dev/null 2>&1 &
c) nohup sar -o output.file 12 8 >/dev/null 2>&1 &

Linux 2.4.21-27.ELsmp (machine1.web.com) 02/02/2008

12:04:34 PM CPU %user %nice %system %iowait %idle


12:04:36 PM all 0.25 0.00 0.00 0.00 99.75
12:04:38 PM all 0.00 0.00 0.50 0.25 99.25
12:04:40 PM all 7.00 0.00 7.25 0.00 85.75
12:04:42 PM all 21.05 0.00 1.50 0.00 77.44
12:04:44 PM all 3.00 0.00 0.50 0.00 96.50
Average: all 6.26 0.00 1.95 0.05 91.74

Disk Usage related Commands to monitor Disk space


--------------------------------------------------------
1)Disk Usage on all mounts
df -h -T

Filesystem Type Size Used Avail Use% Mounted on


/dev/sda1 ext3 2.9G 785M 2.0G 29% /
/dev/sda7 ext3 57G 9.3G 45G 18% /cust
/dev/sda6 ext3 2.0G 82M 1.8G 5% /lc
none tmpfs 5.7G 0 5.7G 0% /dev/shm
/dev/sda5 ext3 2.0G 33M 1.8G 2% /tmp
/dev/sda3 ext3 2.0G 64M 1.8G 4% /var

2)prints just one line with the total size of the directory, the below example show the size of the
/usr/IBM/Websphere WebSphere Portal Server directory.
du -ch | grep total

bash-2.05b# du -ch | grep total


6.3G total

Network related Commands


-------------------------------------
1)
a) dig (domain information groper) - is a flexible tool for interrogating DNS name servers.
b) nslookup - Queries a name server for a host or domain lookup.
c) host - DNS lookup uility.

The below example shows the information like CNAME , Aliases, ipaddres , etc about
www.google.com

a) dig <ip address or hostname>


bash-2.05b# dig www.google.com

; <<>> DiG 9.2.4 <<>> www.google.com


;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1088
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 7, ADDITIONAL: 0

;; QUESTION SECTION:
;www.google.com. IN A

;; ANSWER SECTION:
www.google.com. 585119 IN CNAME www.l.google.com.
www.l.google.com. 69 IN A 216.239.51.99
www.l.google.com. 69 IN A 216.239.51.104

;; AUTHORITY SECTION:
l.google.com. 60734 IN NS g.l.google.com.
l.google.com. 60734 IN NS b.l.google.com.
l.google.com. 60734 IN NS f.l.google.com.
l.google.com. 60734 IN NS c.l.google.com.
l.google.com. 60734 IN NS a.l.google.com.
l.google.com. 60734 IN NS e.l.google.com.
l.google.com. 60734 IN NS d.l.google.com.

;; Query time: 2 msec


;; SERVER: 10.5.50.184#53(10.5.50.184)
;; WHEN: Sun Feb 3 09:51:46 2008
;; MSG SIZE rcvd: 196

b) host <ip address or hostname>

bash-2.05b# host www.google.com


www.google.com is an alias for www.l.google.com.
www.l.google.com has address 216.239.51.104
www.l.google.com has address 216.239.51.99

c) nslookup <ip address or hostname>

bash-2.05b# nslookup www.google.com


Server: 10.5.50.184
Address: 10.5.50.184#53

Non-authoritative answer:
www.google.com canonical name = www.l.google.com.
Name: www.l.google.com
Address: 216.239.51.99
Name: www.l.google.com
Address: 216.239.51.104

2) List all network interfaces, the below example list two interfaces eth0 and eth1 and a loopback.

infconfig -a

bash-2.05b# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:11:43:32:49:99
inet addr:10.2.150.74 Bcast:10.5.50.127 Mask:255.255.255.192
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:357854361 errors:0 dropped:0 overruns:0 frame:0
TX packets:383621806 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3168219417 (3021.4 Mb) TX bytes:3724305382 (3551.7 Mb)
Interrupt:17

eth1 Link encap:Ethernet HWaddr 00:11:43:32:49:9A


inet addr:10.5.154.138 Bcast:10.5.54.127 Mask:255.255.255.128
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:18

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:92809439 errors:0 dropped:0 overruns:0 frame:0
TX packets:92809439 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1454141744 (1386.7 Mb) TX bytes:1454141744 (1386.7 Mb)

3) To find more information about a network interface, the below example shows detail information
about interface eth0.

bash-2.05b# ethtool eth0

Settings for eth0:


Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: Not reported
Advertised auto-negotiation: No
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: d
Wake-on: d
Link detected: yes

File related commands


----------------------
1) find text in the matching files and show the filename with the pattern. The below example shows
the list of filenames and the location of the hostname in those files, which will be helpful when
changing hostnames for your websphere installation.

find . -name '*.xml' -print | xargs grep 'hostName' /dev/null

bash-2.05b# find /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/config/ -name 'server*.xml' -


print | xargs grep 'hostName' /dev/null | more
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/portalserverCell01/nodes/portalser
verNode01/serverindex.xml:<serverindex:
ServerIndex xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:serverindex="http://www.ibm.com/websphere/appserver/schemas/5
.0/serverindex.xmi" xmi:id="ServerIndex_1" hostName="portalserver.example.com"
endPointRefs="NamedEndPoint_1130375480667 NamedE
ndPoint_1130375480668 NamedEndPoint_1130375480669 NamedEndPoint_1130375480670
NamedEndPoint_1130375480671 NamedEndPoint_113037548067
2 NamedEndPoint_1130375480673">
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/portalserverCell01/nodes/n2034in
dchn2.example.com/serverindex.xml:<
serverindex:ServerIndex xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:serverindex="http://www.ibm.com/websphere/appserv
er/schemas/5.0/serverindex.xmi" xmi:id="ServerIndex_1130386859873"
hostName="n2034indchn2.example.com">
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/portalserverCell01/nodes/n2033in
dchn2.example.com/serverindex.xml:<
serverindex:ServerIndex xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:serverindex="http://www.ibm.com/websphere/appserv
er/schemas/5.0/serverindex.xmi" xmi:id="ServerIndex_1130361145826"
hostName="n2033indchn2.example.com">
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/portalserverCell01/nodes/portalser
verCellManager01/serverindex.xml: <ser
verindex:ServerIndex xmi:id="ServerIndex_1" endPointRefs="NamedEndPoint_1 NamedEndPoint_2"
hostName="portalserver.example.com">
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/portalserverCell01/nodes/n2011in
dchn2Node01/serverindex.xml:<serverindex:
ServerIndex xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:serverindex="http://www.ibm.com/websphere/appserver/schemas/5
.0/serverindex.xmi" xmi:id="ServerIndex_1" hostName="n2011indchn2.example.com"
endPointRefs="NamedEndPoint_1130375717654 NamedE
ndPoint_1130375717655 NamedEndPoint_1130375717656 NamedEndPoint_1130375717657
NamedEndPoint_1130375717658 NamedEndPoint_113037571765
9 NamedEndPoint_1130375717660">
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/portalserverCell01/nodes/n2033in
dchn2UnNode01/serverindex.xml:<serverinde
x:ServerIndex xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:serverindex="http://www.ibm.com/websphere/appserver/schemas
/5.0/serverindex.xmi"
xmi:id="ServerIndex_1173388344070"hostName="n2033indchn2.example.com">
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/portalserverCell01/nodes/n2034in
dchn2UnNode01/serverindex.xml:<serverinde
x:ServerIndex xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:serverindex="http://www.ibm.com/websphere/appserver/schemas
/5.0/serverindex.xmi" xmi:id="ServerIndex_1173388421900"
hostName="n2034indchn2.example.com">
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/config/templates/servertypes/APPLICATION_SE
RVER/serverindex.xml:<serverindex:ServerI
ndex xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:serverindex="http://www.ibm.com/websphere/appserver/schemas/5.0/serv
erindex.xmi" xmi:id="ServerIndex_1" hostName="$(node.host.name)">
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/config/backup/base/cells/portalserverNode01C
ell/nodes/portalserverNode01/serverindex.x
ml:<serverindex:ServerIndex xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:serverindex="http://www.ibm.com/websphere/app
server/schemas/5.0/serverindex.xmi" xmi:id="ServerIndex_1"
hostName="portalserver.example.com">
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/config/backup/base/templates/servertypes/AP
PLICATION_SERVER/serverindex.xml:<serveri
ndex:ServerIndex xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:serverindex="http://www.ibm.com/websphere/appserver/sche
mas/5.0/serverindex.xmi" xmi:id="ServerIndex_1" hostName="$(node.host.name)">

2) Soemtimes you might run out of diskspace and want to clean up some files, so this command will
help you find all large files. In this example it will list all the files greater than 10 mb in size.

find / -xdev -size +1024 -exec ls -al {} \; | sort -r -k 5


bash-2.05b# find /usr/IBM/WebSphere -xdev -size +1024 -exec ls -al {} \; | sort -r -k 5-rw-r--r--
1 root root 1047553 Oct 26 2005
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/tranlog/n2110indch2Cell01/n2110indch2Node
01/n2110indch2_server1/transaction/tranlog/log1
-rw-r--r-- 1 root root 1047553 Oct 26 2005
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/tranlog/n2110indch2Cell01/n2110indch2Node
01/n2110indch2_server1/transaction/partnerlog/log2
-rw-r--r-- 1 root root 1047553 Oct 26 2005
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/tranlog/n2110indch2Cell01/n2110indch2Node
01/n2110indch2_server1/transaction/partnerlog/log1

3) When sending SystemOut.log or SystemErr.log or trace.log to your developers or to IBM support


Please use Tar and gzip on the fly to reduce the size of the file and the transfer time to FTP,email or
http upload.

To pack on the fly...


tar -cvf - FILE-LIST | gzip -c > FILE.tar.gz

To unpack on the fly..


gunzip < FILE.tar.gz | tar -xvf -

To pack on the fly and email the file to IBM Support


tar -cvf - SystemOut.log | gzip -c | uuencode SystemOut.tar.gz | mail -s "PMR 09921,227,000" -b
"SystemOut.log for server crash " WebSphere_Support@mainz.ibm.com

To find selective files and tar it up on the fly...


find /opt/IBM/WebSphere/PortalServer/log -name 'System*.log'| xargs tar -rvf System_logs.tar

4) Sometimes you might encounter a situation for example when running xmlaccess or wsadmin
where you might want to write stdout to the file as well as to the console so that you have a copy
even when the standard output disappears because of the screen buffer size.

ls -l | tee > filename


xmlaccess.sh -in ExportRelease.xml -username wpsadmin -password wpsadmin -url
http://localhost:9080/wps/config | tee filename
./wsadmin.sh | tee wsadmin.log
5) find files that is recently updated which might be useful to see what changes are made to the
system recently (e.g) below command shows the files that are modified within the last 20 minutes(-
mmin) and 20 days (-mtime)

find /usr/IBM -mmin -20


find /usr/IBM -mtime -20

/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/logs
/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/dmgr/SystemOut.log
/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/ffdc/dmgr_exception.log
/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/activity.log
/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/wstemp/events/eventbuffer0.ser
/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/wstemp/events/eventbuffer1.ser
/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/wstemp/events/eventbuffer2.ser
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/logs

6) Find a memory usage of the system.

free
cat /proc/meminfo

bash-2.05b# free
total used free shared buffers cached
Mem: 11819592 4938416 6881176 0 298148 1440200
-/+ buffers/cache: 3200068 8619524
Swap: 2048276 0 2048276
bash-2.05b# cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 12103262208 5056954368 7046307840 0 305303552 1474797568
Swap: 2097434624 0 2097434624
MemTotal: 11819592 kB
MemFree: 6881160 kB
MemShared: 0 kB
Buffers: 298148 kB
Cached: 1440232 kB
SwapCached: 0 kB
Active: 3718616 kB
ActiveAnon: 2968776 kB
ActiveCache: 749840 kB
Inact_dirty: 789328 kB
Inact_laundry: 237596 kB
Inact_clean: 0 kB
Inact_target: 949108 kB
HighTotal: 11140992 kB
HighFree: 6681628 kB
LowTotal: 678600 kB
LowFree: 199532 kB
SwapTotal: 2048276 kB
SwapFree: 2048276 kB
Committed_AS: 6039100 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 2048 kB

4) To repeat a command contimuously.

watch -d=10 -n 1 "netstat -a"

Every 1s: netstat -a| grep ESTABLISHED Sun Feb 3 21:48:04


2008

tcp 0 0 n1212indchn2.www.com:9900 n1312indchn2.www.com:11530 ESTABLISHED


tcp 0 0 n1212indchn2.www.com:9353 n1312indchn2.www.com:11549 ESTABLISHED
tcp 0 0 n1212indchn2.www.com:9354 n1312indchn2.www.com:11550 ESTABLISHED
tcp 0 0 n1212indchn2.www.com:9201 n1312indchn2.www.com:11544 ESTABLISHED
tcp 0 0 n1212indchn2.www.com:9352 n1312indchn2.www.com:11545 ESTABLISHED

igure 1. Example GC and Memory Visualizer display

Enabling verbose GC logging


You must enable verbose GC logging for your application if you want to produce logs for analysis. This can be
done with the -verbose:GC virtual machine (VM) flag or with the -XverboseGClog:file command for
IBM VMs with Version 5.0 and higher. Here, file is the name of your chosen log file. The -
XverboseGClog option is preferable when available. Verbose GC usually has relatively little performance
impact on an application.

Vous aimerez peut-être aussi