开发人员视角下的Java Web服务性能评估外文翻译资料

 2022-01-17 10:01

Performance Evaluation of Java Web Services: A Developerrsquo;s Perspective

Sanjay Ahuja, Je-Loon Yang

Abstract

As the population of the Internet grows rapidly the development of web technologies becomes extremely important. For the evolvement of Web 2.0, web services are essential. Web services are programs that allow computers of different platforms on the web to interactively communicate without the need of extra data for human reading interfaces and formats such as web page structures. Since web service is a future trend for the growth of internet, the tools that are used for development is also important. Although there are many choices of web service frameworks to choose from, developers should choose the framework that fits best to their application based on performance, time and effort for the framework. In this project, we chose four common frameworks to compare them in both qualitative and quantitative metrics. After running the tests, the results are statistically analyzed by SAS.

Keywords: Web Service, Framework, Performance, Java, Developer

1. Introduction

For going on trips to other states or countries, the person usually requires to buy airplane tickets, rent a car, and make reservations for hotels to stay at. When dealing with airplane tickets, most of the time the person even has to buy several tickets for some stops instead of a ticket that takes the person directly to the final destination. Looking up the airplane arrival and departure times to connect each flight might take hours of searching and planning. What if there was a virtual agent that could do this all in just a few seconds? So usually people would look for agents to do this for them. But what if this agent was actually is actually a virtual agent online. If the per- son just enters the location he wants to start from, the destination, the desired time for departure or arrival, and all the information required into the computer, in a snap, the computer shows all the results for the person to choose from and purchase the tickets. Even better, such virtual agents could have possibilities to also show information of the car rentals and hotels at the destination and reserve them for you. By using this type of virtual agent, could save much effort and time and can also be more accurate than human agents. Such technology relies on the development and widespread of web services.

Instead of developing a web service application from scratch, there are many open source frameworks that make development much easier. Which of these frame- works would be a better choice for web service application development? This study compares four popular open source frameworks both qualitatively and quantitatively by doing several tests and analysis. The four frameworks are Apache Axis, JBossWS, XFire, and Hessian. More introductions of web services are done in Section 2. Section 3 describes the four frameworks that are used in this study. In Section 4, the metrics that are used to measure the frameworks are explained in more detail. Section 5 introduces the statistical analysis methods that are use to analyze the measured results. In Section 6, the test results are shown and analyzed. The conclusions are in Section 7.

2. Web Service Frameworks

Since web services are designed to transfer data in common ways, several companies and groups developed web service frameworks for the convenience of web service developers so that they do not need to write a complete web service from scratch. Some of the popular frame- works are Apache Axis, JBossWS, Codehaus XFire, and Caucho Hessian. In this section, these frameworks are going to be introduced.

2.1. Apache Axis

Apache Axis (Apache Extensible Interaction System) is an open source, Java and XML based Web service framework created by the Apache Software Foundation (ASF). The foundation is a non-profit corporation that mainly produces software for network use, such as serv- ers and frameworks for servers. Their projects are well known to be collaborative, consensus based development process and free or open source software. The Apache Axis package has an implementation of a SOAP server and APIrsquo;s for generating and deploying web service applications. The SOAP engine constructs SOAP processors like clients, servers, and gateways. This allows the servers and clients to communicate through SOAP messages. The API supports a variety of languages. Besides the Java version, a C implementation is also available. It allows developers to construct their application in a variety of ways. The easiest method only requires changing the file name extension from “.java” to “.jws”. The downside of such a method is lacks flexibility for further configuration.

2.2. JBossWS

JBossWS is JBoss#39; implementation of J2EE compatible web services. The framework is designed to fit better in the overall JBoss architecture and is generally more suitable for the specific J2EE requirements for web services. Instead of using the traditional Apache server for this framework, JBoss has a server of its own, and is suggested that the framework is used on this server to get best performance. Similar to ASF, the JBoss community is a group of people that focus on open source projects. Their projects emphasize on the development of Java Enterprise Middleware, which are software that act like bridge between applications, operating systems or both.

2.3. Codehaus XFire

Codehaus XFire is a next-generation java SOAP frame- work. It is a free and open source SOAP framework that allows you to implement web services with great ease and simplicity. It also provides many features identified in web service specifications, which are not yet available in most commercial or open source tools. It is claimed to have higher perform

全文共22606字,剩余内容已隐藏,支付完成后下载完整资料


开发人员视角下的Java Web服务性能评估

Sanjay Ahuja,Je-Loon Yang

摘要

随着互联网人口的迅速增长,web技术的发展变得极其重要。对于Web 2.0的发展,Web服务是必不可少的。web服务是允许web上不同平台的计算机交互通信的程序,而不需要额外的数据用于人类阅读界面和格式,例如网页结构。由于web服务是互联网发展的未来趋势,因此用于开发的工具也很重要。虽然有许多可供选择的web服务框架,但是开发人员应该根据框架的性能、时间和工作来选择最适合其应用程序的框架。在这个项目中,我们选择了四个通用框架来对它们进行定性和定量的比较。运行测试后,使用SAS对测试结果进行统计分析。
关键词: Web服务,框架,性能,Java,开发人员

1.介绍

对于前往其他州或国家的旅行,该人通常需要购买机票,租车,并预订酒店留下。在处理飞机票时,大多数时候人们甚至不得不为一些站点购买几张票,而不是将票直接带到最终目的地的票。查看飞机的到达和离开时间以连接每个航班可能需要数小时的搜索和计划。如果有一个虚拟代理可以在几秒钟内完成这件事情会怎么样?所以通常人们会寻找代理人为他们做这件事。但是如果这个代理实际上是在线虚拟代理呢?如果每个人们仅仅输入他想要开始的位置、目的地、期望的出发或到达时间以及需要输入到计算机中的所有信息,那么计算机会在短时间内显示所有结果以供选择和购票。更好的是,这样的虚拟代理还可以显示目的地的租车和酒店信息,并为您保留这些信息。通过使用这种类型的虚拟代理,可以节省大量的精力和时间,并且可以比人工代理更精确。这种技术依赖于web服务的发展和普及。

除了从头开始开发web服务应用程序之外,还有许多开源框架使开发更加容易。对于web服务应用程序开发来说,哪种框架是更好的选择?本研究通过几个测试和分析,从定性和定量两方面比较了四种流行的开源框架。这四个框架是Apache Axis,JBossWS,XFire和Hessian。Web服务的更多介绍将在第2节中介绍;第3节描述了本研究中使用的四个框架;在第4节中,将更详细地解释用于度量框架的度量;第5节介绍了用于分析测量结果的统计分析方法;第6节显示并分析了试验结果;第7节是结论。

2. Web服务框架

由于Web服务旨在以常用方式传输数据,因此为了方便Web服务开发人员,一些公司和团队开发了Web服务框架,以便他们无需从头开始编写完整的Web服务。一些受欢迎的框架是Apache Axis,JBossWS,Codehaus XFire和Caucho Hessian。在本节中,将介绍这些框架。

2.1.Apache Axis

Apache Axis(Apache可扩展交互系统)是Apache Software Foundation(ASF)创建的基于Java和XML的开源Web服务框架。该基金会是一家非营利性公司,主要生产网络使用软件,如服务器和服务器框架。他们的项目众所周知是协作性的,基于共识的开发流程和免费或开源软件。 Apache Axis包具有用于生成和部署Web服务应用程序的SOAP服务器和API的实现。 SOAP引擎构造SOAP处理器,如客户端,服务器和网关。这允许服务器和客户端通过SOAP消息进行通信。该API支持多种语言。除了Java版本之外,C 实现也是可用的。它允许开发人员以各种方式构建他们的应用程序。最简单的方法只需要将文件扩展名从“.java”更改为“.jws”。这种方法的缺点是缺乏进一步配置的灵活性。

2.2.JBossWS

JBossWS是JBoss的J2EE兼容Web服务的实现。该框架旨在更好地适应整体JBoss体系结构,并且通常更适合Web服务的特定J2EE要求。JBoss没有为这个框架使用传统的Apache服务器,而是拥有自己的服务器,并建议在该服务器上使用该框架以获得最佳性能。与ASF类似,JBoss社区是一群专注于开源项目的人。他们的项目强调Java Enterprise Middleware的开发,这些软件在应用程序,操作系统或两者之间起着桥梁作用。

2.3.Codehaus XFire

Codehaus XFire是下一代Java SOAP框架。它是一个免费且开源的SOAP框架,可以让您轻松简单地实现Web服务。它还提供了许多Web服务规范中标识的功能,这些功能在大多数商业或开源工具中尚不可用。据称它具有更高的性能,因为它基于低内存StAX(基于XML的Streaming API)模型,但没有数据可以证明这一事实。

