authorPHP和JSP作为服务器脚本语言的性能比较-毕业论文外文翻译

jsp服务器  时间:2021-04-29  阅读:()

1

2

3

4

5

6

Performance Comparison of PHP and JSP as Server-Side Scripting Languages

MaterialSource:Notesin Computer Science

Author: Scott Trent;Michiaki Tatsubori; Toyotaro Suzumura;Akihiko Tozawa and TamiyaOnodera

1 Introduction

The dynamic scripting language PHP(PHP Hypertext Preprocessor) has becomeenormously popular for implementing lightweight web applications,and is widely used toaccess databases and other middleware.Apache module popularity surveys performed bySecurity Space in October 2007 indicate that 37%of Apache servers have PHP supportenabled,making it the most popular Apache module by 10 percentage points.Businessesare quickly realizing the powerful combination of a service oriented architectureenvironment with dynamic scripting languages like PHP.However,we believe that thereare still critical performance issues involving PHP which remain to be investigated.

This paper focuses on the use of dynamic scripting languages to implement webserver front-end interfaces.This corresponds with the way that the industry standard webserver performance benchmark SPECweb2005 utilizes PHP and JSP ( JavaServerPages).In this case, scripts are used for the implementation of dynamic page generation,rather than the realization of complex business logic.This contrasts with the traditionaluses of complex JSP-based business logic implementation.While there are numerousstudies on dynamic web content, this paper complements these studies with detailedanalysis focusing on PHP. For example, following the performance study on CGI(Common Gateway Interface) based web servers for dynamic content by Yeager&McGrath back in 1995, researchers and practitioners have been examining theperformance of more recent dynamic Webcontent generation technologies.These works,however, handle application scenarios where servlet front-ends implement relativelycomplexbusiness logic.

Although Warner and Worley discuss the importance of also using PHP withSPECweb2005, to the best of the author’s knowledge, this paper is the first to publish adetailed analysis of SPECweb2005 experimental results using both PHP and JSP. Thedetailed analysis of PHP and JSP performance based on SPECweb2005 offered by thispaper enables designers and implementers of web servers to understand the relativeperformance and through put of different versions and configurations of PHP and JSP.

7

2 Multi-tier Web Server Architecture:Lightweight Front-EndUsing PHP/JSP

Developers typically use PHP to implement a front-end interface to dynamic Webcontent generators,which are combined with web server software and back-end serversto provide dynamic content.The web server directly handles requests for static contentand forwards requests for dynamic content to the dynamic content generator. Thedynamic content generator, supported by back-end servers, executes code which realizesthe business logic of a web site and stores dynamic state. Back-end servers may beimplemented as a straight-forward database, or may be more complex servers handlingthe business logic of the web site. The front-end implementation may vary fromheavy-weight business logic handlers to lightweight clients composing content receivedfrom back-end servers.

This paper focuses on multi-tier web site development scenarios utilizing suchlightweight front-ends, supported by one or more layers o f heavy-weight back-ends.Thisassumption is reasonable when considering Service-Oriented environments where PHPscripts are used to implement a "mash-up"of services provided elsewhere, in addition tothe case of simple web sites such as bulletin boards where PHP scripts are just a wrapperto a database. Within the scenarios described in this paper, the dynamic contentgenerator provides client implementation in addition to page composition. It connects tothe back-end server through a network using either standard protocols such as HTTP orapp lication/middleware-spec ific proto co ls.

JSP technology can be considered an alternative to PHP in implementing suchfront-ends.While it is part of the Java Servlet framework,developers typically use JSP toimplement lightweight front-ends.Both PHP and JSP allow developers to write HTMLembedded code. In fact, although there are language inherent differences between PHPand Java, the use ofPHP scripts and JSP files can be very similar.

The objective of the experiments detailed in this paper is to measure theperformance of lightweight front-end dynamic content generation written in PHP and JSPwith popular web servers such as Apache and Lighttpd. This web server architecturescenario involves users who access a web server with pages written in plain static HTML,as well as JSP and PHP scripts which mix scripting language with HTML code. Theconfiguration assumed within the paper is a typical one,where web server software, suchas Apache,distinguishes between pure HTML, JSP,and PHP respectively with suffixes

8

