Re: [PHP-SOAP-DEV] some benchmarks.
Status: Alpha
Brought to you by:
rodif_bl
From: brad l. <rod...@ya...> - 2002-05-03 15:25:00
|
This sounds good :).. I did some benchmarks before too.. I did a <? echo "hello world"; ?> vs <? $server = new SoapServer(); $server->handle(); function hello() { return "hello world"; } ?> I don't remember exactly what my resutls were but they weren't far off from each other... like 350 requests vs 400 or 450... I have every intension to keep the base code as fast as possible. Adding wsdl validation and other stuff will slow down the code but for the most part I am going to keep speed in mind at every release. Expecially if you don't use wsdl's.. when you are talking php -> php it will be briliantly fast. Lets not forget what code is easiest to read :) This is another huge part im trying to push. Maybe i can get my benchmarking page functional so we can start posting these benchmarks. I fixed some more bugs last nite stuff having to do with wsdl server binding. And i was serializing the Map type wrong. I am trying to track down a random segfault. Man its pissing me off. I will feel pretty releaved when i get that little bastard. _ brad _ --- Andrey Hristov <ahr...@ic...> wrote: > Ok. I realized. You meant dl('php_soap.so'); > I've done some benchmarks this night but due to problems with my 2.5 years > old windows 95 install I had no way to connect and send the results. I've > also noticed the problem. See the results. There you can see that 12 errors > on about 3600 request. > Here are the results. I've no other suitable for mass testing tool - only > ab. > I did 3 benchmarks using the 'ab' tool (v. 1.3d) > 1)Benchmarking PHP-SOAP extention: > client script: > hello_world_client.php > <?php > echo microtime()."<br>\n"; > $hello = new SoapObject("http://192.168.1.140/hello_world_server.php", > "urn:HelloWord"); > $hello->hello_soap("alala"); > echo microtime()."<br>\n"; > ?> > server script: > hello_world_server.php > <?php > $server = new SoapServer("urn:HelloWord"); > $server->addfunction("hello_soap"); > $server->handle(); > function hello_soap($message){ > return "PHP-SOAP says ($message)"; > } > ?> > Results: > Concurrency Level: 5 > Time taken for tests: 60.004 seconds > Complete requests: 3645 > Failed requests: 12 > (Connect: 0, Length: 12, Exceptions: 0) > Broken pipe errors: 0 > Total transferred: 1057608 bytes > HTML transferred: 189384 bytes > Requests per second: 60.75 [#/sec] (mean) > Time per request: 82.31 [ms] (mean) > Time per request: 16.46 [ms] (mean, across all concurrent requests) > Transfer rate: 17.63 [Kbytes/sec] received > > Connnection Times (ms) > min mean[+/-sd] median max > Connect: 0 0 3.4 0 63 > Processing: 14 81 70.1 55 432 > Waiting: 1 81 70.2 55 432 > Total: 14 82 70.0 56 432 > > Percentage of the requests served within a certain time (ms) > 50% 56 > 66% 98 > 75% 127 > 80% 144 > 90% 185 > 95% 222 > 98% 263 > 99% 283 > 100% 432 (last request) > > > 2)Benchmarking XMLRPC extension. Mix of compiled routines and userspache > functions(socket openings). > client script: > <?php > require 'link_to_defs.php'; > require SITE_LIB.'xmlrpc-utils.php'; > echo microtime()."<br>\n"; > $some = xu_rpc_http("fub",array(array('one'=>"someone"),"like","you"), > SITE_DOMAIN, SITE_PATH.'server.php',80,0);// SITE_DOMAIN is 192.168.1.1.40 & > SITE_PATH is "/" > echo microtime()."<br>\n"; > ?> > server script: > <?php > require 'link_to_defs.php'; > require SITE_LIB."xmlrpc-utils.php"; > function greeting_func($method_name, $params, $app_data) { > $name = $params[0]; > return array("hello $name. How are you today?"); > } > $xmlrpc_server = xmlrpc_server_create(); > if($xmlrpc_server) { > // register methods > > if(!xmlrpc_server_register_method($xmlrpc_server, "greeting", > "greeting_func")) { > die("<h2>method registration failed.</h2>"); > } > $request_xml = $HTTP_RAW_POST_DATA; > $foo = xmlrpc_server_call_method($xmlrpc_server, $request_xml, $response, > array(output_type => "xml")); > xu_server_send_http_response($foo); > $success = xmlrpc_server_destroy($xmlrpc_server); > } > ?> > Results: > > Concurrency Level: 5 > Time taken for tests: 60.082 seconds > Complete requests: 1392 > Failed requests: 0 > Broken pipe errors: 0 > Total transferred: 403970 bytes > HTML transferred: 72436 bytes > Requests per second: 23.17 [#/sec] (mean) > Time per request: 215.81 [ms] (mean) > Time per request: 43.16 [ms] (mean, across all concurrent requests) > Transfer rate: 6.72 [Kbytes/sec] received > > Connnection Times (ms) > min mean[+/-sd] median max > Connect: 0 0 0.5 0 11 > Processing: 41 215 92.6 211 746 > Waiting: 41 215 92.6 210 745 > Total: 41 215 92.7 211 753 > > Percentage of the requests served within a certain time (ms) > 50% 211 > 66% 245 > 75% 270 > 80% 289 > 90% 332 > 95% 374 > 98% 424 > 99% 495 > 100% 753 (last request) > > 3)NuSOAP library - fully user space. > client script (I got it from the NuSOAP package): > nusoap_client.php: > <?php > echo microtime()."<br>\n"; > require_once('nusoap.php'); > $parameters = array('name'=>'dietrich'); > $soapclient = new soapclient('http://192.168.1.140/nusoap_server.php'); > $soapclient->call('hello',$parameters); > echo microtime()."<br>\n"; > ?> > server script: > <?php > require_once('nusoap.php'); > $s = new soap_server; > $s->register('hello'); > function hello($name){ > if($name == ''){ > return new soap_fault('Client','','Must supply a valid name.'); > } > return "hello $name!"; > } > $s->service($HTTP_RAW_POST_DATA); > ?> > Results: > > Concurrency Level: 5 > Time taken for tests: 60.064 seconds > Complete requests: 165 > Failed requests: 0 > Broken pipe errors: 0 > Total transferred: 48140 bytes > HTML transferred: 8632 bytes > Requests per second: 2.75 [#/sec] (mean) > Time per request: 1820.12 [ms] (mean) > Time per request: 364.02 [ms] (mean, across all concurrent requests) > Transfer rate: 0.80 [Kbytes/sec] received > > Connnection Times (ms) > min mean[+/-sd] median max > Connect: 0 0 0.0 0 0 > Processing: 1316 1779 153.2 1778 2920 > Waiting: 1316 1779 153.1 1778 2919 > Total: 1316 1779 153.2 1778 2920 > > Percentage of the requests served within a certain time (ms) > 50% 1778 > 66% 1804 > 75% 1860 > 80% 1871 > 90% 1951 > 95% 1973 > 98% 2061 > 99% 2120 > 100% 2920 (last request) > > > CONCLUSIONS: > As you may see the SOAP extension is the fastest. It is roughly 3 times > faster than XMLRPC and more than 30 times faster than NuSOAP. > However PHP-SOAP is in the beggining of its life so it might become slower > but might faster. > The testing configuration is: > Hwd: AMD K6-2/300;96MB RAM PC100;Chaintech AGM2 MB;Fujitsu 4.3GB HDD > OS : Linux Mandrake. Kernel 2.4.18. > Http server : Apache 1.3.23 (this comes with Mandrake 8.2)/PHP 4.0.2RC2 > > The testing machine is slow for today's standarts but PHP-SOAP is working > fast. K6-2/300 is about 2-3 times slower than PIII/500. Think about new > machine at 1.6Ghz. > > > Andrey > === message truncated === __________________________________________________ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com |