{"id":1422,"date":"2013-11-15T17:15:07","date_gmt":"2013-11-15T21:15:07","guid":{"rendered":"http:\/\/blog.litespeedtech.com\/?p=1422"},"modified":"2013-11-15T17:15:07","modified_gmt":"2013-11-15T21:15:07","slug":"litespeed-suexec-40x-faster-than-apache-suphp-new-php-benchmarks","status":"publish","type":"post","link":"https:\/\/lswp.store\/index.php\/2013\/11\/15\/litespeed-suexec-40x-faster-than-apache-suphp-new-php-benchmarks\/","title":{"rendered":"LiteSpeed suEXEC 40x Faster than Apache suPHP! New PHP Benchmarks"},"content":{"rendered":"<p><a href=\"http:\/\/blog.litespeedtech.com\/wp-content\/uploads\/2013\/11\/PHP-Hello-World-Benchmark-Screen-Shot2.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-1506\" src=\"http:\/\/blog.litespeedtech.com\/wp-content\/uploads\/2013\/11\/PHP-Hello-World-Benchmark-Screen-Shot2.png\" alt=\"This benchmark shows just how much better LiteSpeed's PHP performance is than the competitors\" width=\"836\" height=\"660\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2013\/11\/PHP-Hello-World-Benchmark-Screen-Shot2.png 836w, https:\/\/lswp.store\/wp-content\/uploads\/2013\/11\/PHP-Hello-World-Benchmark-Screen-Shot2-300x237.png 300w, https:\/\/lswp.store\/wp-content\/uploads\/2013\/11\/PHP-Hello-World-Benchmark-Screen-Shot2-768x606.png 768w, https:\/\/lswp.store\/wp-content\/uploads\/2013\/11\/PHP-Hello-World-Benchmark-Screen-Shot2-600x474.png 600w\" sizes=\"(max-width: 836px) 100vw, 836px\" \/><\/a>LiteSpeed&#8217;s latest benchmarks show overwhelming superiority in PHP performance over Apache and nginx.<!--more--><\/p>\n<p>With the second in our series of new benchmarks, we&#8217;ve pit many different PHP setups against each other for serving a small PHP hello world script. The contestants:<\/p>\n<ul>\n<li>LiteSpeed Web Server Enterprise 4.2.5 with\u00a0<a href=\"http:\/\/www.litespeedtech.com\/products\/litespeed-sapi\/php\/suexec-daemon-mode\">suEXEC daemon mode<\/a><\/li>\n<li>LiteSpeed Web Server Enterprise 4.2.5 with\u00a0<a href=\"http:\/\/www.litespeedtech.com\/products\/litespeed-sapi\/php\/suexec-workergroup\">ProcessGroup<\/a><\/li>\n<li>LiteSpeed Web Server Enterprise 4.2.5 with PHP-FPM<\/li>\n<li>OpenLiteSpeed 1.2.6<\/li>\n<li>nginx 1.4.3 with PHP-FPM<\/li>\n<li>Apache 2.2.25 with PHP-FPM<\/li>\n<li>Apache 2.4.6 with PHP-FPM<\/li>\n<li>Apache 2.2.25 with mod_PHP<\/li>\n<li>Apache 2.2.25 with suPHP<\/li>\n<li>Apache 2.4.6 with suPHP<\/li>\n<\/ul>\n<p>The results here were even more staggering than our <a title=\"New Benchmarks! LiteSpeed vs. Apache vs. nginx for Static Content\" href=\"http:\/\/blog.litespeedtech.com\/2013\/11\/12\/new-benchmarks-litespeed-vs-apache-vs-nginx-for-static-content\/\">small static file benchmarks<\/a>, with LiteSpeed more than <strong>40 x faster than Apache with suPHP<\/strong> and about <strong>twice as fast as Apache or nginx with PHP-FPM<\/strong>.<\/p>\n<p><strong>Full results for our <a href=\"http:\/\/www.litespeedtech.com\/products\/litespeed-web-server\/benchmarks\/php-hello-world\">PHP Hello World benchmark<\/a>.<\/strong><\/p>\n<h3>Highlights<\/h3>\n<p>Again, LSWS Enterprise showed the greatest gains with keep-alive connections enabled. LiteSpeed Enterprise (with either suEXEC daemon mode or ProcessGroup) was:<\/p>\n<ul>\n<li><strong>3885%<\/strong>\u00a0faster than Apache 2.2 using suPHP.<\/li>\n<li><strong>4506%<\/strong>\u00a0faster than Apache 2.4 using suPHP.<\/li>\n<li><strong>50%<\/strong>\u00a0faster than Apache 2.2 with mod_PHP.<\/li>\n<li><strong>273%<\/strong>\u00a0faster than Apache 2.2 with PHP-FPM.<\/li>\n<li><strong>203%<\/strong>\u00a0faster than Apache 2.4 with PHP-FPM.<\/li>\n<li><strong>86%<\/strong>\u00a0faster than nginx with PHP-FPM.<\/li>\n<li><strong>16%<\/strong>\u00a0faster than LiteSpeed Enterprise with PHP-FPM.<\/li>\n<li>slightly faster than OpenLiteSpeed.<\/li>\n<\/ul>\n<p>LiteSpeed Enterprise tested essentially the same with suEXEC Daemon mode and ProcessGroup in both tests.<\/p>\n<h3>Discussion<\/h3>\n<p>This test suggests a number of points:<\/p>\n<ol>\n<li><strong>First and foremost, LiteSpeed is faster at serving PHP than all other web servers.<\/strong>\u00a0No matter the setup, even when using the same PHP-FPM backend, LiteSpeed Enterprise and OpenLiteSpeed handily beat all comers. Our code is just more optimized.<\/li>\n<li><strong>LSAPI is still faster than FCGI.<\/strong> PHP-FPM uses FCGI. suEXEC Daemon mode and ProcessGroup both use <a href=\"http:\/\/www.litespeedtech.com\/products\/litespeed-sapi\/php\">LSAPI<\/a>, LiteSpeed&#8217;s unique server API, for communication with the PHP engine. In the tests, switching LiteSpeed to PHP-FPM caused a significant decrease in performance.<\/li>\n<li><strong>LiteSpeed is particularly great if you need suEXEC (for shared hosting, for example). <\/strong>Hosters running suPHP should take note \u2014 running LiteSpeed&#8217;s suEXEC daemon mode is incomparably more powerful. There are many reasons for this difference: suPHP uses CGI whereas suEXEC daemon mode uses LSAPI. suPHP spawns a brand new process for each PHP task. This is far slower and more resource-intensive than suEXEC daemon mode&#8217;s one parent process forking new child processes. And, as always, LSWS is just coded for more performance than Apache. (And even if you&#8217;re running PHP-FPM pools, the difference with LiteSpeed suEXEC daemon or ProcessGroup is remarkable.)<\/li>\n<\/ol>\n<p>In the test we tried to remove as many other variables as we could, using the same hardware and purposely keeping the script size miniscule. The goal was to demonstrate pure speed differences when serving PHP. As we noted in the last test, this is just one facet of web service. We are building up to more complex situations, including web applications.<\/p>\n<p>We&#8217;re very interested in your feedback. Get in touch with us on\u00a0<a href=\"http:\/\/www.litespeedtech.com\/support\/forum\/\">our forum<\/a>. You can find the test configurations and hardware specs with the benchmark results. We&#8217;d be happy to hear any objections you have. We encourage you to reproduce the test yourself and suggest any changes you would like to see.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LiteSpeed&#8217;s latest benchmarks show overwhelming superiority in PHP performance over Apache and nginx.<\/p>\n","protected":false},"author":1,"featured_media":1506,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[16,27,29],"tags":[],"class_list":["post-1422","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-benchmarks","category-web-server","category-openlitespeed"],"jetpack_featured_media_url":"https:\/\/lswp.store\/wp-content\/uploads\/2013\/11\/PHP-Hello-World-Benchmark-Screen-Shot2.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/1422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/comments?post=1422"}],"version-history":[{"count":0,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/1422\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media\/1506"}],"wp:attachment":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media?parent=1422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/categories?post=1422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/tags?post=1422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}