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

ShockHosting($4.99/月),东京机房 可享受五折优惠,下单赠送10美金

ShockHosting商家在前面文章中有介绍过几次。ShockHosting商家成立于2013年的美国主机商,目前主要提供虚拟主机、VPS主机、独立服务器和域名注册等综合IDC业务,现有美国洛杉矶、新泽西、芝加哥、达拉斯、荷兰阿姆斯特丹、英国和澳大利亚悉尼七大数据中心。这次有新增日本东京机房。而且同时有推出5折优惠促销,而且即刻使用支付宝下单的话还可获赠10美金的账户信用额度,折扣相比之前的常规...

Boomer.Host(年付3.5美)休斯敦便宜VPS

Boomer.Host是一家比较新的国外主机商,虽然LEB自述 we’re now more than 2 year old,商家提供虚拟主机和VPS,其中VPS主机基于OpenVZ架构,数据中心为美国得克萨斯州休斯敦。目前,商家在LET发了两款特别促销套餐,年付最低3.5美元起,特别提醒:低价低配,且必须年付,请务必自行斟酌确定需求再入手。下面列出几款促销套餐的配置信息。CPU:1core内存:...

CloudCone(20美元/年)大硬盘VPS云服务器,KVM虚拟架构,1核心1G内存1Gbps带宽

近日CloudCone商家对旗下的大硬盘VPS云服务器进行了少量库存补货,也是悄悄推送了一批便宜VPS云服务器产品,此前较受欢迎的特价20美元/年、1核心1G内存1Gbps带宽的VPS云服务器也有少量库存,有需要美国便宜大硬盘VPS云服务器的朋友可以关注一下。CloudCone怎么样?CloudCone服务器好不好?CloudCone值不值得购买?CloudCone是一家成立于2017年的美国服务...

jsp服务器为你推荐
搜狗输入法安利定制版问与答徐州发布官方微信力学迅雷设置xp汉语163补丁安装前必读ipad如何上网iPad怎么上网?请高手指点itunes备份怎么使用iTunes备份谷歌sb为什么百度一搜SB是谷歌,谷歌一搜SB是百度?google分析如何添加google analysis
虚拟主机mysql 漂亮qq空间 仿牌空间 国外空间服务商 服务器怎么绑定域名 165邮箱 web服务器的架设 双线主机 新家坡 双11秒杀 域名和空间 paypal注册教程 购买国外空间 卡巴斯基是免费的吗 台湾google 网页提速 什么是web服务器 个人免费邮箱 linuxvi命令 海尔t68驱动 更多