相关疑难解决方法(0)

如何清除APC缓存条目?

我需要在部署新版本的站点时清除所有APC缓存条目.APC.php有一个用于清除所有操作码缓存的按钮,但是我没有看到用于清除所有用户条目或所有系统条目或所有每个目录条目的按钮.

是否可以通过命令行或其他方式清除所有缓存条目?

php performance caching apc

171
推荐指数
8
解决办法
20万
查看次数

Symfony2慢速初始化时间

我在一个Ubuntu Server 12.04(64位)VM(VirtualBox)上运行Symfony2.主持人是MacBook专业版.出于某种原因,我在开发模式(app_dev.php)中获得了非常长的请求时间.我知道它在开发模式下速度较慢,但​​每个请求我说5-7秒(有时甚至更慢).在我的Mac上,我在开发模式下获得200ms左右的请求时间.

在Symfony2分析器中查看我的时间线后,我注意到~95%的请求时间是"初始化时间".这是什么?有什么原因可能会这么慢?

此问题仅适用于开发模式下的Symfony2,而不适用于我在VM上运行的任何其他站点,甚至不适用于生产模式下的Symfony2.

我看到了这一点(http://stackoverflow.com/questions/11162429/whats-included-in-the-initialization-time-in-the-symfony2-web-profiler),但它似乎没有回答我的问题.

ubuntu performance virtualbox symfony

54
推荐指数
2
解决办法
4万
查看次数

如何清除Doctrine APC缓存以进行生产?

当我向我的一个实体添加一个列并将其发布用于生产时,我有这个问题我必须重新启动Apache才能清除Doctrine元数据APC/APCU缓存.

我已尝试过以下所有命令,但没有一个对我有用:

php -r "apc_clear_cache();"
php -r "apcu_clear_cache();"

sudo php app/console doctrine:cache:clear-metadata
sudo php app/console doctrine:cache:clear-query
sudo php app/console doctrine:cache:clear-result
Run Code Online (Sandbox Code Playgroud)

我收到了--env = prod的错误消息

sudo php app/console doctrine:cache:clear-metadata  --env=prod
sudo php app/console doctrine:cache:clear-query  --env=prod
sudo php app/console doctrine:cache:clear-result --env=prod

 [LogicException]
  Cannot clear APC Cache from Console, its share in the Web server memory and not accessible from the CLI.
Run Code Online (Sandbox Code Playgroud)

我可以让它刷新Doctrine缓存的唯一方法是重启我的apache服务器,这有时可能是一个问题.

我的Symfony项目中Doctine的缓存设置:

doctrine:
    orm:
        metadata_cache_driver: apc
        result_cache_driver: apc
        query_cache_driver: apc
        second_level_cache:
            enabled: true
            log_enabled: false
            region_cache_driver: apc
Run Code Online (Sandbox Code Playgroud)

在每次向生产发布新架构更新时,如何在不重新启动Apache的情况下清除APC缓存.如果负载均衡器后面有许多服务器,情况会更糟.

caching apc symfony doctrine-orm apcu

5
推荐指数
1
解决办法
4723
查看次数

标签 统计

apc ×2

caching ×2

performance ×2

symfony ×2

apcu ×1

doctrine-orm ×1

php ×1

ubuntu ×1

virtualbox ×1