do we need to restart apache + APC after new version deployment of app?

后端 未结 3 1846
一个人的身影
一个人的身影 2021-01-18 22:30

when we deploy our app, we simply create a new folder and point a symbolic link to it, so apache will always find its way to the latest build.

However, we get strang

相关标签:
3条回答
  • 2021-01-18 23:22

    depends if you have the apc.stat setting in php.ini On or Off. If Off (typical for a production site) then you need to clear the code cache or restart apache; if On, then it should pick up the new code automatically

    0 讨论(0)
  • 2021-01-18 23:30

    Normally, APC will 'stat' each PHP file to see if it has been changed since it was last cached. So restarting Apache is not required for all application upgrades.

    BUT if your application uses apc_store() to store application data in the cache and some of that data might change after an upgrade, then restarting Apache is an easy way to flush the entire APC cache.

    I believe apache2ctl graceful would work, too.

    Also, APC performs a little better if you turn off the 'stat' checking; so if you disable that feature, then you'll want to restart Apache anyway.

    0 讨论(0)
  • 2021-01-18 23:31

    You can use apc_clear_cache().

    See related questions:

    How to clear APC cache entries?

    How to clear APC cache without crashing Apache?

    0 讨论(0)
提交回复
热议问题