such as .html, .jsp,and.php.HTML code is directly returned to the requesting end-user’sweb browser,where JSP and PHP pages are respectively parsed by the Tomcat scriptengine and the PHP runtime engine which both provide pure HTML which is forwardedto the end-user on a remote system.A common point between JSP and PHP is thatimplementations which perform well have a dynamically compiled and cached byte code.For example, the Java runtime used by the Tomcat script engine which we used performsmuch better when the Just-in-Time (JIT) compiler is enabled to create efficient cachednative runtime code. Similarly, the Zend PHP runtime we used also performssignificantly better when the Alternative PHP Cache (APC) is enabled, in which APCstores PHP byte codes compiled from the script source code in shared memory for futurere us e.

3 Language Runtime Performance Micro Benchmarking

To understand the difference in performance characteristics between PHP and Javaat the language runtime levelwe compared the following engines using a series of microbenchmark te sts:

-PHP 4.4.7

-PHP 5.2.3

-Java 5 with Just-In-Time(JIT)compilation(IBM J9 VM 1.5.0 Build 2.3)

-Java 5 without Just-In-Time(JIT)compilation(same as above)

The PHP language framework allows developers to extend the language with libraryfunctions written in C. These functions,which are known as "extensions", are thenavailable to be used within PHP scripts. The PHP runtime provides a variety ofextensions for string manipulation, file handling,networking,and so forth.S ince our firstgoal was to understand the performance of the PHP runtime itself,we conducted ourexperiments without the use of extensions.We developed the following microbenc hmarks:

-A quick sort benchmark which sorts 100 integers,

-A Levenshtein benchmark which measures the similarity between two strings of 56charac ter s,

-AFibonacci benchmark which calculates the 15th value in a Fibonacci series withtwo arb itrary starting values.

These PHP benchmarks were implemented entirely with PHP language primitivesand avoided the use of PHP extensions. The Java versions also focused on usinglanguage primitives rather than standard classes.We compared the total run time of

9

DiyVM独立服务器:香港沙田服务器,5M带宽CN2线路,L5630*2/16G内存/120G SSD硬盘,499元/月

diyvm怎么样?diyvm商家VPS主机均2GB内存起步,三个地区机房可选,使用优惠码后每月69元起;DiyVM独立服务器开设在香港沙田电信机房,CN2线路,5M带宽,自动化开通上架,最低499元/月,配置是L5630*2/16G内存/120G SSD硬盘。DiyVM是一家成立于2009年的国人主机商,提供的产品包括VPS主机、独立服务器租用等,产品数据中心包括中国香港、日本大阪和美国洛杉矶等,...

HostKvm($4.25/月)俄罗斯/香港高防VPS

HostKvm又上新了,这次上架了2个线路产品:俄罗斯和香港高防VPS,其中俄罗斯经测试电信CN2线路,而香港高防VPS提供30Gbps攻击防御。HostKvm是一家成立于2013年的国外主机服务商,主要提供基于KVM架构的VPS主机,可选数据中心包括日本、新加坡、韩国、美国、中国香港等多个地区机房,均为国内直连或优化线路,延迟较低,适合建站或者远程办公等。俄罗斯VPSCPU:1core内存:2G...

HaloCloud:日本软银vps100M/200M/500M带宽,,¥45.00元/月

halocloud怎么样?halocloud是一个于2019下半年建立的商家,主要提供日本软银VPS,广州移动VDS,株洲联通VDS,广州移动独立服务器,Halo邮局服务,Azure香港1000M带宽月抛机器等。日本软银vps,100M/200M/500M带宽,可看奈飞,香港azure1000M带宽,可以解锁奈飞等流媒体,有需要看奈飞的朋友可以入手!点击进入:halocloud官方网站地址日本vp...

jsp服务器为你推荐
招标编号:5106812018000248徐州发布官方微信建筑业127支持ipad流量支付宝张女士苹果5请仔细阅读在本报告尾部的重要法律声明三星苹果5eacceleratorW3S是什么意思ipadwifiIpad怎么用移动无线上网
vps linuxvps pccw 站群服务器 2014年感恩节 国外私服 表格样式 sub-process 免费防火墙 国外代理服务器软件 hdd 上海联通宽带测速 吉林铁通 联通网站 带宽租赁 linode支付宝 万网空间 空间申请 后门 广州主机托管 更多