Wasted time is time spent on activities whose purpose is to support test analysis, but would never be performed by a browser user, for example, time spent keeping transaction statistics for later reporting. Wasted time is calculated internally by LoadRunner. Your script can also add wasted time with lr_wasted_time.
Sometimes, you may enter activities in a script that your do not want reported as part of the transaction statistics. Generally, these are activities related to record keeping, logging, or custom analysis. If you enhance the script with steps whose durations should not be included in the test statistics, you can track the time used by these steps with lr_start_timer and lr_end_timer. Then, the function lr_wasted_time is used for adding this user-determined time to the internally generated wasted time.
You can retrieve the total wasted time (both that generated by LoadRunner automatically and that added with lr_wasted_time) with the function lr_get_transaction_wasted_time, or with lr_get_trans_instance_wasted_time, as appropriate.
When VuGen creates the log file, output.txt, and when on line testing generates the Vuser log files, no action is taken with the wasted time. The actual elapsed transaction times are reported. The lr_get_transaction_duration function also returns the actual elapsed transaction time. This information may be useful in analyzing and developing test scripts.
However, in the on-line graphs in the LoadRunner Controller and the transaction response time graphs in the LoadRunner Analysis, the transaction times are reported after subtracting the wasted time. This is the time most pertinent to understanding the system being tested.
Labels
- Apache (10)
- Articles (4)
- BPM Tools (5)
- Glassfish (16)
- Hadoop (10)
- HP ALM (6)
- HP SOA Systinet (14)
- Issues (19)
- JAVA (85)
- JBoss (16)
- jQuery (4)
- Load Runner (37)
- Quality Center (49)
- Testing (24)
- Tips and Tricks (16)
- Tomcat (4)
- Usefull Links (18)
- Weblogic (41)
- WebSphere (2)
Tuesday, July 3, 2012
what is Wasted Time in LoadRunner ?
What are the HP LoadRunner 11.0 Features
HP LoadRunner for the Windows operating system Software version: 11.00
Publication date: October 2010
What's New
Protocols
Ajax TruClient - An advanced protocol for modern JavaScript based applications (including Ajax) emulating user activity within a web browser. Scripts are developed interactively in Mozilla Firefox.
Silverlight - A new protocol for Silverlight based applications emulating user activity at the transport level. Allows generating high level scripts by automatically importing and configuring WSDL files used by the application.
Java over HTTP - A new protocol designed to record java-based applications and applets. It produces a Java language script using web functions. This protocol is distinguished from other Java protocols in that it can record and replay Java remote calls over HTTP.
Citrix
The Citrix Protocol now supports Citrix Online Plugin versions 11.2 and 12.0.
Added support for Citrix XenApp Server 5.0
Oracle NCA - NCA Java object property support now provides automated creation and registration within a script of a query-answer table of communication between client-side Java objects and the Oracle NCA server.
SAPGUI - Added support for SAPGUI for Windows Client version 7.20..
Service Test - The LoadRunner Controller can run scripts created in HP Service Test 11.00, HP's solution for creating and running automated tests for SOA and headless technologies. Refer to the Service Test documentation for details of creating Service Test scripts for a load testing scenario.
FeaturesData Format Extension (DFE) - Enhanced data format capabilities for the Web (HTTP/HTML) protocol family. Allows converting raw HTTP traffic into a maintainable and structured XML format and enables correlations by XPATH.
Correlation Studio - Web (HTTP/HTML) automatic correlation mechanism has been enhanced to search for possible correlations in the larger scope of snapshot data created during code generation including data formatted by DFE.
Snapshot View - New snapshot view for Web (HTTP/HTML) protocol steps allows viewing complete HTTP traffic in both raw and DFE generated formats.
VuGen - HP ALM Integration - Enhanced integration with HP Application Lifecycle Management platform that serves also Quality Center and Performance Center editions..
Windows Support - Added support for Windows 7 and Windows Server 2008. See below for limitations. Analysis Reports - Enhanced Analysis reports are more customizable. Analysis data can be exported to a variety of formats, including Word, Excel, PDF, and HTML. New report templates allow saving report definitions and generating reports based on a template.
LIMITATIONS:-
VuGen
SAP (Click and Script) recording. During recording, if you use a keyboard option instead of a UI element (for example, pressing Enter instead of clicking the log on button), the step may not be recorded. In general, when recording your script, it is recommended to use UI elements rather than keyboard options.
Citrix snapshots. Black snapshots may appear during record or replay when using Citrix Presentation Server 4.0 and 4.5 (before Rollup Pack 3).
Possible workaround: On the Citrix server select Start Menu > Settings > Control Panel > Administrative Tools > Terminal Services Configuration > Server Settings > Licensing and change the setting Per User or Per Device to the alternative setting (ie If it is set to Per User , change it to Per Device and vice versa.)
Recording Window Size and XenApp Plugin for Hosted Applications 11. The recording window size options does not work properly with the XenApp Plugin for Hosted Applications 11. The size of the client window is installed, but the server screen resolution is not. This is a Citrix Client bug and will be fixed in future Citrix Client versions.
Workaround: When recording, set the window size equal to the local screen resolution. When replaying/load testing, set the VuGen or Load Generator's screen resolution to equal the resolution used when the script was recorded.
-->For the following protocols, replay is supported but recording is no longer supported: Siebel DB2, Siebel MSSQL, Siebel Oracle, and Voice XML.
-->In Test Result reports , you can only use the Export to HTML file utility for scripts replayed in version 9.50 and later. To generate an HTML report for scripts created with earlier versions, run the script again in the 9.50 version (or later) of the product.
-->If you terminated the Protocol Advisor immediately after the detection process started, the Protocol Advisor may leave a zombie process of the detected application, causing all recordings and detection sessions that follow to fail. Workaround: Manually terminate the zombie process.
-->The new Web snapshot model is backward compatible with previous versions of LoadRunner, however some snapshot data may be missing. If this occurs, regenerate the script.
-->The JSON Data Format Extension does not work in UNIX environments.
-->Recording a network based application on Windows 7. To record a network-based application (including Web), IPv6 communication must be disabled. Follow the instructions in http://www.addictivetips.com/windows-tips/how-to-disable-ipv6-in-windows-7/ to disable IPv6 in Windows 7.
-->For protocols using XML, replay fails to create a request when a parameterized input argument contains the ampersand (&) character.
Correlation Studio
In VuGen, when correlating large amount of snapshot data, in some cases the parameter is not created and data is not correlated.
Scan for correlation will work on a script that was regenerated and replayed with the early access version.
Publication date: October 2010
What's New
Protocols
Ajax TruClient - An advanced protocol for modern JavaScript based applications (including Ajax) emulating user activity within a web browser. Scripts are developed interactively in Mozilla Firefox.
Silverlight - A new protocol for Silverlight based applications emulating user activity at the transport level. Allows generating high level scripts by automatically importing and configuring WSDL files used by the application.
Java over HTTP - A new protocol designed to record java-based applications and applets. It produces a Java language script using web functions. This protocol is distinguished from other Java protocols in that it can record and replay Java remote calls over HTTP.
Citrix
The Citrix Protocol now supports Citrix Online Plugin versions 11.2 and 12.0.
Added support for Citrix XenApp Server 5.0
Oracle NCA - NCA Java object property support now provides automated creation and registration within a script of a query-answer table of communication between client-side Java objects and the Oracle NCA server.
SAPGUI - Added support for SAPGUI for Windows Client version 7.20..
Service Test - The LoadRunner Controller can run scripts created in HP Service Test 11.00, HP's solution for creating and running automated tests for SOA and headless technologies. Refer to the Service Test documentation for details of creating Service Test scripts for a load testing scenario.
FeaturesData Format Extension (DFE) - Enhanced data format capabilities for the Web (HTTP/HTML) protocol family. Allows converting raw HTTP traffic into a maintainable and structured XML format and enables correlations by XPATH.
Correlation Studio - Web (HTTP/HTML) automatic correlation mechanism has been enhanced to search for possible correlations in the larger scope of snapshot data created during code generation including data formatted by DFE.
Snapshot View - New snapshot view for Web (HTTP/HTML) protocol steps allows viewing complete HTTP traffic in both raw and DFE generated formats.
VuGen - HP ALM Integration - Enhanced integration with HP Application Lifecycle Management platform that serves also Quality Center and Performance Center editions..
Windows Support - Added support for Windows 7 and Windows Server 2008. See below for limitations. Analysis Reports - Enhanced Analysis reports are more customizable. Analysis data can be exported to a variety of formats, including Word, Excel, PDF, and HTML. New report templates allow saving report definitions and generating reports based on a template.
LIMITATIONS:-
VuGen
SAP (Click and Script) recording. During recording, if you use a keyboard option instead of a UI element (for example, pressing Enter instead of clicking the log on button), the step may not be recorded. In general, when recording your script, it is recommended to use UI elements rather than keyboard options.
Citrix snapshots. Black snapshots may appear during record or replay when using Citrix Presentation Server 4.0 and 4.5 (before Rollup Pack 3).
Possible workaround: On the Citrix server select Start Menu > Settings > Control Panel > Administrative Tools > Terminal Services Configuration > Server Settings > Licensing and change the setting Per User or Per Device to the alternative setting (ie If it is set to Per User , change it to Per Device and vice versa.)
Recording Window Size and XenApp Plugin for Hosted Applications 11. The recording window size options does not work properly with the XenApp Plugin for Hosted Applications 11. The size of the client window is installed, but the server screen resolution is not. This is a Citrix Client bug and will be fixed in future Citrix Client versions.
Workaround: When recording, set the window size equal to the local screen resolution. When replaying/load testing, set the VuGen or Load Generator's screen resolution to equal the resolution used when the script was recorded.
-->For the following protocols, replay is supported but recording is no longer supported: Siebel DB2, Siebel MSSQL, Siebel Oracle, and Voice XML.
-->In Test Result reports , you can only use the Export to HTML file utility for scripts replayed in version 9.50 and later. To generate an HTML report for scripts created with earlier versions, run the script again in the 9.50 version (or later) of the product.
-->If you terminated the Protocol Advisor immediately after the detection process started, the Protocol Advisor may leave a zombie process of the detected application, causing all recordings and detection sessions that follow to fail. Workaround: Manually terminate the zombie process.
-->The new Web snapshot model is backward compatible with previous versions of LoadRunner, however some snapshot data may be missing. If this occurs, regenerate the script.
-->The JSON Data Format Extension does not work in UNIX environments.
-->Recording a network based application on Windows 7. To record a network-based application (including Web), IPv6 communication must be disabled. Follow the instructions in http://www.addictivetips.com/windows-tips/how-to-disable-ipv6-in-windows-7/ to disable IPv6 in Windows 7.
-->For protocols using XML, replay fails to create a request when a parameterized input argument contains the ampersand (&) character.
Correlation Studio
In VuGen, when correlating large amount of snapshot data, in some cases the parameter is not created and data is not correlated.
Scan for correlation will work on a script that was regenerated and replayed with the early access version.
When an application server should be used?
You should consider an application server when you have a need for:
- Integration with existing systems and databases
- Website support
- E-Commerce
- Web-integrated collaboration
- Component re-use
Application server definition ?
An application server is a component-based product that resides in the middle-tier of a server centric architecture. It provides middleware services for security and state maintenance, along with data access and persistence.
Java application servers are based on the Java™ 2 Platform, Enterprise Edition (J2EE™). J2EE uses a multi-tier distributed model. This model generally includes a Client Tier, a Middle Tier, and an EIS Tier. The Client Tier can be one or more applications or browsers. The J2EE Platform is in the Middle Tier and consists of a Web Server and an EJB Server. (These servers are also called "containers.") There can be additional sub-tiers in the middle tier. The Enterprise Information System (EIS) tier has the existing applications, files, and databases.
For the storage of business data, the J2EE platform requires a database that is accessible through the JDBC, SQLJ, or JDO API. The database may be accessible from web components, enterprise beans, and application client components. The database need not be accessible from applets.
See the related content links below for more information.
Java application servers are based on the Java™ 2 Platform, Enterprise Edition (J2EE™). J2EE uses a multi-tier distributed model. This model generally includes a Client Tier, a Middle Tier, and an EIS Tier. The Client Tier can be one or more applications or browsers. The J2EE Platform is in the Middle Tier and consists of a Web Server and an EJB Server. (These servers are also called "containers.") There can be additional sub-tiers in the middle tier. The Enterprise Information System (EIS) tier has the existing applications, files, and databases.
For the storage of business data, the J2EE platform requires a database that is accessible through the JDBC, SQLJ, or JDO API. The database may be accessible from web components, enterprise beans, and application client components. The database need not be accessible from applets.
See the related content links below for more information.
what are the Best Practices for WebLogic Environment?
1. Dedicated Users per installation
Oracle WebLogic installation on Solaris machine or Linux or a Windows machine better to have a dedicated user where you can install the WebLogic components. provide access to all other users so that no need of reinstalling required for each new domain on the same machine.
Remember that, You can run this command if you have root user access only
2. Using of sed
When I worked for WebLogic 9.2 migration for each instance wise configuring fresh properties updating took me around a week time for whole environment. This time WebLogic 11g migration I have an idea to use stream editing option, and apply proper regular expressions to finish my task. It worked for me awesome, whole updating done in half hour with small script that included sed in a for loop. I had to change multiple lines search and replace in multiple files in the same machine, so I took the above said trick it worked and saved my time.
User per domain: If you are preparing a development environment then you can choose a user per domain it is the best way to avoid conflicts between developers code changes etc. Install new Oracle License and keep always a backup of old License.
About Virtual IP issues.
WebLogic Server instance each one can generate separate server side logs as well as application logs. Most of the developers while troubleshooting an issue they must know from which server it was happening for this log4j provides more flexibility to digg/debug every Java package, class level, even method, line level too.
How to collect it?
To make this possible you need to enable your WebLogic server library path must pick the log4j-1.2.8.jar and the logging definitions in a separate file lets say it as log4j.properties file.
Where to set?
Before weblogic.jar path or after? Oracle recommands application related jars and third-party jars must be set after weblogic.jar.
Sample Example:
4. Scalability for Domain
Adding servers to or removing servers existing Cluster is nothing but scalability. While defining new Cluster identify proper multi-cast address suitable to your environment with multi-cast test. You must use Interface Address as the DNS/IP of the machine where the instance is configured in each server's Cluster tab. This will make you easy to run the clustered environment.
5. Effort saving means cost saving
While preparing your configuration keep focus on portable coding. I have been to many UNIX forums to find portable and flexible scripting. Here I am sharing for you. Efforts can be focused on the following things
i. Customized start script for admin server,
ii. Customized start script for managed server
The following start script save it as "startMserver.sh" assuming that you might need few instance specific properties need to refer in startWebLogic.sh script.
Here $INST_HOME is defined in the user profile script.
These customized start scripts for admin server and managed servers. In the script make a copy of the last server instance log to instance.out_bkp. Some times due to some panic situations servers might crashed, after monitoring you found that it happen so restarting server should not loss that lost logs. If you maintain the backup of logs file automatically before starting the instance, then you are saved with that backup log file for further analysis about that crash.
Here in the above script, Most of the UNIX environments your script could use "nohup" that means no hung up when the remote machine is accessed with ssh/Putty.
If you create this script in development/QA environment same script can be used for production because keeping it more portable with SDIR (source directory path).
iii. Customized Stop All script for each domain
Best option I found from stopManagedWebLogic.sh given by the Oracle. It is normal shell script it will invokes the Python script on the fly. I just replaced the 'Server' with 'Cluster' argument for shutdown WLST command and also called admin stop script in the bottom.
iv. Server Health checking script
Separate is a time, effort saving
6. Deployment Strategies
System resource deployments better you prepare your customized JDBC Data source configuration script using WLST. Avoid Start-up Classes configuration which will make dependable deployment, which leads you to not able to use side-by-side(SBS) deployment advantage.
7. WebLogic 9.x onwards You have a flexibility to use Deployment plans for UAT, QA, Staging environments as same as production. This will reduce the problem of porting the code on one environment to other without any configuration changes.
8. OOME
Most of the production environments first hurdle is OOME, if it is occurring in your Web-tier environment then you can use JSP pre-compile.Prepare GC monitoring scripts
9. Now a days everywhere you can find Virtualization (SOLARIS ZONES), Cloud computing, Clustering (Database RAC), Grid concepts, Veritas Clustering in Disks/RAID etc. Have each topic in breif knowledge that could make you understand if anything goes wrong somewhere in the application environment you can easily figure it out.
10. Know about your production environment end to end how the data flows? Firewall, Load balancer software or hardware, proxy-plugin security aspects, Network connectivity, Net-backup locations etc.
Oracle WebLogic installation on Solaris machine or Linux or a Windows machine better to have a dedicated user where you can install the WebLogic components. provide access to all other users so that no need of reinstalling required for each new domain on the same machine.
- useradd [options] LOGIN
- Some of important options are:
- -d home directory
- -s starting program (shell)
- -p password
- -g (primary group assigned to the users)
- -G (Other groups the user belongs to)
- -m (Create the user's home directory
- useradd -g wladev -G wladmin -s /bin/bash -p xxxxxxxx -d /home/user -m user
2. Using of sed
When I worked for WebLogic 9.2 migration for each instance wise configuring fresh properties updating took me around a week time for whole environment. This time WebLogic 11g migration I have an idea to use stream editing option, and apply proper regular expressions to finish my task. It worked for me awesome, whole updating done in half hour with small script that included sed in a for loop. I had to change multiple lines search and replace in multiple files in the same machine, so I took the above said trick it worked and saved my time.
- for i in `ls instances|grep c`
- do
- cd $INST_HOME/$i/config
- cp /oldinstance/$i/config/*.properties .
- sed -e "s/$i-//g" \
- -e "s/$i\_//g" \
- -e "s/\_$i//g" \
- -e "s/-$i//g" \
- -e "s/wluser92/wluser11/g" < log4j.properties >temp
- mv temp log4j.properties
User per domain: If you are preparing a development environment then you can choose a user per domain it is the best way to avoid conflicts between developers code changes etc. Install new Oracle License and keep always a backup of old License.
3. Customizing your domain
AdminServer name, ListenAddress, ListenPort, Some times you might see errors saying that "Listen Port already in use", To avoiding port conflicts: Before assigning a port to your WebLogic instance better you check whether it is already in use or not? by using netstat command.About Virtual IP issues.
i) WebLogic Server wise logs generation
WebLogic Server instance each one can generate separate server side logs as well as application logs. Most of the developers while troubleshooting an issue they must know from which server it was happening for this log4j provides more flexibility to digg/debug every Java package, class level, even method, line level too.
How to collect it?
To make this possible you need to enable your WebLogic server library path must pick the log4j-1.2.8.jar and the logging definitions in a separate file lets say it as log4j.properties file.
Where to set?
Before weblogic.jar path or after? Oracle recommands application related jars and third-party jars must be set after weblogic.jar.
ii) Editing for all Domain Environments
Editing common scripts impacts all the domains in that machine. If there is a need for the WebLogic server run with server JVM that will give more scope for In commEnv.sh script we are going to update .Sample Example:
4. Scalability for Domain
Adding servers to or removing servers existing Cluster is nothing but scalability. While defining new Cluster identify proper multi-cast address suitable to your environment with multi-cast test. You must use Interface Address as the DNS/IP of the machine where the instance is configured in each server's Cluster tab. This will make you easy to run the clustered environment.
5. Effort saving means cost saving
While preparing your configuration keep focus on portable coding. I have been to many UNIX forums to find portable and flexible scripting. Here I am sharing for you. Efforts can be focused on the following things
i. Customized start script for admin server,
ii. Customized start script for managed server
The following start script save it as "startMserver.sh" assuming that you might need few instance specific properties need to refer in startWebLogic.sh script.
- INSTANCE=$1
- export INSTANCE
- SOURCE=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
- cp $INST_HOME/$INSTANCE/logs/$INSTANCE.out $INST_HOME/$INSTANCE/logs/$INSTANCE.out.bkp
- nohup $SOURCE/startManagedWebLogic.sh $INSTANCE >$INST_HOME/$INSTANCE/logs/$INSTANCE.out 2>&1 &
- echo tail -f $INST_HOME/$INSTANCE/logs/$INSTANCE.out
Here $INST_HOME is defined in the user profile script.
These customized start scripts for admin server and managed servers. In the script make a copy of the last server instance log to instance.out_bkp. Some times due to some panic situations servers might crashed, after monitoring you found that it happen so restarting server should not loss that lost logs. If you maintain the backup of logs file automatically before starting the instance, then you are saved with that backup log file for further analysis about that crash.
Here in the above script, Most of the UNIX environments your script could use "nohup" that means no hung up when the remote machine is accessed with ssh/Putty.
If you create this script in development/QA environment same script can be used for production because keeping it more portable with SDIR (source directory path).
iii. Customized Stop All script for each domain
Best option I found from stopManagedWebLogic.sh given by the Oracle. It is normal shell script it will invokes the Python script on the fly. I just replaced the 'Server' with 'Cluster' argument for shutdown WLST command and also called admin stop script in the bottom.
- #!/bin/sh
- DOMAIN_HOME="/home/domains/mydomain"
- . ${DOMAIN_HOME}/bin/setDomainEnv.sh
- ADMIN_URL="t3://my.adminhost.com:adminPort"
- echo "wlsUserID ='username'" >>"shutdown.py"
- echo "wlsPassword = 'password'" >>"shutdown.py"
- echo "connect(${wlsuserID}, ${wlsPassword}, url='${ADMIN_URL}')" >>"shutdown.py"
- #=== fetching cluster list from the domain configuration repository =============
- for cl in `grep -i clstr\<\/n ../config/config.xml|sed 's/.*<name>\(.*\)<\/name>.*/\1/'
- do
- echo "shutdown($cl','Cluster')" >>"shutdown.py"
- echo "state($cl)">>"shutdown.py"
- done
- echo "shutdown()" >>"shutdown.py"
- echo "exit()" >>"shutdown.py"
- echo "Stopping Weblogic Server..."
- java -classpath ${FMWCONFIG_CLASSPATH} ${MEM_ARGS} ${JVM_D64} ${JAVA_OPTIONS} weblogic.WLST shutdown.py 2>&1
- echo "Done"
- </name>
iv. Server Health checking script
Separate is a time, effort saving
6. Deployment Strategies
System resource deployments better you prepare your customized JDBC Data source configuration script using WLST. Avoid Start-up Classes configuration which will make dependable deployment, which leads you to not able to use side-by-side(SBS) deployment advantage.
7. WebLogic 9.x onwards You have a flexibility to use Deployment plans for UAT, QA, Staging environments as same as production. This will reduce the problem of porting the code on one environment to other without any configuration changes.
8. OOME
Most of the production environments first hurdle is OOME, if it is occurring in your Web-tier environment then you can use JSP pre-compile.Prepare GC monitoring scripts
9. Now a days everywhere you can find Virtualization (SOLARIS ZONES), Cloud computing, Clustering (Database RAC), Grid concepts, Veritas Clustering in Disks/RAID etc. Have each topic in breif knowledge that could make you understand if anything goes wrong somewhere in the application environment you can easily figure it out.
10. Know about your production environment end to end how the data flows? Firewall, Load balancer software or hardware, proxy-plugin security aspects, Network connectivity, Net-backup locations etc.
How to Clearing Cache for WebLogic instance?
What is actually WebLogic Cache?
Basically all the web-tier related files (.jsp .class, JSPCompiled files etc.,) get stored in ./wlnotdelete/app_yourapplicaiton directory. This is treated as cache whenever there is restart of a WebLogic instance happen then the WebLogic server will look-up for last serviced object status stored in the cache to service for any pending requests. Usually, when your EJB Classes need sessions, JMS object requires persistance, your web-tier may contain static contents then Cache will be used by WebLogic Application Server instance.
Why we need to remove Cache?
Whenever your application is accessed for the first time that fresh deployment of a new version, WebLogic server lookup in this directory, if there are older objects persists that will be conflict with new code objects. This is where the need of removal of cache arises.
Where there is a need of new version deployment we might need to clear the cache when the changes to the new version is not reflected. In the old version WebLogic 8.1 below we used to remove .wldonotdelete folder. In new version of WebLogic 9.x onwards removal of cache means deleting each server instance's tmp folder contains cache, stage folders or you can simply remove tmp folder too provided there should not be configuration changes happen to the server.
Generally for WebLogic 9.x and higher versions
WIN: C:\bea\user_projects\domains\yourdomain\servers\yourserver\tmp
UNIX: /bea/user_projects/domains/yourdomain/servers/yourserver/tmp
you can use the following commands to clear the cache:
WIN: rd C:\bea\user_projects\domains\yourdomain\servers\yourserver\tmp \s
UNIX: rm -rf /bea/user_projects/domains/yourdomain/servers\yourserver/tmp
Here I am removing all the subdirectories and files in the the given directory.
When to do this?
After Stopping the WebLogic server instance you can go for removal of cache.
Mostly, Spring framework users, struts framework users have this no changes reflected issue for their web applications.
Alternative solution is you can use 'stage' mode set to 'no_stage' deployment. when undeployed an applicaiton then WebLogic server itself removes the cache objects.
Basically all the web-tier related files (.jsp .class, JSPCompiled files etc.,) get stored in ./wlnotdelete/app_yourapplicaiton directory. This is treated as cache whenever there is restart of a WebLogic instance happen then the WebLogic server will look-up for last serviced object status stored in the cache to service for any pending requests. Usually, when your EJB Classes need sessions, JMS object requires persistance, your web-tier may contain static contents then Cache will be used by WebLogic Application Server instance.
Why we need to remove Cache?
Whenever your application is accessed for the first time that fresh deployment of a new version, WebLogic server lookup in this directory, if there are older objects persists that will be conflict with new code objects. This is where the need of removal of cache arises.
Where there is a need of new version deployment we might need to clear the cache when the changes to the new version is not reflected. In the old version WebLogic 8.1 below we used to remove .wldonotdelete folder. In new version of WebLogic 9.x onwards removal of cache means deleting each server instance's tmp folder contains cache, stage folders or you can simply remove tmp folder too provided there should not be configuration changes happen to the server.
Generally for WebLogic 9.x and higher versions
WIN: C:\bea\user_projects\domains\yourdomain\servers\yourserver\tmp
UNIX: /bea/user_projects/domains/yourdomain/servers/yourserver/tmp
you can use the following commands to clear the cache:
WIN: rd C:\bea\user_projects\domains\yourdomain\servers\yourserver\tmp \s
UNIX: rm -rf /bea/user_projects/domains/yourdomain/servers\yourserver/tmp
Here I am removing all the subdirectories and files in the the given directory.
When to do this?
After Stopping the WebLogic server instance you can go for removal of cache.
Mostly, Spring framework users, struts framework users have this no changes reflected issue for their web applications.
Alternative solution is you can use 'stage' mode set to 'no_stage' deployment. when undeployed an applicaiton then WebLogic server itself removes the cache objects.
How to Check URL using shell script?
We had an issue on production environment. Suddenly one of the webserver got crashed that no one aware of it. That was happen in the Weekend there were no users accessing at that time. When the business hour started Monday morning customer reported to service desk that one of the URL is not working for them. We middleware support team check the URL and identified that the HTTP server not working. Next action items as you know taking the logs backup and starting the HTTP server done.
As part of issue management preventive action to this there could be a monitoring of the URLs. All the web servers hosted application, load balancer that is serving the application or Application server that hosted the web application must be checked randomly or every day before business hours starts.
To do this monitoring team started working on listing out all loadbalancer URL, primary, secondary webserver URLs and also Application server hosted URL lists and checking on the browser each URL.
Here is the pain-area doing this in manually there could be
• JHuman errors, Re-testing same URL
• Each URL checking takes almost 1 min
• Business have 10 domains then each domain have load balancer URL, primary, secondary webserver URL approx 30 min
Thought of the day! Why don’t we automate this task using UNIX shell scripting. We came up with idea using wget command. Started brainstorming searching on internet for a scripts that could monitor the URL. Many forums, blogs, most of them are using curl command whereas Solaris box is not having this command.
Alternate to curl command we have powerful wget command on Solaris.
Challenges
1. While using wget it is downloading junk
2. We have URL list some of them are SSO enabled
The first challenge, can be fix with –spider option will avoid the downloading anything from the website.
The second challenge overcome by using --no-check-certificate option
Redirect output of command into a variable
Test the test url from the command line, that is giving output from HTTP header of that URL. From that we need only single line that shows HTTP status. The grep command will do this, but it cannot be applied directly to that command. Because the wget execution is unable to sending the response to STDOUT, rather it will send to STDERR. To fix this, redirect the STDERR to STDOUT and do this in background ( 2> &1). You can do this by storing that into a file, but it is not optimum solution. To store it into a variable, So that grep command will be enabled to find the pattern ‘HTTP’.
Create a file with desired URL list - urls.txt
Prepared a bash script that will work as web crawler for your business to check the URL and tells you it’s host is OK or not.
Effective automation script made the script as follows:
#!/bin/bash
#=========================================================
# This script will check for the appliction url working or not
#=========================================================
# Function that check the URL returns HTTP Status Code
checkURL()
{
# keep below 2 lines in one
s=`(/usr/sfw/bin/wget -t 0 --spider --no-check-certificate $1) 2>&1 \
grep HTTP| tail -1|cut -c 41-43`
echo $s
}
#========== = = = main script = = = ===========
clear
for url in `cat urls.txt`
do
HTTPCode=$(checkURL $url) # function call
if [ $HTTPCode -ge 500 ]
then
status="DOWN"
# mail if this have issue
else
status="UP"
fi
TIME=`date +%d-%m-%Y_%H.%M.%S`
echo At $TIME the URL $url $HTTPCode $status
done
This script can be associated with schedule job
1. crontab old way
2. autosys job scheduler
3. at command for trials
As part of issue management preventive action to this there could be a monitoring of the URLs. All the web servers hosted application, load balancer that is serving the application or Application server that hosted the web application must be checked randomly or every day before business hours starts.
To do this monitoring team started working on listing out all loadbalancer URL, primary, secondary webserver URLs and also Application server hosted URL lists and checking on the browser each URL.
Here is the pain-area doing this in manually there could be
• JHuman errors, Re-testing same URL
• Each URL checking takes almost 1 min
• Business have 10 domains then each domain have load balancer URL, primary, secondary webserver URL approx 30 min
Thought of the day! Why don’t we automate this task using UNIX shell scripting. We came up with idea using wget command. Started brainstorming searching on internet for a scripts that could monitor the URL. Many forums, blogs, most of them are using curl command whereas Solaris box is not having this command.
Alternate to curl command we have powerful wget command on Solaris.
Challenges
1. While using wget it is downloading junk
2. We have URL list some of them are SSO enabled
The first challenge, can be fix with –spider option will avoid the downloading anything from the website.
The second challenge overcome by using --no-check-certificate option
Redirect output of command into a variable
Test the test url from the command line, that is giving output from HTTP header of that URL. From that we need only single line that shows HTTP status. The grep command will do this, but it cannot be applied directly to that command. Because the wget execution is unable to sending the response to STDOUT, rather it will send to STDERR. To fix this, redirect the STDERR to STDOUT and do this in background ( 2> &1). You can do this by storing that into a file, but it is not optimum solution. To store it into a variable, So that grep command will be enabled to find the pattern ‘HTTP’.
Create a file with desired URL list - urls.txt
Prepared a bash script that will work as web crawler for your business to check the URL and tells you it’s host is OK or not.
Effective automation script made the script as follows:
#!/bin/bash
#=========================================================
# This script will check for the appliction url working or not
#=========================================================
# Function that check the URL returns HTTP Status Code
checkURL()
{
# keep below 2 lines in one
s=`(/usr/sfw/bin/wget -t 0 --spider --no-check-certificate $1) 2>&1 \
grep HTTP| tail -1|cut -c 41-43`
echo $s
}
#========== = = = main script = = = ===========
clear
for url in `cat urls.txt`
do
HTTPCode=$(checkURL $url) # function call
if [ $HTTPCode -ge 500 ]
then
status="DOWN"
# mail if this have issue
else
status="UP"
fi
TIME=`date +%d-%m-%Y_%H.%M.%S`
echo At $TIME the URL $url $HTTPCode $status
done
This script can be associated with schedule job
1. crontab old way
2. autosys job scheduler
3. at command for trials
Subscribe to:
Posts (Atom)
