Thursday, March 22, 2018

Mobile Performance Testing Using JMeter


Mobile Performance Testing Using JMeter:

Mobile applications are very rapidly developed but only few provide ultimate services to end users. Any app that is can be readily deployed into the mobile can be termed as mobile app with respective supported operating system IOS or Android OS.

Problem: 
In order to launch a new mobile app into market it is mandatory for any the organization to stabilize the performance of the mobile app should be consistent across the different network speeds as end user will be using across the networks.

Pre-requisite: JMeter tool and mobile app should be connected to same network (WIFI or Normal net) so that while navigating the app in the mobile it records traffic in JMeter tool by using the common proxy.

SOLUTION:
This can be done in JMeter, in order to achieve in the JMeter need to do the below setup in jmeter.properties file for covering all the available networks across the different operations of mobile network.
Note: cps (characters per second)
socket.http.cps=0
socket.https.cps=0
You can use these properties to limit the bandwidth in following ways:
In the bin folder of your JMeter installation, open the JMeter properties file and add these two lines and restart JMeter.
socket.http.cps=21888
socket.https.cps=21888
So different bandwidths can be implemented by using the below table for using cps values in JMeter.
Bandwidth                            cps Value
GPRS                                       21888
3G                                            2688000
4G                                            19200000
WIFI 802.11a/g                     6912000
ADSL                                       1024000
100 Mb LAN                           12800000
Gigabit Lan                             128000000
Benefits:
1) Mobile apps performance can be determined for the estimated number of users using JMeter before releasing into market.
2) Easy to fix the problems of the mobile apps in any network once the issue is identified.
3) Highly valuable and trusted products in terms of performance



Sunday, March 11, 2018

Sonar Tool and its Significance

In the Performance Engineering process every project need to tune the code for making the application performance optimized according to industry standards.
       Just to bring an information of using some of the tools for optimal coding techniques, here it seems SonarQube and SonarLint are meant to very good for it.
SonarQube is an open platform to manage code quality it covers 7 qualities of code optimization.
1)Getting Best Architecture and Design of the application
2)Reducing Complexity of the applications in the area of coding
3)Potential bugs will be reduced
4)Complexity of the application will be reduced
5)Coding standards and rules will be make application more standardized.
6)Unit tests will be given good results as following best coding techniques
7)Comments in the application code will be providing much understanding with standard information
SonarQube is a web-based application, rules, alerts, threshold other important settings can be configured to its databases which can shared across the teams and different locations too very flexible for using it.
SonarQube not only allows to combine metrics altogether but also mix them with historical measures for further usage of techniques and problem solving procedures easily for same project in further releases , mostly in Agile methodologies.
SonarLint provides complete information on the particular instance of time with proper feedback to developers on new bugs and quality issues injected into java, JavaScript and PHP code while developing to avoid the wrong assumptions in coding techniques.
 Features of SonarLint:
 1) Developers can identify accurately the sonar potential issues straight from SonarQube server at the time of real time implementation.
2) Less load on sonar servers because of using the SonarLint.
3) Users can view the description of the details in user friendly manner to understand for even layman for using it.
4)Sonar Lint provides multiple IDE like Eclipse , Visual Studio , IntelliJ ..etc. 

Tuesday, March 6, 2018

Data Base Tuning - Performance Tuning


Data Base Tuning -Performance Tuning
Generally Database is the repository where we can store the data in different forms like tables, stored procedures, and triggers...etc
Most of the times we are came across the database performance problems as listed
1)     Dead locks (Using Sql Profiling we can fix the issues of dead lock)
2)     Queries consuming high response times (Using AWR report we can identify bottleneck in Queries high time by CPU and wait time can fix the issues.)
We can fix the most of the problems using following sql tuning techniques.
Indexes should be applied for tables which involves the joins and where clauses for corresponding columns of data.
  •  Avoid the use of loops instead use the cursors for the requirement to handle.
  • Execution plan should be optimized for any query.
  •  Do not use Update Instead of Trigger which leads to performance degradation for particular trigger.
  • Display number of columns instead of using wildcard (*) character for displaying all columns
  •  Replace in and not in with Exits and Not Exists which will improve the performance of query
  •  Use with no lock for tables when creating indexes which helps for supporting concurrent users.
  •  Avoid using functions on the right hand side, it is always best practice to use the functions at beginning of the query.
  • Avoid using correlated sub-queries instead use Joins and normal sub queries.
  • Remove unnecessary temp tables at end of the each procedures, sometimes temp data will get full up and causes performance issues.
  • Use the select statements limited, it is always best practice to get the required data in single select statement instead using multiple select statements for retrieving the data.
Index:
An index is used to speed up the performance of queries. It does this by reducing the number of database data pages that have to be visited/scanned.
Clustered Index:
 A clustered index is a special type of index that reorders the way records in the table are physically stored. Therefore table can have only one clustered index. The leaf nodes of a clustered index contain the data pages.
  • It is present on primary key of the table.
  • It follows binary structure.
  • The leaf node contains key and actual data.
Non-Clustered Index:
A Non-clustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk. The leaf node of a Non-clustered index does not consist of the data pages.
  •  It also follows Binary Structure.
  • Leaf node contains Key and reference data.
Defragmentation generally makes the index in exact working state by making it active.
  • Rebuild index: it will recreate the existing index by dropping it, to make sure index should be working properly for corresponding columns.
  • Reorganize index: it will just refresh the existing index without dropping them, it also helps to make the index working properly.
  • Whenever a query is written in the database by the developer. While executing the load test we may observe that query will consume more response time for its execution.
How do the database manage the execution process for different queries and stored procedures?
  • Data reads and writes happen in the SGA(Shared Global Area) are known as logical reads and logical writes.
  • Data reads and writes happen in the PGA(Programmable Global Area) are known as physical reads and physical writes.
  • For a most optimizing maintaining of the database servers, we need to maintain the high percentage of logical reads and writes than the physical.
Parsing:
Parsing is one stage in the processing of a SQL statement. When an application issues a SQL statement, the application makes a parse call to Database.
During the parse call, Database
1.     Checks the statement for syntactic and semantic validity.
2.     Determines whether the process issuing the statement has privileges to run it.
3.     Allocates a private SQL area for the statement.
Also tuning can be done using following tools or commands or options too
  • Sp_who2 – Used to identify any process or stored procedure which is halting performance at that particular point of time, using the stored procedure id or corresponding operation id we can kill the halting process.
  •  Profiler –Using profiler we can identify the particular tables or stored procedures performance issue or dead lock kind of problems.
  • Tuning Advisor – It automatically suggests us for corresponding query where to add indexes for making query optimized performance.
  • Activity Monitor – It monitors the database level server monitoring when load test is in progress, for viewing the database related issues.
  • Execution plan – It is one of the key component to makes sure the execution plan should be optimized by seeing the cost operation of query by re-writing it in best way.
  • Dynamic Management views –Properly managing the dynamic management views will add the performance improvement for any database.