0
Welcome Guest! Login
0 items Join Now

ZEND OPcache - Server CONFIG for Gantry5

    • Alain.D's Avatar
    • Alain.D
    • Rocketeer
    • Posts: 53
    • Thanks: 8
    • DEV & Jazz

    ZEND OPcache - Server CONFIG for Gantry5

    Posted 8 years 2 weeks ago
    • I everybody,
      For those having problems with 'Gantry 5' that do not work correctly in ADMIN (Joomla + Wordpress)
      with PHP "ZEND OPcache" enabled server.

      Here's a working CONFIG for CentOs/Linux machine :

      OPCAHE Best configuration, up to date : for small server or local DEV
      opcache.enable=1
      opcache.revalidate_freq=0
      opcache.validate_timestamps=1
      opcache.max_accelerated_files=65407
      opcache.memory_consumption=400
      opcache.interned_strings_buffer=16
      opcache.fast_shutdown=0
      opcache.use_cwd=1
      opcache.save_comments=1
      opcache.enable_file_override=1
      opcache.max_wasted_percentage=10
      opcache.revalidate_path=1


      More on GANTRY GitHub
    • Last Edit: 8 years 1 week ago by Alain.D.
    • The following users have thanked you: Joe Halleck, Kat05, DanG, MrT

    • Joe Halleck's Avatar
    • Joe Halleck
    • Preeminent Rocketeer
    • Posts: 5480
    • Thanks: 66
    • Never give up!

    Re: ZEND OpCache - Server CONFIG for Gantry5

    Posted 8 years 2 weeks ago
    • Thanks for the informative post!
    • Magento - phpBB3 - Kunena - RokBridge Specialist
      No Secure Tab posts unless requested.
      Use the Thank You and Life Preserver Buttons!
      Your signature is also great place for setup details...help us help you!
    • Alain.D's Avatar
    • Alain.D
    • Rocketeer
    • Posts: 53
    • Thanks: 8
    • DEV & Jazz

    Re: ZEND OPcache - Server CONFIG for Gantry5

    Posted 8 years 2 weeks ago
    • For better server performances, it's recommended to fine-tune some variables:

      opcache.memory_consumption (default "64") MB, adjust to your needs, up to a quarter of total server's memory
      The OPcache shared memory storage size. The amount of memory for storing precompiled PHP code in Mbytes.

      opcache.max_accelerated_files (default "2000")
      The maximum number of keys (scripts) in the OPcache hash table.
      The number is actually the first one in the following set of "PRIME NUMBERS" that is bigger than the one supplied:
      { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }…
      Only numbers between 200 and 1000000 are allowed.

      opcache.fast_shutdown (default "0")
      If enabled, a fast shutdown sequence is used for the accelerated code.
      The fast shutdown sequence doesn't free each allocated block, but lets the Zend Engine Memory Manager do the work.
      With opcache.fast_shutdown=1 in some case you can get this error: 500 Internal Server Error. Mostly on WIN IIS…

      NOTE ***Read Matias note***
      (use opcache.revalidate_freq=0 or updates in joomla fail)

      Because most of server's php scrips will now be served thru FAST MEMORY, all other HTML only website's will gain in speed.
      Reason : OPcache will free access to your HD, so mostly, ALL YOUR WEBSITES will run at least 200% faster…
      …and your server LOAD average will drop.

      Some OPcache GUI exist to help you visualize your caches and refine your config on GitHub:
      PeeHaa
      amnuts
      rlerdorf

      A more robust Setup config for live server with more than 150 clients:
      opcache.enable=1
      opcache.revalidate_freq=0
      opcache.validate_timestamps=1
      opcache.max_accelerated_files=65407
      opcache.memory_consumption=1024
      opcache.interned_strings_buffer=32
      opcache.fast_shutdown=0
      opcache.use_cwd=1
      opcache.save_comments=1
      opcache.enable_file_override=1
      opcache.max_wasted_percentage=10
      opcache.revalidate_path=1

      On a WINDOWS IIS SERVER, enable OPcache in PHP.INI
      zend_extension=php_opcache.dll

      And don't forget to restart Apache on Unix or PHP on WinServer IIS!
    • Last Edit: 8 years 1 week ago by Alain.D.
    • Matias Griese's Avatar
    • Matias Griese
    • Sr. Rocketeer
    • Posts: 249
    • Thanks: 104
    • Lead Developer

    Re: ZEND OPcache - Server CONFIG for Gantry5

    Posted 8 years 2 weeks ago
    • Gantry 5.2.14 will work with opcache.revalidate_freq>0 and opcache.validate_timestamps=0 settings, though underlying CMS will probably cause still issues.
    • Gantry 5, enjoy!
    • Alain.D's Avatar
    • Alain.D
    • Rocketeer
    • Posts: 53
    • Thanks: 8
    • DEV & Jazz

    Re: ZEND OPcache - Server CONFIG for Gantry5

    Posted 7 years 3 months ago
    • Alain.D wrote:
      For better server performances, it's recommended to fine-tune some variables:

      opcache.memory_consumption (default "64") MB, adjust to your needs, up to a quarter of total server's memory
      The OPcache shared memory storage size. The amount of memory for storing precompiled PHP code in Mbytes.

      opcache.max_accelerated_files (default "2000")
      The maximum number of keys (scripts) in the OPcache hash table.
      The number is actually the first one in the following set of "PRIME NUMBERS" that is bigger than the one supplied:
      { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }…
      Only numbers between 200 and 1000000 are allowed.

      opcache.fast_shutdown (default "0")
      If enabled, a fast shutdown sequence is used for the accelerated code.
      The fast shutdown sequence doesn't free each allocated block, but lets the Zend Engine Memory Manager do the work.
      With opcache.fast_shutdown=1 in some case you can get this error: 500 Internal Server Error. Mostly on WIN IIS…

      NOTE ***Read Matias note***
      (use opcache.revalidate_freq=0 or updates in joomla fail)

      Because most of server's php scrips will now be served thru FAST MEMORY, all other HTML only website's will gain in speed.
      Reason : OPcache will free access to your HD, so mostly, ALL YOUR WEBSITES will run at least 200% faster…
      …and your server LOAD average will drop.

      Some OPcache GUI exist to help you visualize your caches and refine your config on GitHub:
      PeeHaa
      amnuts
      rlerdorf

      A more robust Setup config for live server with more than 150 clients:
      opcache.enable=1
      opcache.revalidate_freq=0
      opcache.validate_timestamps=1
      opcache.max_accelerated_files=32531
      opcache.memory_consumption=1536
      opcache.interned_strings_buffer=32
      opcache.fast_shutdown=0
      opcache.use_cwd=1
      opcache.save_comments=1
      opcache.enable_file_override=1
      opcache.max_wasted_percentage=10
      opcache.revalidate_path=1
      opcache.enable_cli=0

      On a WINDOWS IIS SERVER, enable OPcache in PHP.INI
      zend_extension=php_opcache.dll

      And don't forget to restart Apache on Unix or PHP on WinServer IIS!

Time to create page: 0.060 seconds