The Optimizer+ runs out-of-the-box (by default, after installation). Optimizer+ allows you to gain a performance boost by reducing code compilation time. When PHP code is compiled for the first time, it is saved in the server’s memory. Each time the code is called, the pre-compiled version is used instead of waiting for the code to compile, which causes a delay each time the code is used.
Note:
Using the Optimizer+ should not be confused with caching. The Optimizer+ saves a compiled script to the server's memory, while Caching saves the script’s output to the server’s memory.
The general recommendation is to always keep the Optimizer+ set to 'On' to boost Web application performance.
There are some instances where it is preferable not to store PHP byte-code for certain PHP files. To do so, you can make a list (a blacklist) of file names that you want the Optimizer+ to ignore or increase the Optimizer+ resource allocation.
Files and directives should be blacklisted under the following conditions:
The following procedure describes how to change Optimizer+ resource allocation. This procedure is used as an alternative to blacklisting files and should be tried first, before adding a file to a blacklist (unless the file meets one of the criteria above). Optimizer+ settings can be changed to increase allocated memory and the maximum quantity of files. This alternative depends on the amount of memory available to allocate to the Accelerator.
Memory allocation can only be increased when the Optimizer+ is set to 'On'.
|
|
To increase the Optimizer+ memory allocation:
To increase the quantity of files:
|
|
If the memory fills up quickly (especially if there are only a few files), increase the memory allocation or blacklist the file. Files which exceed the allocated memory or file quantity are not accelerated. |
If none of the alternatives (described above) are suitable, or if the file meets one of the criteria for blacklisting a file, use the following procedure to create a blacklist file that contains the file names of the files you do not want to be byte-code cached by Optimizer+.
|
|
To create a blacklist file:
|
|
The files in the blacklist are now ignored by Optimizer+. |
In situations where certain functions were (or were not) defined, some PHP code produces different opcodes, depending on the circumstances. This causes a discrepancy for the Optimizer+ in the situation where the Optimizer+ caches one versionand a sequence of events arises that requires a different function. If the discrepancy is not addressed, the script stops working and raises a "duplicate functions" error.
To maintain proper performance in these and similar situations, activate the zend_optimizerplus.dups_fix parameter. This parameter shuts down the Optimizer+ duplicate function check to prevent these errors from occurring.
This parameter can be defined in Server Setup | Directives by searching for zend_optimizerplus.dups_fix.
|
|
Related Links: |
|
|
|