Home     RSSRSS

Archives: Development

Application Performance and Scalability

September 18, 2018 by kiranbadi1991 | Comments Off on Application Performance and Scalability | Filed in Development, Environment, Performance Engineering

Application performance is measured by service time (response time), latency, throughput, efficiency.

Depending on application needs, we describe performance as “how fast “can a given task or work can be completed by the program with the available computing resources.

Scalability means ability of the application to increase throughput or computing power of the program when additional resources (CPU/Disk etc) are given to the program.

Scalability and Application performance are two different things for the majority of the applications and almost all of the time they are at odds to each other and requires some level of tradeoffs. Designing the application for scalability often requires that we distribute the given set of work (tasks) across parallel threads or programs or computing resources so that all the given computing resources can be used by the programs so as to increase throughput.

Good example to understand this concept is deploying the some web application on a single server which hosts its database (Persistence), application server (Business layer), cache server (Service layer/persistence layer) etc. on the single machine. Since all the components of application are hosted on same machine, it’s bound to give very good performance (No network latency involved across any tier). However after a certain point, performance might start to deteriorate after reaching a certain threshold in terms of throughput. Once the threshold throughput is achieved. There is no way to increase the throughput since every tier is on same single server. However if we move the each of the layers on the different machines, then we might increase the throughput of the application, however this might decrease the performance of the application (Network latency involved here). It’s very rare case to see application performance and scalability go hand in hand.

Tags: , , , ,

Compromised Passwords/Account Verification

August 21, 2018 by kiranbadi1991 | Comments Off on Compromised Passwords/Account Verification | Filed in Development, Security

I browse a internet a lot and have accounts across many sites. Sometimes I forget and tend to reuse my password. My account has been compromised many times.

Today while resetting the password for GitHub, I came across the interesting site which helps users to prevent reuse of compromised passwords and informs the user if his password has been compromised.

As a developer we often need to provide some extra security to our users and this site seems to be best effort by the individual that serves the larger purpose(It exposes information via Rest API).

Hopefully community notices this effort and we secure ourselves by sharing information.

Thank you Troy Hunt.

Technorati Tags: ,,

Concurrency, Thread Safety and Local Variables

August 12, 2016 by kiranbadi1991 | Comments Off on Concurrency, Thread Safety and Local Variables | Filed in Development, Performance Center, Performance Engineering, Performance Test Tools

One of the most of the common reason for concurrency issues I often see in web application is due to concurrent access of data stored in variables. Generally in servlets , data in variables are often stored as Local variables, Instance Variables, Class Variables , request attributes, session attributes and context attributes.

Below example simplest I can think of for storing data as local variable and accessing it in a thread safe manner

public class MyServlet extends httpServlet {

  // mylocalage is localvariable here for this servlet.

    public void printAge(){
              int mylocalage = 0;
      mylocalageage = mylocalage - 10;
      System.out.println("My age 10 years earlier was: " + mylocalage);
      

    }
}

Its considered that by design that data stored in local variable is thread safe.

Every thread accessing the above servlet will have their own values and they will not interface with each other.

image

Local variables are stored in stack in Java. So data stored in these variables are thread safe.

Tags: , ,