{"id":177,"date":"2015-03-16T19:46:36","date_gmt":"2015-03-16T19:46:36","guid":{"rendered":"https:\/\/www.fastcomet.com\/blog\/?p=177"},"modified":"2022-06-10T08:00:24","modified_gmt":"2022-06-10T08:00:24","slug":"apc-xcache-eaccelerator-shared-hosting","status":"publish","type":"post","link":"https:\/\/www.fastcomet.com\/blog\/apc-xcache-eaccelerator-shared-hosting","title":{"rendered":"APC, XCache, and eAccelerator Available on Shared Hosting"},"content":{"rendered":"\n<p class=\"has-drop-cap\">Remember that one time you asked your host for APC or eAceelerator? Most probably they have directed you to their VPS or Dedicated servers because Opcode caching is not compatible with shared hosting. Well, we have to admit we did this too. We did not like it but that was the reality back then. Not anymore!<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>We are glad to announce the successful implementation of mod_lsapi on all shared hosting servers which will greatly improve your website performance and introduce some great new features. But before we go into this any further, let&#8217;s first discuss some common problems, so we can give real context to this announcement.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-problem\">The Problem<\/h2>\n\n\n\n<p>Of course, the ultimate goal when we speak about website optimization is faster page speed and lower resource consumption, so your website can handle more simultaneous visitors without the need to upgrade your plan. Still, every improvement has some sort of trade-off. For example, OpCode Caching such as APC (made obsolete after inclusion of opcache in php 5.5+ ), XCache (only works up to PHP 5.6), and eAccelerator (works up to PHP 5.4) is not compatible with suPHP, which provides a security layer on the shared hosting environment. So, usually the problem is performance, security, compatibility &#8211; pick two &#8211; you can&#8217;t have them all.<\/p>\n\n\n\n<p>Some pretty secure and fast configurations are simply incompatible with some Open Source applications which are a huge problem for the shared hosting environment as different customers use different software platforms to build their websites.<\/p>\n\n\n\n<p>The most secure and user-friendly setup, on the other hand, does not really provide the performance and features we need.<\/p>\n\n\n\n<p>And last but not least, a high-performance host with great compatibility is pretty much useless if it is not secure.<\/p>\n\n\n\n<p>After reviewing a large number of different options and our current infrastructure, we were pretty unhappy with this &#8220;pick-two&#8221; situation:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"text-align: justify;\"><strong>RUID2 + mod_php<\/strong> &#8211; is a giant security hole that lets any user get a root account<\/li><li style=\"text-align: justify;\"><strong>MPM ITK<\/strong> &#8211; is very slow, as it kills processes after each request<\/li><li style=\"text-align: justify;\"><strong>suPHP &amp; CGI<\/strong> &#8211; are both slow, as they start PHP on each request. They are also incompatible with opcode caching.<\/li><li style=\"text-align: justify;\"><strong>FastCGI<\/strong> &#8211; creates a lot of stability issues, hard to configure due to the way it handles processes, and doesn&#8217;t use opcode caching optimally.<\/li><li style=\"text-align: justify;\"><strong>PHP-FPM<\/strong> &#8211; needs a socket\/startup per customer, not that stable with Apache and creates a mess when we tried to integrate it with PHP Selector &#8211; as now PHP selector would have to restart PHP-FPM processes.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-opcode-caching\">What is OpCode Caching<\/h2>\n\n\n\n<p>For those of you that are not familiar with opcode caching, OpCache caches are a performance-enhancing extension for PHP. They do this by injecting themselves into the execution lifecycle of PHP and caching the results of the compilation phase for later reuse. It is not uncommon to see a 3x performance increase just by enabling an OpCode cache.<\/p>\n\n\n\n<p>This is achieved by skipping the compilation of already compiled PHP scripts as shown in the diagram below:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"650\" src=\"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/OpCode-Caching.jpg\" alt=\"What is OpCode Caching Diagram\" class=\"wp-image-966\" srcset=\"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/OpCode-Caching.jpg 770w, https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/OpCode-Caching-300x253.jpg 300w, https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/OpCode-Caching-768x648.jpg 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure>\n<\/div>\n\n\n<p>Almost all of the most popular applications such as <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/www.fastcomet.com\/magento-hosting\" target=\"_blank\">Magento<\/a>, <a href=\"https:\/\/www.fastcomet.com\/prestashop-hosting\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">PrestaShop<\/a>, Boonex <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/www.fastcomet.com\/dolphin-hosting\" target=\"_blank\">Dolphin <\/a>and <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/www.fastcomet.com\/joomla-hosting\" target=\"_blank\">Joomla <\/a>support OpCaches which makes it extremely important to deliver this feature to our customers, so they can get full advantage of both their hosting service and application built-in optimization features.<\/p>\n\n\n\n<p>After a long research process and testing, we decided to implement the CloudLinux solution &#8211; mod_lsapi &#8211; a new Apache module to serve PHP.<\/p>\n\n\n\n<p><strong>Some of the benefits of mod_lsapi comparing to other ways to serve PHP:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"text-align: justify;\">Speed &#8211; <strong>it is faster than any other way to serve PHP<\/strong> with Apache (or at least on cPanel-based host)<\/li><li style=\"text-align: justify;\">Stability &#8211; it doesn&#8217;t suffer from stability issues in process management like PHP-FPM<\/li><li style=\"text-align: justify;\">Utilizes full benefits of opcode caching &#8211; <strong>Yes, you can have APC, eAccelerator, and XCache now!<\/strong><\/li><li style=\"text-align: justify;\">MPM Worker &amp; Event compatible<\/li><li style=\"text-align: justify;\">Support for PHP directives in .htaccess files (no more error 500 for you)<\/li><li style=\"text-align: justify;\">Drop-in replacement for existing ways to serve PHP (Extremely easy to implement)<\/li><li style=\"text-align: justify;\">Fully compatible with PHP Selector &#8211; a very important note so you can still change your account PHP version!<\/li><li style=\"text-align: justify;\">PHP version can be altered per directory &#8211; <strong>You can have different PHP versions for different folders of your account!<\/strong><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-does-it-work\">How Does It Work<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"490\" src=\"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/OpCode-Caching2.jpg\" alt=\"\" class=\"wp-image-967\" srcset=\"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/OpCode-Caching2.jpg 770w, https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/OpCode-Caching2-300x191.jpg 300w, https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/OpCode-Caching2-768x489.jpg 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure>\n<\/div>\n\n\n<p><code>mod_lsapi<\/code> diagram<\/p>\n\n\n\n<p><code>mod_lsapi<\/code> is a part of Apache;<\/p>\n\n\n\n<p>Apache passes handling for PHP request to <code>mod_lsapi<\/code>;<\/p>\n\n\n\n<p><code>mod_lsapi<\/code> uses <code>liblsapi<\/code> to transfers request <code>lsphp<\/code> daemon;<\/p>\n\n\n\n<p><code>sulsphp<\/code> is used to do security checks and start process pool;<\/p>\n\n\n\n<p><code>lsphp<\/code> processes request and return data to <code>mod_lsapi<\/code>;<\/p>\n\n\n\n<p>Each user has <code>lsphp<\/code> processes in separate CageFS\/LVE;<\/p>\n\n\n\n<p>If there are no requests for <code>lsapi_backend_pgrp_max_idle<\/code> seconds, lsphp process is terminated;<\/p>\n\n\n\n<p>If no <code>lsphp<\/code> processes available when a new request comes, a new <code>lsphp<\/code> process is created;<\/p>\n\n\n\n<p>lsphp can process requests<code>lsapi_backend_children<\/code> simultaneously.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-the-conclusion\">The Conclusion<\/h3>\n\n\n\n<p>With the newly deployed setup configuration, all FastComet clients on our shared hosting environment can take full advantage of opcode caching without sacrificing security. Additionally, with the new mod_lsapi, your website should run faster than with any other Apache PHP handler. So far we have tested more than 150 Open Source applications and the results are more than promising. Still, if you experience any difficulties with the new setup or need help to take full advantage of the OpCode caching, feel free to contact our 24\/7 technical support. Thanks to the flexible setup we can revert or apply changes per account base so you will never be stuck with one or another solution.<\/p>\n\n\n\n<p>Very soon we will publish full-length tutorials on how to enable all new features and optimize your website performance for the most popular platforms such as Magento, PrestaShop, WordPress, Dolphin and many more so stay tuned for further updates.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Remember that one time you asked your host for APC or eAceelerator? Most probably they have directed you to their VPS or Dedicated servers because Opcode caching is not compatible with shared hosting. Well, we have to admit we did this too. We did not like it but that was the reality back then. Not [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":580,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4726,4723],"tags":[91,92,93,94,24,95,62,96,64,97],"class_list":["post-177","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-service-updates","category-hosting","tag-apache","tag-apc","tag-caching","tag-eaccelerator","tag-hosting","tag-lsapi","tag-magento","tag-opcache","tag-prestashop","tag-xcache"],"featured_image_src":"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/cache.jpg","author_info":{"display_name":"Georgi Y.","author_link":"https:\/\/www.fastcomet.com\/blog\/author\/fcometadm"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>APC, XCache, and eAccelerator Available on Shared Hosting | FastComet<\/title>\n<meta name=\"description\" content=\"Mod_lsapi is now available on all \u261b FastComet \u261a SSD Cloud Hosting packages. Get \u2713Excellent PHP performance and \u2713Low memory footprint.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.fastcomet.com\/blog\/apc-xcache-eaccelerator-shared-hosting\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"APC, XCache, and eAccelerator Available on Shared Hosting | FastComet\" \/>\n<meta property=\"og:description\" content=\"Mod_lsapi is now available on all \u261b FastComet \u261a SSD Cloud Hosting packages. Get \u2713Excellent PHP performance and \u2713Low memory footprint.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.fastcomet.com\/blog\/apc-xcache-eaccelerator-shared-hosting\" \/>\n<meta property=\"og:site_name\" content=\"FastComet Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-03-16T19:46:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-10T08:00:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/cache.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"576\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Georgi Y.\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Georgi Y.\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"APC, XCache, and eAccelerator Available on Shared Hosting | FastComet","description":"Mod_lsapi is now available on all \u261b FastComet \u261a SSD Cloud Hosting packages. Get \u2713Excellent PHP performance and \u2713Low memory footprint.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.fastcomet.com\/blog\/apc-xcache-eaccelerator-shared-hosting","og_locale":"en_US","og_type":"article","og_title":"APC, XCache, and eAccelerator Available on Shared Hosting | FastComet","og_description":"Mod_lsapi is now available on all \u261b FastComet \u261a SSD Cloud Hosting packages. Get \u2713Excellent PHP performance and \u2713Low memory footprint.","og_url":"https:\/\/www.fastcomet.com\/blog\/apc-xcache-eaccelerator-shared-hosting","og_site_name":"FastComet Blog","article_published_time":"2015-03-16T19:46:36+00:00","article_modified_time":"2022-06-10T08:00:24+00:00","og_image":[{"width":1024,"height":576,"url":"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/cache.jpg","type":"image\/jpeg"}],"author":"Georgi Y.","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Georgi Y.","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.fastcomet.com\/blog\/apc-xcache-eaccelerator-shared-hosting","url":"https:\/\/www.fastcomet.com\/blog\/apc-xcache-eaccelerator-shared-hosting","name":"APC, XCache, and eAccelerator Available on Shared Hosting | FastComet","isPartOf":{"@id":"https:\/\/www.fastcomet.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.fastcomet.com\/blog\/apc-xcache-eaccelerator-shared-hosting#primaryimage"},"image":{"@id":"https:\/\/www.fastcomet.com\/blog\/apc-xcache-eaccelerator-shared-hosting#primaryimage"},"thumbnailUrl":"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/cache.jpg","datePublished":"2015-03-16T19:46:36+00:00","dateModified":"2022-06-10T08:00:24+00:00","author":{"@id":"https:\/\/www.fastcomet.com\/blog\/#\/schema\/person\/a896519f2c7aee13cbc26ad35bf5d6c3"},"description":"Mod_lsapi is now available on all \u261b FastComet \u261a SSD Cloud Hosting packages. Get \u2713Excellent PHP performance and \u2713Low memory footprint.","breadcrumb":{"@id":"https:\/\/www.fastcomet.com\/blog\/apc-xcache-eaccelerator-shared-hosting#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.fastcomet.com\/blog\/apc-xcache-eaccelerator-shared-hosting"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fastcomet.com\/blog\/apc-xcache-eaccelerator-shared-hosting#primaryimage","url":"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/cache.jpg","contentUrl":"https:\/\/www.fastcomet.com\/blog\/wp-content\/uploads\/2015\/03\/cache.jpg","width":1024,"height":576},{"@type":"BreadcrumbList","@id":"https:\/\/www.fastcomet.com\/blog\/apc-xcache-eaccelerator-shared-hosting#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.fastcomet.com\/blog"},{"@type":"ListItem","position":2,"name":"APC, XCache, and eAccelerator Available on Shared Hosting"}]},{"@type":"WebSite","@id":"https:\/\/www.fastcomet.com\/blog\/#website","url":"https:\/\/www.fastcomet.com\/blog\/","name":"FastComet Blog","description":"FastComet Web Hosting Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.fastcomet.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.fastcomet.com\/blog\/#\/schema\/person\/a896519f2c7aee13cbc26ad35bf5d6c3","name":"Georgi Y.","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fastcomet.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e9ab55a681994420c801d3009dd5013edaf99e0083ce8ecb527bd7863257c962?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e9ab55a681994420c801d3009dd5013edaf99e0083ce8ecb527bd7863257c962?s=96&d=mm&r=g","caption":"Georgi Y."},"description":"Georgi has a decade of experience as an executive and entrepreneur in the infrastructure and web hosting space. He is responsible for leading FastComet\u2019s evolution of our scalable cloud, powering the business with Big Data, and linking the latest advances in technology to FastComet\u2019s cloud and IT strategy. As a technical guy, he used his expertise to collect the know-how of creating a reliable and customer friendly hosting company to satisfy the increasing demand of clients.","url":"https:\/\/www.fastcomet.com\/blog\/author\/fcometadm"}]}},"_links":{"self":[{"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/posts\/177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/comments?post=177"}],"version-history":[{"count":9,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":7972,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/posts\/177\/revisions\/7972"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/media\/580"}],"wp:attachment":[{"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/media?parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/categories?post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fastcomet.com\/blog\/wp-json\/wp\/v2\/tags?post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}