WAS v8.5 > Reference > Commands (wsadmin scripting)wsadmin tool performance tips
Follow these tips to get the best performance from wsadmin.
The following performance tips are for wsadmin:
- When you launch a script using wsadmin, a new process is created with a new JVM API. If we use scripting with multiple wsadmin -c commands from a batch file or a shell script, these commands run slower than if we use a single wsadmin -f command. The -f option runs faster because only one process and JVM API are created for installation and the Java classes for the installation load only once.
The following example, illustrates running multiple application installation commands from a batch file.
On a Unix operating system, if you invoke a command that includes a dollar sign character ($) using the wsadmin -c option, the command line attempts to substitute a variable. To avoid this problem, escape the dollar sign character with a backslash character (\). For example: wsadmin -c "\$AdminApp install ...".
Jacl:
wsadmin -c "$AdminApp install c:/myApps/App1.ear {-appname appl1}" wsadmin -c "$AdminApp install c:/myApps/App2.ear {-appname appl2}" wsadmin -c "$AdminApp install c:/myApps/App3.ear {-appname appl3}"Jython:
wsadmin -lang jython -c "AdminApp.install('c:/myApps/App1.ear', '[-appname appl1]')" wsadmin -lang jython -c "AdminApp.install('c:/myApps/App2.ear', '[-appname appl2]')" wsadmin -lang jython -c "AdminApp.install('c:/myApps/App3.ear', '[-appname appl3]')"Or, for example, using Jacl, we can create the appinst.jacl file containing the commands:
$AdminApp install c:/myApps/App1.ear {-appname appl1} $AdminApp install c:/myApps/App2.ear {-appname appl2} $AdminApp install c:/myApps/App3.ear {-appname appl3}Invoke this file using the following command: wsadmin -f appinst.jacl
Or using Jython, we can create the appinst.py file, containing the commands:
AdminApp.install('c:/myApps/App1.ear', '[-appname appl1]') AdminApp.install('c:/myApps/App2.ear', '[-appname appl2]') AdminApp.install('c:/myApps/App3.ear', '[-appname appl3]')Then invoke this file using the following command: wsadmin -lang jython -f appinst.py.
- Use the AdminControl queryNames and completeObjectName commands carefully with a large installation. For example, if only a few beans exist on a single machine, the $AdminControl queryNames * command performs well.
- The WebSphere Application Server is a distributed system, and scripts perform better if you minimize remote requests. If some action or interrogation is required on several items, for example, servers, it is more efficient to obtain the list of items once and iterate locally. This procedure applies to the actions the AdminControl object performs on running MBeans, and actions the AdminConfig object performs on configuration objects.
Related
Use wsadmin scripting
Reference:
wsadmin scripting tool