简体   繁体   English

如何在不崩溃Apache的情况下清除APC缓存?

[英]How to clear APC cache without crashing Apache?

If APC stores a lot of entries, clearing them crashes httpd. 如果APC存储了大量条目,清除它们会导致httpd崩溃。

If apc_clear_cache('user') takes longer than phps max_execution_time the script calling apc_clear_cache will be terminated by php before the clearing-operation is finished. 如果apc_clear_cache('user')花费的时间超过phps max_execution_time,则在清除操作完成之前,调用apc_clear_cache的脚本将被php终止。 this seems to leave some handles or sth. 这似乎留下一些句柄或某事。 that will prevent apache from closing it's processes. 这将阻止apache关闭它的进程。

( http://pecl.php.net/bugs/bug.php?id=13445 ) http://pecl.php.net/bugs/bug.php?id=13445

Is there some other quick but safe way of bulk cleanup of APC cache? 是否有其他快速但安全的批量清理APC缓存的方法?

You can remove the time limit on a script you're running (as long as you don't run php in safe mode) 您可以删除正在运行的脚本的时间限制(只要您不在安全模式下运行php)

set_time_limit(0);

This will remove the time limit for the script 这将删除脚本的时间限制

http://au2.php.net/manual/en/function.set-time-limit.php for more details http://au2.php.net/manual/en/function.set-time-limit.php了解更多详情

您也可以优雅地重新启动apache,它将使用干净的APC重新加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM