Forum Moderators: phranque

Message Too Old, No Replies

Zend Optimizer vs Zend OPcache

         

csdude55

4:12 pm on Dec 30, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I had Zend Optimizer installed on my old server, but for the life of me I can't figure out why! LOL I can't find anything about it on the Zend website, but I see some articles that talk about it making PHP faster... and then others talking about how it decodes files that are encoded with Zend Guard.

If I don't encode my scripts with Zend Guard then is there any value to using Zend Optimizer?

In researching, I also found Zend OPcache:

[help.zend.com...]

Any thoughts on either of these? My primary goal is to improve speed.

robzilla

7:42 pm on Dec 30, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The decoder and opcache were very confusingly named Zend Optimizer and Zend Optimizer+, respectively. They later wisely changed that to Zend Guard Loader and Zend OPcache.

To answer your questions, no there's no value in having Zend Guard Loader if you don't have any Guard-encoded files, and you should always install an opcode cache (OPcache) for a quick and easy performance boost. There used to be a bunch of opcaches like XCache, APC and eAccelerator, but nowadays it's just Zend OPcache.

Run php -v from the command line or check phpinfo(); to see if an opcache is installed.

# php80 -v
PHP 8.0.0 (cli) (built: Nov 24 2020 17:04:03) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v8.0.0, Copyright (c), by Zend Technologies

csdude55

8:07 pm on Dec 30, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Cool, thanks for the info! I checked and definitely don't have Zend OPcache installed, so I'll install it tonight when the traffic is low. I wonder why it's not installed by default? I've done some reading and can't find any negatives on it.

csdude55

5:06 am on Dec 31, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thought you'd be interested... a few weeks ago I posted my load times after moving to the new VPS with FastCGI, HTTP/2, and mod_pagespeed:

First Byte: 0.516s
Start Render: 0.900s
First Contentful Paint: 0.914s
Speed Index: 1.524s
Document Complete Time: 1.584s
Fully Loaded Time: 6.370s

After installed Zend OPcache:

First Byte: 0.285s
Start Render: 0.700s
First Contentful Paint: 0.715s
Speed Index: 1.231s
Document Complete Time: 1.678s
Fully Loaded Time: 4.347s

I did 3 tests, and "Document Complete" was consistently higher than before on each of them! But all of the other stats were considerably improved, with "Fully Loaded Time" being almost 2s faster! So I'm quite pleased :-)

robzilla

8:00 am on Dec 31, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Obviously only your TTFB is going to be affected by the opcache, but you almost cut that in half, so that's great!

csdude55

5:05 pm on Dec 31, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just for future readers... after installing OPcache, I started getting a ton of warnings from CSF about "Excessive resource usage", even for small low-traffic accounts. Munin looked fine, though, so I don't think it was an actual problem.

In CSF, I had PT_USERMEM set to 512. I raised it to 768, and so far no more warnings. The max setting is 1024, so right now I'm just thinking of it as a warning to any major problem.

If I continue getting errors then I'll raise it to 1024... if they continue after that, I guess the only option is to disable it entirely by changing it to 0 :-( But it's been an hour with no warnings, so I hope that 768 is OK.