[ieee 2012 2nd ieee international conference on parallel, distributed and grid computing (pdgc) -...

5
2012 2nd IEEE International Conference on Parallel, Distributed and Grid Computing Load Testing of Web FrameWorks Mohpreet Singh Education & Research Department Infosys Mysore, India, mohpreetl23@gmail.com Abstract-This document deals with a comparative analysis on the web frame works namely Spring3.0 MVC, Struts 2.0, JSF 1.2x and Wickets. A detailed study is given on the behavior of the frameworks when they are utilized in the front end and at the backend JPA is used to make communication with the database. The Database utilized is Oracle 109. Load Testing of all the applications is done using J-meter. Keywords- Spring3.0 MVC, Struts 2.0, JSF i.2x, Wickets and JPA I. INTRODUCTION Web ameworks are utilized to make the web application development easier so that a developer can focus on the core development part of the application rather than just doing the trivial things such as fetching the request parameters, type casting them and doing the necessary validations and conversions. These all things are automated inside a ame work so that developer can purely focus on the development part. But as the IT is developing at such a fast pace ame works are also emerging at the quicker rate, so a wise choice of the amework is to be made among all of the present ameworks on basis of the amount of the Bandwidth occupation, Data Rate, Response time etc. This paper aims at comparing the web ameworks listed above on basis of these parameters and giving the data for sake of the developer's convenience. II. PROBLEM DESCRIPTION In this paper aim is to study the web applications on the domain of the cars. Each application has the nctionality of registering the car and generating the report for the cars cuently registered with the system. These applications will be load tested in J-Meter for study of the conoller servlet in each amework. Following table shows the listing of the ameworks and there coesponding conoller servlet. TABLET. FRAMEWORK DESCRIPTION Framework Controller Servlet JSF 1. 2 Faces Serv I et Wickets Wickets Filter Struts 2. 0 Filter Dispatcher Spring 3. 0 Dispatcher Servlet 978-1-4673-2925-5/12/$31.00 ©2012 IEEE 592 Rishav Singh Education & Research Department Infosys Mysore, India. [email protected] III. ARCHITECTURE OF THE APPLlCA TlONS As discussed earlier in the document various ont end ameworks are studied in cognition with the Java Persistence API (JPA) [1], following flow diagrams show the development of the web apps utilized in this paper. Application: #1 1 Struts 2.0 1 --' 1 Client Application: #2 Figure 1. Application architectures A brief inoduction to the controller servlet and each ame works being discussed. A. JSF and Faces Servlet JSF stands for Java server faces. JSF is MVC amework that is utilized to develop the web ameworks [2][3]. It is also described as swing for the server-side, when it comes to its VI and event handlers. It is also a specification named JSR-252. Latest version of JSF is JSF2.0 that supports the Dependency Injection (DI) [4] i.e. all the objects such as faces context etc. are injected into the code using the annotations, or methods.

Upload: rishav

Post on 02-Mar-2017

213 views

Category:

Documents


1 download

TRANSCRIPT

2012 2nd IEEE International Conference on Parallel, Distributed and Grid Computing

Load Testing of Web FrameWorks

Mohpreet Singh Education & Research Department

Infosys Mysore, India,

[email protected]

Abstract-This document deals with a comparative analysis on

the web frame works namely Spring3.0 MVC, Struts 2.0, JSF

1.2x and Wickets. A detailed study is given on the behavior of the

frameworks when they are utilized in the front end and at the

backend JPA is used to make communication with the database.

The Database utilized is Oracle 109. Load Testing of all the

applications is done using J-meter.

Keywords- Spring3.0 MVC, Struts 2.0, JSF i.2x, Wickets and

JPA

I. INTRODUCTION

Web frameworks are utilized to make the web application development easier so that a developer can focus on the core development part of the application rather than just doing the trivial things such as fetching the request parameters, type casting them and doing the necessary validations and conversions. These all things are automated inside a frame work so that developer can purely focus on the development part. But as the IT is developing at such a fast pace frame works are also emerging at the quicker rate, so a wise choice of the framework is to be made among all of the present frameworks on basis of the amount of the Bandwidth occupation, Data Rate, Response time etc. This paper aims at comparing the web frameworks listed above on basis of these parameters and giving the data for sake of the developer's convenience.

II. PROBLEM DESCRIPTION

In this paper aim is to study the web applications on the domain of the cars. Each application has the functionality of registering the car and generating the report for the cars currently registered with the system. These applications will be load tested in J-Meter for study of the controller servlet in each framework. Following table shows the listing of the frameworks and there corresponding controller servlet.

TABLET. FRAMEWORK DESCRIPTION

Framework Controller Servlet

JSF 1. 2 Faces Serv I et

Wickets Wickets Filter

Struts 2.0 Filter Dispatcher

Spring 3.0 Dispatcher Servlet

978-1-4673-2925-5/12/$31.00 ©2012 IEEE 592

Rishav Singh Education & Research Department

Infosys Mysore, India.

[email protected]

III. ARCHITECTURE OF THE APPLlCA TlONS

As discussed earlier in the document various front end frameworks are studied in cognition with the Java Persistence API (JPA) [1], following flow diagrams show the development of the web apps utilized in this paper.

Application: #1

'--_---11---+1 Struts 2.0 1-1 --' .. 1 Client

Application: #2

Figure 1. Application architectures

A brief introduction to the controller servlet and each frame works being discussed.

A. JSF and Faces Servlet

JSF stands for Java server faces. JSF is MVC framework that is utilized to develop the web frameworks [2][3]. It is also described as swing for the server-side, when it comes to its VI and event handlers. It is also a specification named JSR-252. Latest version of JSF is JSF2.0 that supports the Dependency Injection (DI) [4] i.e. all the objects such as faces context etc. are injected into the code using the annotations, or methods.

2012 2nd IEEE International Conference on Parallel, Distributed and Grid Computing

Faces Servlet is a servlet that manages the request processing lifecycle for web applications that are utilizing Java Server Faces to construct the user interface [5][6].

If the application is running in a Servlet 3.0 (and beyond) container, the runtime must provide an implementation of the ServletContainerInitializer interface.

B. Wickets and WicketsFilter

It is conceptually similar to JSF. It is popularly known as component based framework. Main components of wickets framework are as follows [7]:

• Markup.

• Components.

• Model.

Mark ups: Plain html code that is used to render response to the user.

Components: These are java classes that are running behind the html pages and bound to the controls of the html pages.

Model: Html pages show the content, so this model classes' object actually locate the model objects (i.e. Entities or Beans) from which to fetch the data and places the data on the components and components are in return bound to html pages hence data is show to the user.

Wickets Filter is a Filter for initiating handling of Wicket requests. The biggest advantage of a filter is that, it can either process the request or lets whatever is next in the chain try [8].

C. Struts2.0 and FilterDispatcher

Struts2 was originally known by the name Web works2 of the Open Symphony. Afterwards Struts community and web works joined to create a new framework that gave birth to Struts 2.0[9][lO]. It supports Dependency Injection which makes the application some -what faster .All the http objects request, session, application are made available in the code of the action classes and page using the setter injection (A type Dependency Injection). It also has concept of the interceptors that intercept the request while receiving requests and sending the responses [11][12].

Struts Filter is a master filter that handles the responsibilities as follows [13][14]:

• Serving the static content. • Executing actions • It also aims at launching the X-Work's interceptor

chain for the request life cycle. • Cleaning up the Action Context

D. Spring 3.0 And DispatcherServlet

Spring 3.0 has evolved from the previous versions of the spring [15][16] i.e. Spring2.X in which most of the annotation were developed. But in these versions the support for the MVC was not up to the mark. There was requirement for having a

593

good MVC in Spring itself which lead to the development of Spring 3.0. Spring has following features:

This framework supports Java 5. The annotation based configuration is also provided by it.

Spring Expression Language (SpEL) is being introduced in this framework [17]. This can be utilized while defming the Annotation based bean.

The biggest advantage is, Spring 3.0 framework supports REST (Representational State Transfer) web services.

It supports annotation based Data formatting.

Dispatcher Servlet is for handling HTTP requests e.g. HTTP-based remote service exporters or for web UI controllers. It dispatches the request to registered handlers for processing, providing an exception handling facilities and convenient mapping [18].

E. JPA Java Persistence API

It is Object Relational Mapping (ORM) tool. It is the work of the JSR 220 Expert Group. It has support for the annotations to relate various classes with each other and with a special file called as "persistence.xrnl" [1]. Every persistence.xml is having a persistence unit name. There are certain important classes involved in the JP A's functioning listed as follows [19]:

• Persistence Provider: To perform the correct database operations this class is needed. It will take help of the metadata persistence.xml and do the necessary operations.

• Entity Manager Factory: This class is utilized to create the manager factories on basis of the information (persistence unit name) present in the persistence.xml.

• Entity Manager: This is a class that will actually cause the persistence of the objects into the database. It has the entire API to find or persist or remove or update and equivalently can create the transactions for the same. This class also has an API to make and run queries called as Java Persistence Query Language (JPQL).

IV. LOAD TESTING USING J-METER

J-meter is a tool for load testing of the web applications on the server. It is used to simulate heavy load on the server and hence tests the performance in different load conditions. It is open source and developed by apache. Load testing can be performed by creating the test plan. A test plan may include many thread groups, separately for each of the applications under the context. Each thread group is having certain element, there list is show as follows and the particular type which is utilized in this paper to test the applications:

2012 2nd IEEE International Conference on Parallel, Distributed and Grid Computing

TABLE IT. THREAD GROUP ELEMENTS

Element name Type Used

Configuration element Http Request Defaults

Sampler Http Request

Listener Summary Reports and Graphs

Configuration element Http Request Defaults

Every thread group is having certain load inputs. There description is as follows:

• Number of Threads: The load that is to be simulated to the server or number of requests that are sent to the server.

• Ramp-Up period (in seconds): The taken to send the Number of Threads specified.

• Loop Count: Number of time the test case will run.

1) JSF's Graph and Report

Technology Lab,l HSamp/is Awrag' Milt Max

JSF IITIP 1000 18787 8 77738 ReQue�

Report

Std.v..,.

18436.20

Figure 3. JSF report.

55970",

E"o, % Iltroughput Klllse, A'l· Ii)'tes

0.00% 3.91set 4.38 1162.0

o "' Li ______________________________________________ _

V. RESULTS AFTER LOAD TESTING

In this document comparison is made on basis of the following parameters:

• Through Put

• Deviation in response time

Figure 4. JSF response

2) Springs Graph and Report

R.pon

• A verage response time Technology

LGbel I SSamples I At'erllge I Min I Mu I Std. Dtt'. I £"or % I Tltroughput I KBlrec I B����

• Deviation in response time Spring : 1 1000 1 18358 1 8 1 70750 11676235 1 0.00% 1

• Bandwidth Figure 5. Spring report.

Following are the snapshots for the input and response time of the all the web applications. In each graph response time is 46509"' 1 studied is against the number of samples

A. Input

B. Output

Colors

Red

Blue

Green

Thread Properties ----------------,

Number of Threads (users): 1100 , -'--'--'-----' Ramp-Up Period (in seconds): � Loop Count: D Forever 1_1_0 ______ -'

DScheduler

Figure 2. Thread properties.