2.4. Hessian

Hessian二进制Web服务协议使得开发Web服务变得简单而且可用,无需大型框架,因此开发人员不需要花费更多的时间和精力来学习一系列的协议。

由于它是一种二进制协议,因此它在发送二进制数据时运行良好,无需使用附件扩展协议。像手机PDA这样的J2ME设备可以使用Hessian以更好的性能连接到Web服务,因为它是一个小型协议。Hessian是以Hessian布料命名的,这是英国的布尔拉普术语。它是这样命名的,因为粗麻布很简单,实用,而且非常有用,但却是非常普通的材料,就像Hessian协议的特点。

3 .评价指标

在比较本项目的四个框架时,考虑了不同的因素。一些度量标准用于确定性能和效率;有些是为了显示透明度和抽象性。本节说明这些度量。
3.1.延迟
就网络而言,延迟是数据发送回请求所需时间的表达式。这包括将请求发送到服务器的时间、服务器处理任务的时间以及返回结果的时间。网络延迟由许多因素造成,例如传播、传输、调制解调器和路由器处理以及存储延迟。传播是对象(例如数据)以光速从一个位置传输到另一个位置所花费的时间。传输是来自光纤或无线网络等介质的延迟。调制解调器和路由器需要时间来检查数据包的报头。存储延迟是实际硬件存储(例如硬盘驱动器)存储接收到的数据所花费的时间。在本项目中,将使用不同的方案测试延迟,例如请求1、2、3、4和5mb的数据,以及1、5、10、15、20个客户端同时请求数据。从这些测试的结果中,可以发现每个框架的趋势并进行比较。
3.2.吞吐量
吞吐量是在某个时间单位(如秒)内处理的客户端或数据量。它与延迟高度相关,因为具有高延迟的场景将导致低吞吐量,而具有低延迟的场景将导致高吞吐量。但是,通过查看延迟图,我们只能了解响应时间的趋势,而通过查看吞吐量图,我们可以确定框架的最有效方案。

3.3.内存使用

在计算中,存储器是临时存储计算机计算数据的数据存储器。存在多种存储器,例如高速缓冲存储器、闪存、随机存取存储器( RAM )、虚拟存储器等。无论是哪种内存,由于成本和空间的原因,它们都限制在服务器上。使用较少内存的框架具有允许服务器具有更高容量的优点。
3.4.中央处理器使用率

中央处理单元( CPU ),也称为处理器,是计算机中用于解码程序指令和处理数据的组件。虽然CPU一次只能处理一个任务,但当有多个任务要完成时,CPU不是完成一个任务然后转到另一个任务,而是设计为在必要时完成一个任务之前切换到另一个任务,这样它的行为就像同时执行多个任务一样。但是,大型任务可能会占用大量的CPU时间,这会缩短为其他任务计划的时间。使用较少CPU的框架将允许服务器有更多的时间来执行其他任务。
3.5.源代码行

框架中使用的源代码行( SLOC )可以指示框架的透明度和抽象性。框架的主要目标是通过不必从头编写整个代码来节省开发人员的时间和精力。因此,一个框架所需的代码行越少,这个框架节省的时间和精力就越多。但是,代码行不能精确,因为有些行可能很长而有些行很短。所以文件的数量和大小也是一个考虑因素。

4 .统计分析方法

在检索测试数据以比较性能之后,我们需要一种方法来分析结果。通过简单地计算平均响应时间并将其制作成图表来进行分析是不够的。从平均响应时间1.5秒和1.6秒来看,我们无法确定这是否有很大差异。因此,需要统计分析方法来判断差异是否显著。本项目采用一般线性模型(GLM)[9]和双向方差分析(双向ANOVA)进行统计分析。此外,统计分析系统(SAS)[10]被用作辅助计算所需统计分析的工具。
4.1.战略支助系统

SAS系统是一种统计分析软件,具有多种统计模块和程序。它们的代码使用第四代编程语言(4GL),程序由三个主要组件组成:数据步骤、过程步骤和宏语言。数据步骤用于输入数据,如在代码中插入数据或从数据文件读取数据。过程步骤是使用统计方法和模型来分析在数据步骤中读取的数据。宏语言用于减少在整个程序中反复使用的函数的冗余。

4.2.GLM模型

