BBS水木清华站∶精华区

发信人: maht (Trill-TimeKiller), 信区: Java        
标  题: Re: CGI, mod_perl, PHP, JSP性能实测比较[转] (转载) 
发信站: BBS 水木清华站 (Sat May  6 10:37:08 2000) 
 
【 在 midi (迷笛) 的大作中提到: 】 
 换了台机器---原来那台没有PHP,新的没有Enterprise Server: 
  ./ab -n 5000 -c 500 http://localhost/readme.html 
 Requests per second:    268.00 
 ./ab -n 5000 -c 500 http://localhost/readme.php 
 Requests per second:    200.22 
 ./ab -n 5000 -c 500 http://localhost/readme.jsp 
 Requests per second:    22.93 
 
这个我在测试也发现了,tomcat绝对有问题,不管怎样,它的响应速度 
总是在20-30之间,甚至和机器无关 :) 远不如GNUJSP的效率高 
 
 这回的JSP引擎是tomcat。它解释的JAVA程序是 
 import javax.servlet.*; 
 import javax.servlet.http.*; 
 import javax.servlet.jsp.*; 
 import javax.servlet.jsp.tagext.*; 
 import java.io.PrintWriter; 
 import java.io.IOException; 
 import java.io.FileInputStream; 
 import java.io.ObjectInputStream; 
 import java.util.Vector; 
 import org.apache.jasper.runtime.*; 
 import java.beans.*; 
 import org.apache.jasper.JasperException; 
 public class _0002freadme_0002ejspreadme_jsp_0 extends HttpJspBase { 
     static { 
     } 
     public _0002freadme_0002ejspreadme_jsp_0( ) { 
     } 
     private static boolean _jspx_inited = false; 
     public final void _jspx_init() throws JasperException { 
     } 
     public void _jspService(HttpServletRequest request, HttpServletResponse  response) 
         throws IOException, ServletException { 
         JspFactory _jspxFactory = null; 
         PageContext pageContext = null; 
         HttpSession session = null; 
         ServletContext application = null; 
         ServletConfig config = null; 
         JspWriter out = null; 
         Object page = this; 
         String  _value = null; 
         try { 
             if (_jspx_inited == false) { 
                 _jspx_init(); 
                 _jspx_init(); 
                 _jspx_inited = true; 
             } 
             _jspxFactory = JspFactory.getDefaultFactory(); 
             response.setContentType("text/html;charset=8859_1"); 
             pageContext = _jspxFactory.getPageContext(this, request, response, 
                         "", true, 8192, true); 
             application = pageContext.getServletContext(); 
             config = pageContext.getServletConfig(); 
             session = pageContext.getSession(); 
             out = pageContext.getOut(); 
             // HTML // begin [file="/readme.jsp";from=(0,0);to=(18,0)] 
                 out.write("<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">\r\n<html>\r\n<head>\r\n 
 <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n   <meta name=\"GENERATOR\" content=\" 
 Mozilla/4.5 [en] (WinNT; U) [Netscape]\">\r\n</head>\r\n<body>\r\n\r\n<center><font size=+2>Netscape Enterprise Server 
  4.0 Servlets SDK</font></center>\r\n\r\n<hr WIDTH=\"100%\">\r\n<br>The following is a set of samples and example comp 
 onents, plugins and\r\ntechnologies supported by Netscape Enterprise Server 4.0 Servlet Engine.&nbsp;\r\nThis includes 
  binaries, all code, a build enviroment and instructions on\r\nhow to install and run.\r\n\r\n</body>\r\n</html>\r\n") 
 ; 
             // end 
         } catch (Exception ex) { 
             if (out.getBufferSize() != 0) 
                 out.clearBuffer(); 
             pageContext.handlePageException(ex); 
         } finally { 
             out.flush(); 
             _jspxFactory.releasePageContext(pageContext); 
         } 
     } 
 } 
 
 
-- 
 
 
       维特根斯坦: 对不能说出的我们只能沉默。 
 
※ 来源:·BBS 水木清华站 smth.org·[FROM: czhou.math.tsin] 

BBS水木清华站∶精华区