- The Controller is invoked using parameter values within files in the Windows OS folder (WINNT for Windows 2000 and WINDOWS for Windows XP). The Windows folder is used because LoadRunner is designed to have only one instance of Controller running at a time on a machine.
To quickly switch among several applications, save a copy of LoadRunner's ini files after working on it within the Controller, then use Notepad to craft a batch file
to copy application-specific versions of ini files before executing wlrun. An example of file copy actions for application XXX:
- copy %LRDir%/config/wlrun7-XXX.ini %LRDir%/wlrun7.ini copy %LRDir%/config/wlrun7-XXX.dft %LRDir%/wlrun7.dft
- copy %WinDir%/wlrun7-XXX.ini %WinDir%/wlrun7.ini copy %WinDir%/wlrun7-XXX.dft %WinDir%/wlrun7.dft
- In the
file file [output] section, MaxNumberOfOutputMessages= from 10000 to 100000 for long runs. This limits the number of output messages stored in the database.wlrun7.ini
- MaxOutputUIRowsToShow limits the amount of messages/errors (lines) displayed in the Controller's Output window.
- In the QTWeb.lrp file within the LoadRunner Program Files dat\protocols folder section [Vugen], add entry MaxThreadPerProcess=5 to limit the number of threads managed by each load generator mdrv.exe process.
andwlrun5.ini
files updated whenever values are changed within the Controller.wlrun7.dft
- In the
- The blocks of actions taken by each Vuser are
- defined in Vu scripts
created using Loadrunner's VuGen.exe. When this program is invoked, it stores in the Windows folder a
comparamui.INI file to save under "[LastTablesUsed]" a history of files and [ParamDialogDates] specified using menu option Insert > New Parameter > Dates. VuGen stores and retrieves a
vugen.ini file in the Windows folder. When using Java, enable additional debug options:
- [DynaDlg] JavaLevel=3
- [Editor] OLDEDITOR = 1
Vu scripts can be coded to use variable values obtained from parameter files external to the script.
I have a lot more on VuGenhere
- During a run, execution results are stored to a results folder.
I prefer to set Results Settings to "Automatically create a results directory for each scenario execution." which means that LR will increment the name of the Results Name when I start a scenario runs. For example, a value of "Res11" will be automatically incremented to "Res12" or sometimes "Res11-1".
See the ASP page I have written to access this database
- Within each results folder, a "Log" folder is automatically created to contain a log file for each group. After a run, to view a log file from within the Controller, click
then right-click on a group to select "Show Vuser Log".
- As a scenario is run, monitors maintain counters locally on each host.
- After a run, the "collate" process takes .eve and .lrr result files and creates in the results folder a temporary .mdb (MS-Access
) database. To prevent errors when processing large result files, use MSDE (Microsoft SQL Desktop Engine).
- setup SAPWD="StrongPassword" INSTANCENAME="LR" SECURITYMODE=SQL DISABLENETWORKPROTOCOLS=0 /L*v path to log file
Then in Analysis Options > Database tab, use 8.3 names without spaces (indentified with DOS command DIR /X):
- Input the SAPWD password specified above.
- Logical Storage location: \\loadclient02\Data (the folder you shared)
- Physical Storage Location: C:\PROGRA~1\MICROS~1\MSSQL\Data (not C:\Program Files\Microsoft SQL Server\MSSQL\Data)
- Click "Test parameters". (This takes a few seconds)
- The Analysis Module (8,320K analysisu.exe)
- generates analysis graphs and reports using data from the .mdb database.
- The LoadRunner Results file results_name.lrr from each scenario run -- also called an Analysis document file -- is read by the Analysis program to display Percentile graphs.
- By default, the LRReport folder is created in the test analyst's local machine My Documents folder to store Analysis Session files.
- They can optionally be formated in HTML.
- Their format are controlled by a .tem template file.
- Optionally, Mercury's Remote Performance Monitoring (RPM) MS-IIS/ASP web server for LoadRunner 7.8 can be installed on a Windows 2000 server (
but not on a Windows 2003 server) so that
- load test results to be viewed using a web browser.
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)
Monday, July 2, 2012
LoadRunner Internal Architecture?
How loadrunner Works?
Unlike a
Load generators are controlled by VuGen scripts which issue non-GUI API calls using the same protocols as the client under test. But WinRunner GUI Vusers emulate keystrokes, mouse clicks, and other User Interface actions on the client being tested Only one GUI user can run from a machine unless LoadRunner Terminal Services Manager manages remote machines with Terminal Server Agent enabled and logged into a Terminal Services Client session.
During run-time, threaded vusers share a common memory pool. So threading supports more Vusers per load generator.
The Status of Vusers on all load generators start from "Running", then go to "Ready" after going through the init section of the script. Vusers are "Finished" in passed or failed end status. Vusers are automatically "Stopped" when the Load Generator is overloaded.
No additional license is needed to monitor standard web (HTTP) servers (Apache, IIS, and Netscape).
To use
Load Runner Architecture Overview?
- LoadRunner works by creating virtual users who take the place of real users operating client software, such as Internet Explorer
Sunday, July 1, 2012
Difference between Application Server and Web Server in Java ?
Application server and web server in Java both are used to host Java web application. Though both application server and web server are generic terms, difference between application server and web server is a famous J2EE interview question. On Java J2EE perspective main difference between web server and application server is support of EJB. In order to run EJB or host enterprise Java application (.ear) file you need an application server like JBoss, WebLogic, WebSphere or Glassfish, while you can still run your servlet and JSP or java web application (.war) file inside any web server like Tomcat or Jetty.
Application Server vs Web Server
1. Application Server supports distributed transaction and EJB. While Web Server only supports Servlets and JSP.
2. Application Server can contain web server in them. most of App server e.g. JBoss or WAS has Servlet and JSP container.
3. Though its not limited to Application Server but they used to provide services like Connection pooling, Transaction management, messaging, clustering, load balancing and persistence. Now Apache tomcat also provides connection pooling.
4. In terms of logical difference between web server and application server. web server is supposed to provide http protocol level service while application server provides support to web service and expose business level service e.g. EJB.
5. Application server are more heavy than web server in terms of resource utilization.
Personally I don't like to ask questions like Difference between Application Server and Web Server. But since its been asked in many companies, you got to be familiar with some differences. Some times different interviewer expect different answer but I guess on Java's perspective until you are sure when do you need an application server and when you need a web server, you are good to go.
How to Tuning JRockit ?
Tuning the Heap Size:
Tuning Compaction
- A large heap decreases the garbage collection frequency but may take slightly longer to garbage collect.
- Typically a heap should be at least twice the size of the live objects in the heap.
- Should set the heap as large as the PHYSICAL memory in your system will allow, as long as it doesn’t cause paging.
- -Xms:, which sets the initial and minimum heap size.
- -Xmx:, which sets the maximum heap size.
- Set the initial/minimum heap size (-Xms) to the same value as the maximum heap size (-Xmx).
- JRockit offers three garbage collection modes and a number of static garbage collection strategies. You can tune the garbage collection to suit your application’s needs.
- -XgcPrio:throughput: Defines that the garbage collection should be optimized for application throughput. This is the default garbage collection mode.
- -XgcPrio:pausetime : Defines that the garbage collection should be optimized for short garbage collection pauses.
- -XgcPrio:determinist
ic {Only with JRockit Real-Time}: Defines that GC should be optimized for very short and deterministic garbage collection pauses.
- This parameter is used to tune JVMs which host ‘time critical applications’ (Ex: A banking application that normally take 100 ms to complete and times out after 400 ms, cannot afford a GC pause time of 500ms)
- The pause time mode uses a pause target for optimizing the pause times; pause target should be as high as your application can tolerate
- This parameter is coupled and used with ‘-XgcPrio:pausetime’ (ex: java -XgcPrio:pausetime -XpauseTarget:300ms weblogic.Server); default ‘pauseTarget’ is not specified is 500ms
# Below given parameters should not be changes until you
feel a real need to tune your Weblogic server; incorrect
tuning may lead to uneven performance degradation.
Tuning Compaction
- Whenever GC(old collection) runs it defragments the heap, making object allocation easier for the JVM this process is called heap compaction; compaction may lead to long pauses in GC because it takes up the CPU time to arrange and defragment the heap
- -XXcompactRatio:centage> : this specifies the percentage of heap which will be defragmented when GC runs; a good value for the compact ratio is usually between 1 and 20; a too low value can also invite trouble as it slows down defragmentation and increases the amount of dark matter(“Dark matter” is wasted heap memory and fragments the heap)
- -XXcompactSetLimit:<
references> : When compaction has moved objects, the references to these objects must be updated. JVM has to do this before threads have access to those memory references; this parameter defines how many references GC can compact within the compaction area (Ex: java -XXcompactSetLimit:2 0000 MyApplication)
- It is the chunk of memory reserved in the heap for a thread for its exclusive use.
- When this TLA gets filled up we see the ‘java.lang.OutOfMemo
ryError: nativeGetNewTLA’, to fix this we can tune the ‘-XXtlaSize:min=e>,preferred=’ parameter increase the TLA (Ex: -XXtlasize:min=8k,pr eferred=512k) - Increasing the TLA size is beneficial for multi threaded applications; however increasing it too much may result in more fragmentation and more frequent garbage collections.
Weblogic Server Administration Server Interview Questions?
- What are clusters?
Ø Cluster is a logical set of multiple Weblogic Server instances running simultaneously across different geographies and working together to achieve high availability and scalability
Ø Weblogic Server clusters support multiple algorithms for load balancing and failover: round-robin, weight-based, random, round-robin-affinity, weight-based-affinity, and random-affinity(By default, a Weblogic Server cluster will use the round-robin method)
- What is session replication?
Ø Weblogic Server provides clustering support for servlets and JSPs by replicating 'HTTP session state' of clients that access servlets and JSPs through a cluster service
Ø Weblogic Server can use 'memory, file based and database' persistence for storing session information
- How you deploy your applications on weblogic server?
Ø Auto Deployment
Ø Console
Ø Command line – weblogic.deployer
Ø ANT / WLST
- What are stating modes are available in Weblogic Server ?
Ø Stage mode: Administration Server copies the deployment files from their original location on the Administration Server machine to the staging directories of each target server
Ø External Stage: target servers deploy using local copies of the deployment files, here the Administration Server does not automatically copy the deployment files to targeted servers in external_stage mode ; instead, you must copy the files to the staging directory of each target server before deployment.
Ø No Stage: The Administration Server does not copy deployment unit files; instead, all servers deploy using the same physical copy of the deployment files, which must be directly accessible by the Administration Server and target servers.
- What is a Thread dump? How will you take in unix/linux and windows?
Ø A Java thread dump is a way of finding out what every thread in the JVM is doing at a particular point in time. This is especially useful if your Java application sometimes seems to hang when running under load, as an analysis of the dump will show where the threads are stuck.
Ø Linux : kill -3 <ps_id>
Ø Windows (console mode) : crtl+break
Ø Windows (service) : beasvc -dump -svcname:mydomain_myserver
- How should u look for in a Thread Dump?
Ø Always have 7-10 thread dumps taken in an interval of 5 seconds each
Ø A thread dump will give you an insight on what every thread in the JVM is currently doing
Ø While analyzing the thread dump you should be looking for stuck threads (threads which have not moved from a long time) – could be a resource (file / db) lock not allowing the thread to complete the task and free the monitor
Ø Look for thread locsk(if two threads store references to different objects into the same reference value, the variable will subsequently contain a reference to one object or the other, not a reference to some other object or a corrupted reference value)
Ø Look for recursive loops in application / server code traces, usually hampers server performance by utilizing CPU
- What is difference between 8.1 and 9.2, 10.x versions?
Ø 8.1 uses JDK 1.4.2 ; 9.2/10.0 uses JDK 1.5 ; 10.3 uses JDK 1.6
Ø 8.1 uses execute worker threads ; 9.2/10/10.3 uses work manager for work load distribution within the server
Ø Directory structures
Ø Console applet bases in 8.1 ; while it is portlet based in later versions
Ø 8.1 has one big config.xml ; later versions have basic info in config.xml and subsystem level info in different directories(jms, jdbc, etc)
- What are multi pools / multi data sources?
Ø MultiPools are 'pools of connection pools' that you can set up according to either a high availability or load balancing algorithm
Ø You can use a MultiPool in the same manner that you use a connection pool.
Ø When an application requests a connection, the MultiPool determines which connection pool will provide a connection, based on the selected algorithm
- What is IIS server?
Ø IIS is a webserver developed by Microsoft which is shipped with Windows NT/2000/2003 +
Ø Available versions : 5, 6, 7
Ø Usually used for hosting static HTML pages and used as an aplkication server for ASP.NET application developed using DOT NET framework 1+.
Ø Can be used as a proxy server for routing requests to weblogic server
- Where are user credentials stored?
Ø User credentials are stored in the 'boot.properties' file , which has its encryption key in the 'SerializedSystemIni.dat'
Ø If you use a script to start a server instance, it is recommended that you do not use this technique because it requires you to store an unencrypted password in the startup script.
- Suggest few JVM tuning parameters.
Ø Initial heap size and maximum heap size to be same (-xms and –xmx):T his ensures less is spend by the CPU to allocate memory in rutime
Ø Young generation (-XX:MaxNewSize): The bigger the young generation, the less often minor collections occur. However, for a bounded heap size a larger young generation implies a smaller tenured generation, which will increase the frequency of major collections. The optimal choice depends on the lifetime distribution of the objects allocated by the application.
WLST on Weblogic 8.1
In WLS 9.0 onwards WLST in inbuild with weblogc.jar, but for WLS 8.1 you would need use the jython.jar and wlst.jar files in order to run WLST.
Download link : http://www.4shared.com/file/116721496/8c3533ea/WLST_WLS_81.html
You will have to add both these files in the beginning of the CLASSPATH varibale in setWLSenv.cmd/.sh
Eg: set CLASSPATH=C:\Installer\wlst_v62\jython.jar;C:\Installer\wlst_v62\wlst.jar;C:\Installer\wlstExplorer\wlstExplorer.jar;%WEBLOGIC_CLASSPATH%;%CLASSPATH%
How to run:
1. Open a new command window
2. Run the 'setWLSenv.cmd/.sh' script to set the enviroment variables
3. invoke WLST in interavtive mode using the follwowing command : 'java weblogic.WLST'
Subscribe to:
Posts (Atom)