TABLE III. COLOR KEY

Quantity to be measured

Deviation in response time

Average response time

Throughput

594

Figure 6. Spring response

3) Struts 2.0 Graph and Report

Report Technology Lab,l !Samples Awrage Mi. Max Std.v..,.

Stru� IITIP 1000 52157 694 214285 48063.76 ReQuest

Figure 7. Struts report

E"or%

0.00%

3.5/"" 1 2.27 1666.0

Iltroughput Klllse, AI'g. Ii)'tes

1.41set 1.59 1146.0

2012 2nd IEEE International Conference on Parallel, Distributed and Grid Computing

151055ms

Figure 8. Struts response

4) Wickets' Graph and Report

Technology Lab,l ISamples Awrage Min M/U

W;rke� lfl1P 1000 21984 II 108218 Recue�

Repon

SId. V",.

25831.24

Figure 9. Wickets report

86415 ms

Error"

0.00%

IJu-oughpuJ KBI", A\�. B.l1"

151ser 1606 4754.0

/ i 1// / / / / / / / / / // /' /'./

.' "

oms,,------Ii _____ _

Figure 10. Wickets response

5) Aggregated report

Report Te!hnolo�es Labtl !Stmplt! Al'trage Milt MIX Std-1M!', E"orU Ilrougltput KBlsec AI'g,

