February 4 2022

Zend OpCache. How to speed up PHP?

We accelerate the performance of our PHP scripts with Caching systems.

PHP Zend OpCache Banner

As web applications become more and more popular, performance is always at the top of the priority list. Caching is a technique that can be used to improve performance. When you have a website that loads fast, it means your audience has a better user experience.

The biggest advantage of caching a PHP script is to avoid running it again if you need to get the same result. This saves time and resources. You can set opcache in your PHP server configuration file.

The two most popular methods of caching are the use of PHP files and the use of opcode caching. The first method is a great way to cache static files, such as CSS or images. This is useful if you don't want to change your site's code to add new features or fix bugs. The second method is also useful for static files, but it also caches page scripts.

Zend OpCache is an opcode cache for PHP applications, which allows you to enable caching on your production sites.

The official definition says:

OPCache improves PHP performance by storing a precompiled bytecode script in shared memory, thus eliminating the need for PHP to load and parse scripts for each request.

Why is it worth activating Zend OpCache?

Let's consider a case where you have a small website with normal traffic, for example 500-5k visitors per day. There are relatively few concurrent active users, 5-10 on average. In this case there are hardly any overload and performance problems, users will not notice slowdowns.

Another case would be a website or application with hundreds of thousands of visitors per second. Here PHP7 OPcache can give strong help in terms of performance, as it drastically reduces the server load and with a few configuration steps you will see serious improvements in speed and performance.

OPcache alone cannot be the solution to all your performance problems. Server settings and configuration also play an important role in maximizing performance. Taking a practical example, a server with 1GB of RAM and 1 CPU can handle about 10 requests per second. By enabling the OPcache PHP system the number quietly increases to 34+ requests per second.

How does Zend OpCache work?

The first time the application runs a script, opcache stores the resulting code in RAM, which means the web server will take less time to process the request and deliver the data to the browser.

The opcode cache works by storing precompiled bytecode scripts in shared memory so that when a script is run for the first time, it will not have to be recompiled and therefore will only need space in RAM. Afterwards, each call to the precompiled script will result in the execution of the same code, because opcache has already stored this code in RAM. This results in significant performance improvements on websites that are constantly under stress and critical to load time.

How Zend OpCache Works

Our hosts boast a high performance software stack that also includes Zend OpCache.

 

Do you have doubts? Don't know where to start? Contact us!

We have all the answers to your questions to help you make the right choice.

Chat with us

Chat directly with our presales support.

0256569681

Contact us by phone during office hours 9:30 - 19:30

Contact us online

Open a request directly in the contact area.

INFORMATION

Managed Server Srl is a leading Italian player in providing advanced GNU/Linux system solutions oriented towards high performance. With a low-cost and predictable subscription model, we ensure that our customers have access to advanced technologies in hosting, dedicated servers and cloud services. In addition to this, we offer systems consultancy on Linux systems and specialized maintenance in DBMS, IT Security, Cloud and much more. We stand out for our expertise in hosting leading Open Source CMS such as WordPress, WooCommerce, Drupal, Prestashop, Joomla, OpenCart and Magento, supported by a high-level support and consultancy service suitable for Public Administration, SMEs and any size.

Red Hat, Inc. owns the rights to Red Hat®, RHEL®, RedHat Linux®, and CentOS®; AlmaLinux™ is a trademark of AlmaLinux OS Foundation; Rocky Linux® is a registered trademark of the Rocky Linux Foundation; SUSE® is a registered trademark of SUSE LLC; Canonical Ltd. owns the rights to Ubuntu®; Software in the Public Interest, Inc. holds the rights to Debian®; Linus Torvalds holds the rights to Linux®; FreeBSD® is a registered trademark of The FreeBSD Foundation; NetBSD® is a registered trademark of The NetBSD Foundation; OpenBSD® is a registered trademark of Theo de Raadt. Oracle Corporation owns the rights to Oracle®, MySQL®, and MyRocks®; Percona® is a registered trademark of Percona LLC; MariaDB® is a registered trademark of MariaDB Corporation Ab; REDIS® is a registered trademark of Redis Labs Ltd. F5 Networks, Inc. owns the rights to NGINX® and NGINX Plus®; Varnish® is a registered trademark of Varnish Software AB. Adobe Inc. holds the rights to Magento®; PrestaShop® is a registered trademark of PrestaShop SA; OpenCart® is a registered trademark of OpenCart Limited. Automattic Inc. owns the rights to WordPress®, WooCommerce®, and JetPack®; Open Source Matters, Inc. owns the rights to Joomla®; Dries Buytaert holds the rights to Drupal®. Amazon Web Services, Inc. holds the rights to AWS®; Google LLC holds the rights to Google Cloud™ and Chrome™; Microsoft Corporation holds the rights to Microsoft®, Azure®, and Internet Explorer®; Mozilla Foundation owns the rights to Firefox®. Apache® is a registered trademark of The Apache Software Foundation; PHP® is a registered trademark of the PHP Group. CloudFlare® is a registered trademark of Cloudflare, Inc.; NETSCOUT® is a registered trademark of NETSCOUT Systems Inc.; ElasticSearch®, LogStash®, and Kibana® are registered trademarks of Elastic NV Hetzner Online GmbH owns the rights to Hetzner®; OVHcloud is a registered trademark of OVH Groupe SAS; cPanel®, LLC owns the rights to cPanel®; Plesk® is a registered trademark of Plesk International GmbH; Facebook, Inc. owns the rights to Facebook®. This site is not affiliated, sponsored or otherwise associated with any of the entities mentioned above and does not represent any of these entities in any way. All rights to the brands and product names mentioned are the property of their respective copyright holders. Any other trademarks mentioned belong to their registrants. MANAGED SERVER® is a trademark registered at European level by MANAGED SERVER SRL, Via Enzo Ferrari, 9, 62012 Civitanova Marche (MC), Italy.

JUST A MOMENT !

Would you like to see how your WooCommerce runs on our systems without having to migrate anything? 

Enter the address of your WooCommerce site and you will get a navigable demonstration, without having to do absolutely anything and completely free.

No thanks, my customers prefer the slow site.
Back to top