Month: February 2013
Introduction to Jmeter
Apache JMeter is a 100% pure Java desktop application designed to load test client/server software. It may be used to test performance both on static and dynamic resources such as static files, Java Servlets, CGI scripts, Java objects, databases, FTP servers, and more. JMeter can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types.
Go for apache Jmeter 2.3.4 which supports Badboy Scripts as we have to record web application scripts using Badboy tool and import the scripts from Badboy to Jmeter.
Overview of the Jmeter Components:
Thread group elements are the beginning points of any test plan.
All controllers and samplers must be under a thread group.
Other elements, e.g. Listeners, may be placed directly under the test plan, in which case they will apply to all the thread groups.
As the name implies, the thread group element controls the number of threads JMeter will use to execute your test. The controls for a thread group allow you to:
• Set the number of threads
• Set the ramp-up period
• Set the number of times to execute the test
The ramp-up period tells JMeter how long to take to “ramp-up” to the full number of threads chosen.
If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. If there are 30 threads and a ramp-up period of 120 seconds, then each successive thread will be delayed by 4 seconds.
How to define Ramp-Up Period???
Ramp-up needs to be long enough to avoid too large a work-load at the start of a test, and short enough that the last threads start running before the first ones finish (unless one wants that to happen).
Ramp-up = number of threads and adjust up or down as needed.
By default, the thread group is configured to loop once through its elementsSamplers:
Samplers perform the actual work of JMeter. Each sampler (except Test Action) generates one or more sample results. The sample results have various attributes (success/fail, elapsed time, data size etc) and can be viewed in the various listeners.
Prerequisites: apache2 on both server and client side
Install the munin and munin-node in the server using
$sudo apt-get install munin munin-node
After installation Munin files will be created in following directories
We have to copy the munin folder from /var/www/munin to /opt/apache2/htdocs/
Now you can see the following files under /opt/apache2/htdocs/
favicon.ico, index.html, munin
Change the htmldir path in /etc/munin/munin.conf
htmldir = /opt/apache2/htdocs/munin
Change the ownership to munin using the following command:
chown munin:munin /opt/apache2/htdocs/munin
Login to: https://serverip/munin/ to view the graphs
Adding Plugin :
In order to generate the graph for tomcat we have to add the plugins for tomcat.
Download the plugins from http://munin-monitoring.org/ticket/74 and tar it.
Use the plugins available in usr/share/munin/plugins
Copy the plugins to usr/share/munin/plugins(copy Tomcat_jvm again and rename it to Tomcat2_jvm for tomcat2)
Tomcat1_jvm,Tomcat2_jvm for tomcat1,tomcat2 respectively
WebLogic Server: Create, Extend and Remove Domains
Basic idea of this post is to give a quick idea on how to create, extend and remove weblogic domains, in short how to manage a Oracle Weblogic Server.
The examples are related to Weblogic 11G installations.
Load testing with silkperformer: An overview
Silk Performer is the industry’s most powerful enterprise class load and stress testing tool. It uses Visual Script. It is BORLAND , licensed product.
Any Load Testing Tool for Web application will be dealing with the following Steps:
1) Recording the Script
2) Customize user data
3) Customizing session
4) Report Generation
Workload models in Silk Performer:
SilkPerformer offers different workload models that can be used as the basis for load tests. The number of concurrent virtual users per user type, the duration, and the involved agents must also be configured when defining workload.
The following workload models are available:
- Gradually workload is increased until all the users in the user list are running. This workload model is useful to find under which load level application crashes. The test is completed when the simulation time is reached.
Steady State Workload
- Same number of virtual users is employed throughout the model; there is no delay between transactions. The test is completed when the simulation time is reached.
Dynamic Work Load
- In this model, the number of Virtual users should be set at the beginning of the test, At any time
We can reduce or increase the number of users (within the limit defined) during the test. No simulation time is there and hence you have to end the test manually
All day Work-load
- You can assign different numbers of virtual users to any interval of the load test. Each user type can use a different load distribution. With this model you can design complex workload scenarios such as load per day workloads and weekly workloads. During load tests you can adjust load levels for intervals that have not yet been executed. This workload model is especially useful when you wish to model complex, extended workload scenarios as realistically as possible.
Queuing Work load
In this work load model Vusers will arrive in the scheduled time. Load Test is completed when all the users arrived and completed their transactions.
- This is useful for regression testing of WEB based application, to automate verification and to begin verification from command line.
Performance testing: Profiling using YJP
What performance problems may arise?
a) Application algorithms are usually not optimal, which leads to performance bottlenecks.
b) Memory related issues: Memory-related issues can affect an application’s execution speed and stability.
c) When Java Virtual Machine cannot allocate an object (because it is out of memory, and no more memory can be freed by the garbage collector), OutOfMemoryError is thrown, which can cause an application crash or further unstable operation.
d) An application that uses a lot of memory reduces available physical memory for itself and other programs, and thus forces the operating system to swap memory pages to and from the disk more frequently. This leads to serious overall system performance degradation.
e) Java Virtual Machine spends more time to perform garbage collection when more objects exist and more temporary objects are created.
Performance Testing- a basic introduction
Performance testing ensures that there is no performance bottleneck which minimizes product stability, further increasing the customer satisfaction on long run of our product.
What are the performance bottlenecks?
1) Functionality break on the large load of the data
2) More resource utilization such as RAM, Hard Disk.
3) Server pauses because of the load
4) Crashing of the servers/system
How to measure the performance?
1) Through Load Testing and continuous monitoring
2) Profiling the application for finding memory leaks
How to Load Test?
Load Testing can be done by Load Testing Tools such as Silk Performer, Jmeter, and Load runner.
These tools will create virtual users by the way simulating real load on the web server.
When there is bottleneck in the application, profilers should be attached and monitored for instance Java Yourkit Profiler (YJP- licensed), Netbeans Profiler(Open Source), JAVA Visusal VM (Open source , java’s own tool) are some of the widely used profilers.
Selinux -Security Enhanced Linux.