GLM模型是在一般情况下使用的统计线性模型。它是t检验、方差分析、协方差分析等统计分析的基础。最容易理解GLM模型如何工作的情况是双变量情况。这种分析的目的是使用一种方法来准确地描述该图中的信息。使用GLM模型,我们试图找到最接近绘图中所有点的直线。这条线可以写成:y=B0 b1x e,其中y是y轴变量,x是x轴变量,B0是截距(当x等于0时y的值),B1是直线的斜率,e是误差。通过求解B0和B1,我们可以获得关于描述图中点的直线的信息。在具有两个以上变量的其他情况下,公式可以扩展为:y=B0 b1x1 b2x2 b3x3 ... bnxn e,其中n是情况的变量数。但解决这些问题的机制是相同的。
5.结果和分析

为了从SAS分析中获得最佳结果,对每个案例进行了20次测试。由于测试了具有五个不同客户端数量的四个框架,因此有二十个不同的案例。将20个不同情况的20个测试次数相加,将得到400个数据集,由SAS计算。除了客户端数量之外,还要考虑数据的大小。在发送了五种不同大小的数据的情况下,将有二十种情况,共有400个数据集。通过在调用web服务之前记录时间,并且在接收到请求的数据之后立即记录时间,然后减去时间差来测量响应时间。
5.1.结果
5.1.1.客户情景

为了在不同的场景中测试这四个不同的框架,创建了发送数据的web服务应用程序。基于用于测试四个框架性能的客户端数量的五种场景是:1个客户端、5个客户端、10个客户端、15个客户端和20个客户端,每个客户端检索1mb的数据。记录每个场景和每个框架的平均响应时间以供分析。结果如图1所示。通过计算吞吐量的结果,图2显示了每个场景和框架的平均每秒客户端数。

图1.客户端场景中的延迟

图2显示了每个框架的最有效的客户端场景。达到10个或更多客户端的情况后,Apache Axis可以每秒处理4.993个客户端。在这些相同的情况下,Resin Hessian可以处理每秒4.807个客户端。JBossWS在每种情况下每秒处理0.943个客户端。 Codehaus XFire似乎在5个客户端的情况下效率最高,每秒处理约2.892个客户端。

图2.客户端场景中的吞吐量

5.1.2.数据大小情景

至于基于不同数据大小的五种情况的结果和平均吞吐量,它们显示在图3和4中。

图3.数据大小情况下的延迟

图4显示了每个框架的最有效的数据大小方案。所有框架在发送2 MB或更多的数据后达到最佳性能。Apache Axis平均为3.617 MB/s,JBossWS为1.287 MB/s,Codehaus XFire为1.240,Resin Hessian为1.017。

图4.数据大小情况下的吞吐量

从上面的所有图表来看,Apache Axis似乎在所有场景中都具有最佳的性能,但应由SAS进行进一步的分析。
5.2.分析

显然,响应时间的长短在很大程度上取决于框架的选择、传输的数据量以及从web服务调用任务的客户端数量。这使得这三个因素对测试结果很重要,即响应时间。但在进一步分析之前,我们必须使用GLM模型来确定这三个因素之间的交互作用是否也是重要因素。如果没有交互作用,我们可以使用Tukey方法进行多次比较,直接查看哪一个框架在所有情况下都有更好的性能,哪一个框架性能更差;如果交互作用是重要的因素,那么我们需要逐个分析结果。
5.2.1.客户情景

首先分析客户端场景的结果,我们使用SAS系统来查看每个因素的重要性。结果表明,客户数量和框架选择不仅是重要因素,而且是两者之间的互动关系。这意味着,如果某个框架在某些场景中比其他框架快得多,则该框架不一定比其他场景中的快。因此,SAS无法直接比较所有场景中的所有框架。

在这种情况下,使用来自一般线性模型(GLM)过程的成对比较。在第一场景中将第一框架与第二框架进行比较,然后将第一至第三、第一至第四、第二至第三、第二至第四和第三至第四框架进行比较。因此,在每个场景中将有六个比较。

表1.客户端方案的响应时间比较

表2.客户端方案的响应时间比较

全文共6858字,剩余内容已隐藏,支付完成后下载完整资料


资料编号:[1108]

原文和译文剩余内容已隐藏,您需要先支付 30元 才能查看原文和译文全部内容!立即支付

以上是毕业论文外文翻译,课题毕业论文、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。