神秘的GC缓存条目是什么意思 [英] What does the cryptic GC cache entry mean

查看:176
本文介绍了神秘的GC缓存条目是什么意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有时会收到此奇怪的警告消息.它通常在页面重新加载时消失了.那是什么意思.我用谷歌搜索,但无济于事.

Time to time, I receive this strange warning message. It is usually gone on page reload. What does that mean. I googled but to no avail.

Warning: include(): GC cache entry '/.../...class.php' (dev=2049 ino=37120489) was on gc-list for 3840 seconds in /.../...class.php on line 111

推荐答案

可以肯定地,此问题来自APC,源代码来自软件包apc-3.1.6-r1.将项目插入用户缓存或文件缓存时,将调用此函数.

Definitely this issue goes from APC, source code from package apc-3.1.6-r1. When item is inserted into user cache or file cache, this function is called.

static void process_pending_removals(apc_cache_t* cache TSRMLS_DC)
{
slot_t** slot;
time_t now;

/* This function scans the list of removed cache entries and deletes any
 * entry whose reference count is zero (indicating that it is no longer
 * being executed) or that has been on the pending list for more than
 * cache->gc_ttl seconds (we issue a warning in the latter case).
 */

if (!cache->header->deleted_list)
    return;

slot = &cache->header->deleted_list;
now = time(0);

while (*slot != NULL) {
    int gc_sec = cache->gc_ttl ? (now - (*slot)->deletion_time) : 0;

    if ((*slot)->value->ref_count <= 0 || gc_sec > cache->gc_ttl) {
        slot_t* dead = *slot;

        if (dead->value->ref_count > 0) {
            switch(dead->value->type) {
                case APC_CACHE_ENTRY_FILE:
                    apc_warning("GC cache entry '%s' (dev=%d ino=%d) was on gc-list for %d seconds" TSRMLS_CC,
                        dead->value->data.file.filename, dead->key.data.file.device, dead->key.data.file.inode, gc_sec);
                    break;
                case APC_CACHE_ENTRY_USER:
                    apc_warning("GC cache entry '%s'was on gc-list for %d seconds" TSRMLS_CC, dead->value->data.user.info, gc_sec);
                    break;
            }
        }
        *slot = dead->next;
        free_slot(dead TSRMLS_CC);
    }
    else {
        slot = &(*slot)->next;
    }
} 
}

通过APC配置( http://cz.php.net/manual/zh-CN/apc.configuration.php#ini.apc.gc-ttl )

apc.gc_ttl integer

高速缓存条目可以保留在垃圾收集列表上的秒数.如果服务器进程在执行缓存的源文件时死亡,则此值提供故障保护.如果修改了该源文件,则在达到此TTL之前,不会回收为旧版本分配的内存.设置为零以禁用此功能.

The number of seconds that a cache entry may remain on the garbage-collection list. This value provides a fail-safe in the event that a server process dies while executing a cached source file; if that source file is modified, the memory allocated for the old version will not be reclaimed until this TTL reached. Set to zero to disable this feature.

我们收到消息"GC缓存条目'%s'(dev =%d ino =%d)在gc-list上存在%d秒"或"GC缓存条目'%s'在gc-list上存在% d秒":

We get messages "GC cache entry '%s' (dev=%d ino=%d) was on gc-list for %d seconds" or "GC cache entry '%s'was on gc-list for %d seconds" in this condition:

(gc_sec > cache->gc_ttl) && (dead->value->ref_count > 0)

第一个条件意味着,该项目稍后在apc.gc_ttl之前删除,并且仍在垃圾收集器列表中.秒条件表示,该项目仍被引用.

First condition means, item was deleted later then apc.gc_ttl seconds ago and its still in garbage collector list. Seconds condition means, item is still referenced.

例如当进程意外终止时,引用不会减少.前apc.ttl秒在APC高速缓存中处于活动状态,然后被删除(此项目下没有命中).现在,项目在垃圾收集器列表(GC)上,并且apc.gc_ttl超时正在运行.如果apc.gc_ttl小于(现在为item_deletion_time),则会发出警告,并且项目将完全刷新.

e.g. when process unexpectedly died, reference is not decreased. First apc.ttl seconds is active in APC cache, then is deleted (there isn't next hit on this item). Now item is on garbage collector list (GC) and apc.gc_ttl timeout is running. When apc.gc_ttl is less then (now - item_deletion_time), warning is written and item is completely flushed.

尝试检查您的日志(Web服务器,PHP,系统/内核)是否存在严重错误,例如php,Web服务器段错误.

Try to check your logs (web server, php, system/kernel) to critical errors, e.g. php, web server segfault.

这篇关于神秘的GC缓存条目是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