cache_mem 16 MB
cache_replacement_policy heap LRU
maximum_object_size_in_memory 32 KB
cache_dir coss /home/shihao/work/squid/var/cache0/coss0 100 membufs=10 overwrite-percent=100 max-size=262144
cache_swap_log /home/shihao/work/squid/var/logs/swap.state
http_port 3128
访问squidclient -T 3000 http://10.1.1.111:8081/1000 ~ http://10.1.6.111:8081/5000
其中 http://10.1.1.111:8081/1000 ~ http://10.1.1.111:8081/5000 每个文件大小为65146字节
因为要存储网页缓存头信息,http://10.1.1.111:8081/1000 这个网页缓存头信息390个字节(不同的机器和链接头字节数有可能不一样)
10.1.1.111机器的处理器为Intel(R) Xeon(R) CPU 5120 @ 1.86GHz
coss-bug@squid-2.7.STABLE7/src/fs/coss/store_io_coss.c: line 182
configure options: '--prefix=/home/shihao/work/squid' '--with-large-files' '--with-coss-membuf-size=1048576' '--enable-async-io=32' '--enable-storeio=ufs,coss,aufs,diskd
当 ((cs->current_offset + allocsize) == ((off_t) SD->max_size << 10) 时, @line: 182
((cs->current_offset + allocsize) > ((off_t) SD->max_size << 10)) 结果为 false,
但是 ((cs->current_offset + allocsize) >= cs->current_membuf->diskend) 为 true.
那么会进入 else if ((cs->current_offset + allocsize) >= cs->current_membuf->diskend) //@line: 203语句中,
会执行 assert(cs->curstripe < (cs->numstripes - 1))//@line: 215, 程序出现 core down.
正确 : } else if ((cs->current_offset + allocsize) >= ((off_t) SD->max_size << 10)) { @line: 182
/* Check if we have overflowed the disk .. */
} else if ((cs->current_offset + allocsize) > ((off_t) SD->max_size << 10)) {
/*
* tried to allocate past the end of the disk, so wrap
* back to the beginning
*/
coss_stats.disk_overflows++;
cs->current_membuf->flags.full = 1;
cs->numfullstripes++;
cs->current_membuf->diskend = cs->current_offset;
storeCossMaybeWriteMemBuf(SD, cs->current_membuf);
/* cs->current_membuf may be invalid at this point */
cs->current_offset = 0; /* wrap back to beginning */
debug(79, 2) ("storeCossAllocate: %s: wrap to 0/n", stripePath(SD));
newmb = storeCossCreateMemBuf(SD, 0, checkf, &coll);
cs->current_membuf = newmb;
if (newmb == NULL) {
cs->sizerange_max = SD->max_objsize;
return -1;
}
/* Check if we have overflowed the MemBuf */
} else if ((cs->current_offset + allocsize) >= cs->current_membuf->diskend) {
/*
* Skip the blank space at the end of the stripe. start over.
*/
coss_stats.stripe_overflows++;
cs->current_membuf->flags.full = 1;
cs->numfullstripes++;
cs->current_offset = cs->current_membuf->diskend;
storeCossMaybeWriteMemBuf(SD, cs->current_membuf);
/* cs->current_membuf may be invalid at this point */
debug(79, 3) ("storeCossAllocate: %s: New offset - %" PRId64 "/n", stripePath(SD),
(int64_t) cs->current_offset);
assert(cs->curstripe < (cs->numstripes - 1));
newmb = storeCossCreateMemBuf(SD, cs->curstripe + 1, checkf, &coll);
cs->current_membuf = newmb;
if (newmb == NULL) {
cs->sizerange_max = SD->max_objsize;
return -1;
}
}
squid-3.0.STABLE24: store_io_coss.cc: @line 80
(current_offset + allocsize) > ((off_t)max_size << 10)
I don't know whether it has the same problem.