Bitt!

JSF HTIP

1000 18181 8 11138 18436.10 0.00% 3.9/51( 438 1162.0 I Request Spring

HTIP 1000 18358 8 10150 1616235 0.00% 35/51( 2.21 666.0

I Reque,1 Struts

HTIP 1000 52151 694 214285 48063.16 0.00% 14/51( 159 1146.0

I Reque,1 Wicket

HTIP 1000 21984 II 108218 2583124 0.00% 35/sec 16 06 4154.0

I Request Figure II. Aggregated report

Filtering on basis of Throughput, by seeing the aggregated report we can see that JSF is giving the maximum Throughput and second highest Throughput is of both Springs and wickets.

595

Here it can be visualized that Struts is out of the competition as it is having least Throughput.

Filtering on basis of Bandwidth, if the bandwidth occupied by the frameworks is seen, it is visualized that Wickets is occupying the maximum bandwidth hence it is out of the competition.

Filtering on basis of Response Time, if the average response time of the frameworks is seen it can be seen that Spring is having the least average response Time, hence winner of the competition is Spring.

Note: These Results are given on the basis that each request is hitting the database and for every hit a new entity manger factory is getting created.

VI. CONCLUSION

Data given by this research paper can be utilized by anyone to make a choice among the frameworks listed above. Clearly winner is Spring MVC but still as per the requirements choice can be made.

REFERENCES

[I] Debu Panda, Reza Rahman, Derek Lane, "EJB3 in Action", Second Edition, Manning, 2007.

[2] "Spring Web Flow and JSF," Pro Spring3, pp. 663-706, 2012.

[3] 'The Foundation of JSF:Components",Pro JSF and Ajax, pp. 3-48, 2006 .

[4] S. M. Biju, "Dependency Injection for loose coupling of Objects," International Journal of Scientific & Engineering Research (USER) , vol. 3, issue. 5, May 2012.

[5] S. Li, L. Sun "Advantages analysis of JSF technology based on J2EE," CSSS, 2011.

[6] K. D. Mann, "JavaServer Faces in Action", Manning Publication, 2004.

[7] Peter Thomas, "Seam I JSF vs, Wicket: performance comparison", September 27, 2011, Increment Operations,Avialble at: http://ptrthomas. wordpress.com/2009/0 I 114/seam-jsf-vs-wicket­performance-comparison.

[8] M, Dashorst, E. Hillenius,"Wickets In Action", Manning Publication,2007,

[9] H. Pan, 1. Chen, C. Wu, 'The network platform based on Struts2 + JPA + Spring framework," ICEIT IEEE, pp. VI-69 - VI-71, 2010.

[10] L. Changjiang, L. Xiaohui, Y. Wang"The research and application of struts framework based on MVC pattern," AMM , vol. 63-64, pp. 940-943, 2011.

[II] D, Brown, C. M, Davis, S, Stanlick, "Struts 2 in Action", Manning Publication, 2008.

[12] N. T. Schutta, R. Asleson, "Struts and Ajax", Pro Ajax and Java Frameworks, pp. 153-182, 2006.

[13] J, Holmes, "Struts 2: The Complete Reference", McGraw-Hili PUblication,2008,

[14] "Struts Fundamentals", Springer,pp. 31-74, 2007.

[IS] W,H.Tao, 1. Baoxian "Research Based on Web Development of Spring Integration Framework," IFITA IEEE, 2010,

[16] A. Mukherjee, Z. Tari, P. Bertok "A Spring Based Framework for Verification of Service Composition," SCC IEEE, July,2011.

[17] "Integrating JPA with Spring," Spring Persistence, pp. 105-121, 2009.

2012 2nd IEEE International Conference on Parallel, Distributed and Grid Computing

[18] J. Arthur, S. Azadegan "Spring framework for rapid open source J2EE Web application development: a case study," IEEE, May 2005.

596

[19] "Integrating JPA with Spring", Apress publisher, pp. 105-121, 2009.