My favorites | Sign in
Project Home Downloads Wiki Issues
Search
for
NCacheMailList  

From:liushenzeng@hotmail.com

Title:ncache make error, thanks

Content:

[root@f7 ncache]# 
[root@f7 ncache]# 
[root@f7 ncache]# ./configure
checking for OS
 + Linux 2.6.20.3 i686
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.1.2 20070502 (Red Hat 4.1.2-12)
checking for gcc -pipe switch ... found
checking for gcc variadic macros ... found
checking for C99 variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for crypt.h ... found
checking for malloc.h ... found
checking for Linux specific features
 + rt signals found
checking for epoll ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for nobody group ... found
checking for poll() ... found
checking f Configuration summary
  + threads are not used
  + using system PCRE library
  + OpenSSL library is not used
  + md5: using system crypto library
  + sha1 library is not used
  + using system zlib library
  nginx path prefix: "/usr/local/ncache"
  nginx binary file: "/usr/local/ncache/sbin/ncache"
  nginx configuration file: "/usr/local/ncache/conf/ncache.conf"
  nginx pid file: "/usr/local/ncache/logs/ncache.pid"
  nginx error log file: "/usr/local/ncache/logs/error.log"
  nginx http access log file: "/usr/local/ncache/logs/access.log"
  nginx http client request body temporary files: "/usr/local/ncache/client_body_temp"
  nginx http proxy temporary files: "/usr/local/ncache/proxy_temp"
  nginx http fastcgi temporary files: "/usr/local/ncache/fastcgi_temp"
[root@f7 ncache]# make 
make -f objs/Makefile
make[1]: Entering directory `/root/work/nginx/ncache'
gcc -c -O -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wno-unused-function -Wunused-variable -Wunused-value -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
                -o objs/src/core/nginx.o \
                src/core/nginx.c
In file included from src/os/unix/ngx_atomic.h:15,
                 from src/core/ngx_core.h:38,
                 from src/core/nginx.c:8:
src/os/unix/atomic.h:9:26: error: linux/config.h: No such file or directory
src/os/unix/atomic.h:10:28: error: linux/compiler.h: 

reply:

没有找到内核头文件 这个是src/os/unix/atomic.h头文件引起的,你可以用编辑器打开该文件,修改引用的头文件路径config.h 和 complier.h ,将他们对应到你操作系统的相应路径上就可以了

Ubuntu下安装内核头文件: 
                                apt-get   install   build-essential 


 
谢谢你告诉我们这个问题,我会去看看能不能尽量在安装文件里把这个路径问题解决,谢谢
Comment by mrhai...@gmail.com, Apr 20, 2008

请问,ncache中查看缓存命中率有没有专门的工具?

Comment by project member shin...@gmail.com, Apr 21, 2008

curl "http://ncache服务器IP/nginx_status" 这里的nginx_status是在ncache.conf文件中配置的,默认的是 location /nginx_status {

stub_status on;
}

Comment by mrhai...@gmail.com, Apr 22, 2008

http://10.22.XX.XXX/status_infos: 查看是如下效果: Active connections: 142 server accepts handled requests

797 797 9352
Reading: 0 Writing: 1 Waiting: 141 Shoot:2.28,7318,0,167,7844,49643859,203,7844 就是最后一行无法理解。 望指教。

Comment by Arden.Em...@gmail.com, May 26, 2008
upstream www.iding.com {
server 127.0.0.1:8001; cachedir /backup/ncache/www.iding.com/ 128 128;
}
upstream shop.iding.com {
server 127.0.0.1:8002; cachedir /backup/ncache/shop.iding.com/ 128 128;
}
upstream admin.iding.com {
server 127.0.0.1:8003; cachedir /backup/ncache/admin.iding.com/ 128 128;
}
server {
listen 80; server_name www.iding.com;
  1. harset koi8-r;
  1. ccess_log logs/host.access.log main;
location / {
root /data/webapps/www/www.iding.com; proxy_pass http://www.iding.com; proxy_redirect off; proxy_ignore_client_no_cache on;
}
}
server {
listen 80; server_name shop.iding.com;
  1. harset koi8-r;
  1. ccess_log logs/host.access.log main;
location / {
root /data/webapps/www/shop.iding.com; proxy_pass http://shop.iding.com; proxy_redirect off; proxy_ignore_client_no_cache on;
}
}
server {
listen 80; server_name admin.iding.com;
  1. harset koi8-r;
  1. ccess_log logs/host.access.log main;
location / {
root /data/webapps/www/admin.iding.com; proxy_pass http://admin.iding.com; proxy_redirect off; proxy_ignore_client_no_cache on;
}
}

我配置3个Web应用怎么配置缓存?

Comment by qixi17...@gmail.com, Aug 1, 2008

v2.0 能不能cache自身虚拟主机提供的内容?

Comment by pahud...@gmail.com, Dec 30, 2008

這個script應該可以輔助列出緩存命中率

#!/bin/sh

#set -x
export PATH=/bin:/usr/bin

url='http://127.0.0.1:8888/ncache_state'
out=$(curl --silent $url)
sc=$(echo $out | perl -nle 'print $1 if m/shoot_count: ([^ ]+)/')
rc=$(echo $out | perl -nle 'print $1 if m/request_count:([^ ]+)/')
hitrate=$(echo "scale=2; 100*$sc / $rc" | bc)
echo $out | perl -ple 's/([0-9]) /$1\n/g' | perl -ple 's/: /:/g'
echo "hit_rate:$hitrate"

exit 0

測試

~ #[17:37:26] sh mystat.sh
time_count:966
request_count:57673
shoot_count:53144
disk_writes:4322
store_files:14590
upstream_count:4529
free_index:16777209
file_collision:0
hit_rate:92.14

最后一行便是


Sign in to add a comment
Powered by Google Project Hosting