Costin Manolache wrote:
If you're worried about risk, then probably glueing PHP with tomcat will be a bad choice.
Tomcat is limited by Java's bad support for integration with native code. Apache will have no problem running Php, perl, python, .net or integrating with any native library that exists today. For tomcat running openSSL seems to be a big thing, and we know too well how difficult it is to get it working with JNI.
For tomcat - you can attempt to rewrite/replace every feature in Java ( we are doing this for LDAP auth for example - not sure if JNDI is better or faster than the native ldap auth in apache ). Or you can try to use JNI or connectors - like mod_jk. Or you can just use what already works and is stable, and do something better with your time :-)
We'll see the result when it's done :) If Mladen wants to try it because he feels like he has a need for it, it's fine by me.
And there is the maintainability, scalability, etc. which I think Java is
better at.
Well I made some benchmarks on TC 3.3.2, TC 4.1.30, TC 5.0.19, Apache 2, mod_php 4.3.5 and mod_php 5.0RC1 this week-end and you could see that to serve the good old HelloWorld (or its html/php counter part), Java is allways faster.
This 'bench' has been conducted on a Pentium 4 with 512Mo RAM , Windows XP and Sun SDK 1.4.2-04.
I used each time the default server configurations.
Regards
Tomcat 3.3.2 / Coyote HTTP 1.1
Server Software: Apache-Coyote/1.1 Server Hostname: 127.0.0.1 Server Port: 8080 Document Path: /examples/servlet/HelloWorldExample Document Length: 419 bytes Concurrency Level: 16 Time taken for tests: 1.902736 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 546000 bytes HTML transferred: 419000 bytes Requests per second: 525.56 [#/sec] (mean) Time per request: 30.444 [ms] (mean) Time per request: 1.903 [ms] (mean, across all concurrent requests) Transfer rate: 280.12 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 2.8 0 10 Processing: 0 28 5.1 30 50 Waiting: 0 14 9.6 10 40 Total: 0 29 4.7 30 50 Percentage of the requests served within a certain time (ms) 50% 30 66% 30 75% 30 80% 30 90% 30 95% 40 98% 40 99% 40 100% 50 (longest request) --- Tomcat 4.1.30 / Coyote HTTP 1.1 Server Software: Apache-Coyote/1.1 Server Hostname: 127.0.0.1 Server Port: 8080 Document Path: /examples/servlet/HelloWorldExample Document Length: 411 bytes Concurrency Level: 16 Time taken for tests: 2.143081 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 559000 bytes HTML transferred: 411000 bytes Requests per second: 466.62 [#/sec] (mean) Time per request: 34.289 [ms] (mean) Time per request: 2.143 [ms] (mean, across all concurrent requests) Transfer rate: 254.31 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 1 3.0 0 10 Processing: 10 32 5.3 30 50 Waiting: 0 16 10.7 20 50 Total: 10 33 5.6 30 50 Percentage of the requests served within a certain time (ms) 50% 30 66% 40 75% 40 80% 40 90% 40 95% 40 98% 40 99% 50 100% 50 (longest request) --- Tomcat 5.0.19 / Coyote HTTP 1.1 Server Software: Apache-Coyote/1.1 Server Hostname: 127.0.0.1 Server Port: 8080 Document Path: /servlets-examples/servlet/HelloWorldExample Document Length: 365 bytes Concurrency Level: 16 Time taken for tests: 2.173125 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 513000 bytes HTML transferred: 365000 bytes Requests per second: 460.17 [#/sec] (mean) Time per request: 34.770 [ms] (mean) Time per request: 2.173 [ms] (mean, across all concurrent requests) Transfer rate: 230.08 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 3.1 0 20 Processing: 0 33 6.1 30 60 Waiting: 0 16 10.7 20 50 Total: 0 34 6.5 30 60 Percentage of the requests served within a certain time (ms) 50% 30 66% 40 75% 40 80% 40 90% 40 95% 40 98% 50 99% 60 100% 60 (longest request) --- Apache 2.0.49 (Windows) Server Software: Apache/2.0.49 Server Hostname: 127.0.0.1 Server Port: 80 Document Path: /helloworld.html Document Length: 365 bytes Concurrency Level: 16 Time taken for tests: 2.633787 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 650000 bytes HTML transferred: 365000 bytes Requests per second: 379.68 [#/sec] (mean) Time per request: 42.141 [ms] (mean) Time per request: 2.634 [ms] (mean, across all concurrent requests) Transfer rate: 240.72 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 2.0 0 10 Processing: 10 41 6.5 40 70 Waiting: 10 40 6.6 40 70 Total: 10 41 6.5 40 70 Percentage of the requests served within a certain time (ms) 50% 40 66% 40 75% 40 80% 40 90% 50 95% 50 98% 60 99% 70 100% 70 (longest request) --- Apache 2.0.49 / jk 1.2.5 / Tomcat 3.3.2 (Windows) Server Software: Apache/2.0.49 Server Hostname: 127.0.0.1 Server Port: 80 Document Path: /examples/servlet/HelloWorldExample Document Length: 419 bytes Concurrency Level: 16 Time taken for tests: 2.393442 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 583000 bytes HTML transferred: 419000 bytes Requests per second: 417.81 [#/sec] (mean) Time per request: 38.295 [ms] (mean) Time per request: 2.393 [ms] (mean, across all concurrent requests) Transfer rate: 237.73 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 2.6 0 10 Processing: 0 36 5.4 40 50 Waiting: 0 20 11.6 20 40 Total: 0 37 5.1 40 50 Percentage of the requests served within a certain time (ms) 50% 40 66% 40 75% 40 80% 40 90% 40 95% 40 98% 40 99% 50 100% 50 (longest request) --- Apache 2.0.49 / jk 1.2.5 / Tomcat 4.1.30 (Windows) Server Software: Apache/2.0.49 Server Hostname: 127.0.0.1 Server Port: 80 Document Path: /examples/servlet/HelloWorldExample Document Length: 411 bytes Concurrency Level: 16 Time taken for tests: 2.733932 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 596000 bytes HTML transferred: 411000 bytes Requests per second: 365.77 [#/sec] (mean) Time per request: 43.743 [ms] (mean) Time per request: 2.734 [ms] (mean, across all concurrent requests) Transfer rate: 212.88 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 2.8 0 10 Processing: 10 42 5.1 40 60 Waiting: 0 20 13.0 20 50 Total: 10 43 5.4 40 60 Percentage of the requests served within a certain time (ms) 50% 40 66% 40 75% 50 80% 50 90% 50 95% 50 98% 50 99% 50 100% 60 (longest request) --- Apache 2.0.49 / jk 1.2.5 / Tomcat 5.0.19 (Windows) Server Software: Apache/2.0.49 Server Hostname: 127.0.0.1 Server Port: 80 Document Path: /servlets-examples/servlet/HelloWorldExample Document Length: 365 bytes Concurrency Level: 16 Time taken for tests: 2.663831 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 550000 bytes HTML transferred: 365000 bytes Requests per second: 375.40 [#/sec] (mean) Time per request: 42.621 [ms] (mean) Time per request: 2.664 [ms] (mean, across all concurrent requests) Transfer rate: 201.59 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 2.6 0 10 Processing: 0 41 4.7 40 50 Waiting: 0 19 12.8 20 50 Total: 0 41 5.1 40 50 Percentage of the requests served within a certain time (ms) 50% 40 66% 40 75% 40 80% 50 90% 50 95% 50 98% 50 99% 50 100% 50 (longest request) --- Apache 2.0.49 / PHP 4.3.5 (Windows) Server Software: Apache/2.0.49 Server Hostname: 127.0.0.1 Server Port: 80 Document Path: /helloworld.php Document Length: 357 bytes Concurrency Level: 16 Time taken for tests: 4.706768 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 556000 bytes HTML transferred: 357000 bytes Requests per second: 212.46 [#/sec] (mean) Time per request: 75.308 [ms] (mean) Time per request: 4.707 [ms] (mean, across all concurrent requests) Transfer rate: 115.15 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 2.9 0 20 Processing: 10 73 7.0 70 90 Waiting: 0 35 21.9 40 80 Total: 10 74 7.2 70 100 Percentage of the requests served within a certain time (ms) 50% 70 66% 80 75% 80 80% 80 90% 80 95% 80 98% 80 99% 90 100% 100 (longest request) --- Apache 2.0.49 / PHP 5.0RC1 (Windows) Server Software: Apache/2.0.49 Server Hostname: 127.0.0.1 Server Port: 80 Document Path: /helloworld.php Document Length: 357 bytes Concurrency Level: 16 Time taken for tests: 7.410656 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 562000 bytes HTML transferred: 357000 bytes Requests per second: 134.94 [#/sec] (mean) Time per request: 118.570 [ms] (mean) Time per request: 7.411 [ms] (mean, across all concurrent requests) Transfer rate: 73.95 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 2.1 0 10 Processing: 20 116 10.9 120 170 Waiting: 20 116 10.8 120 170 Total: 20 117 10.9 120 170 Percentage of the requests served within a certain time (ms) 50% 120 66% 120 75% 120 80% 120 90% 120 95% 130 98% 130 99% 160 100% 170 (longest request)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]