We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

2.2.5. OPcache

OPcache is designed to cache the compiled bytecode of PHP scripts in RAM. Its use allows to some extent speed up the work of site scripts and reduce the load they create on the web server. OPcache can be used on any site, no special site support is required.

Important points:

  • Unfortunately, it is impossible to determine in advance the amount of memory for OPcache that the site will need. You can find out a specific figure only experimentally by connecting the service and studying the collected statistics... Most sites rarely need more than 32MB.
  • Several ordered volumes are added together.
  • On businesshosting OPcache does not need to be ordered. It is available free of charge within the allocated amount of RAM.

To order OPcache memory do the following:

  1. Open the section "Hosting ».
  2. In the block "Additional services»Click«OPcache»:
  3. In the drop-down list, select the required amount of memory and click "To order"(If the system informs about the presence of an unpaid order, in the text of this notice click"undo", Then repeat the order):
  4. If this is the first time ordering the service, skip this step to use free 7-day trial period... Otherwise, pay automatically generated invoice any of available ways and wait for the payment to be credited.
  5. Wait approximately 30 minutes for the service to activate.
  6. Enable OPcache for the sites you want.

Important points:

  • To use OPcache, the site settings must be set PHP version not lower than 5.5.
  • In case of insufficient memory allocated for OPcache on the site, there may be error 503... It's not about filling the cache storage by 100%, but about setting too little OPcache allocated memory for the site.

To enable OPcache on the site, do the following:

  1. Discover PHP settings.
  2. Check the box next to "OPcache caching "And in the field"Memory for OPcache»Specify the amount of memory allocated to the site:

The parameter "Change check frequency» (opcache.revalidate_freq) defaults to zero. This means that with each request it will check whether the script has changed and whether it can still be taken from the cache or needs to be called again. It makes sense to use a value greater than zero if the site receives a large number of requests and its files are not being edited. This will give some performance gain by reducing the number of disk operations.

Important points:

  • Fully filled Opcache will not create errors in the site, but it may be one of the signs that you need to increase the allocated memory for caching.
  • When the storage is 100% full, unpopular and old data will be overwritten by more popular ones, there is no need to worry about caching efficiency.

To view statistics on OPcache usage, see the section “Hosting "In the block"Additional services»Click«OPcache statistics»:

In the OPcache statistics, you can find the following information:

  • The current status of OPcache.
  • The version of the module being used.
  • List of sites for which OPcache memory is allocated.
  • Percentage pie chart "Percentage of total", Which displays:
    • Percent busy memory.
    • Percent free memory.
    • Percent lost (Wasted) memory. Lost memory - this is memory, which is already occupied by outdated, irrelevant data. It appears due to changes in scripts or the inability to use the current data for them. Such memory is cleared automatically when a certain fraction of the maximum of the total memory is reached, so manual clearing is not required. This approach provides faster OPcache functionality.
  • Percentage pie chart "Percentage of all requests", Which displays:
    • Hits - statistics of requests to scripts that were in the cache, and the result was provided without executing the source code.
    • Misses - statistics of requests to scripts that not were in the cache and were executed.
  • Configuration is a list of OPcache options. All options can be found in documentation.

Example statistics: