Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx worker signal 11 问题 #12

Closed
imjustfly opened this issue Jan 6, 2016 · 8 comments
Closed

nginx worker signal 11 问题 #12

imjustfly opened this issue Jan 6, 2016 · 8 comments

Comments

@imjustfly
Copy link

按照如下配置时,配置问题test通过,运行起来的时候,worker不停的退出,信号11,是经典的segmentation fault,应该是内存引用的问题,确定consul地址是正确的:

upstream consul {
    # fake server otherwise ngx_http_upstream will report error when startup
    server 127.0.0.1:11111;

    # all backend server will pull from consul when startup and will delete fake server

    upsync 127.0.0.1:8500/v1/kv/upstreams/test upsync_timeout=6m upsync_interval=500ms upsync_type=consul strong_dependency=off;
    upsync_dump_path /data/server/nginx_consul/conf/upstreams/upstream_consul.conf;
}

server {
    listen 18080;

    location = / {
        proxy_pass http://consul;
    }

    location = /upstream_show {
        upstream_show;
    }
}

woker不停退出的日志如下:

2016/01/06 14:45:45 [alert] 22928#0: worker process 29593 exited on signal 11
2016/01/06 14:45:45 [alert] 22928#0: worker process 29594 exited on signal 11
2016/01/06 14:45:45 [alert] 22928#0: worker process 29595 exited on signal 11
2016/01/06 14:45:45 [alert] 22928#0: worker process 29596 exited on signal 11
2016/01/06 14:45:45 [alert] 22928#0: worker process 29597 exited on signal 11
2016/01/06 14:45:45 [alert] 22928#0: worker process 29599 exited on signal 11
2016/01/06 14:45:45 [alert] 22928#0: worker process 29600 exited on signal 11

每秒几十条,去掉upsync和upsync_dump_path配置项后 worker是可以稳定存活

@xiaokai-wang
Copy link
Member

hi, 按照你的配置测试了一下,没有复现你所说的问题,如下图:
Uploading EO}X40FZ2IQQGN54P90JF(2.jpg…

可以在全局加个配置项:
worker_rlimit_core 500M;
working_directory /tmp;
把生成的core 信息发一下,多谢了!

本模块是基于nginx-1.8.0 开发,向上兼容,对于低版本的不兼容。

谢谢!

@imjustfly
Copy link
Author

core文件:

core.2199.zip

@sinderrellar
Copy link

@imjustfly 能提供下完整的配置文件吗?另外问下127.0.0.1:11111是否有服务?
谢谢

@imjustfly
Copy link
Author

127.0.0.1:11111没有服务:

$ telnet 127.0.0.1 11111
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused 

这是一个测试nginx实例,完整配置文件如下:

conf/nginx.conf

#user  nobody;
worker_processes  1;

error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;
    include vhosts/*.conf;
}

conf/vhosts/consul.conf

upstream consul {
    # fake server otherwise ngx_http_upstream will report error when startup
    server 127.0.0.1:11111;

    # all backend server will pull from consul when startup and will delete fake server
    upsync 127.0.0.1:8500/v1/kv/upstreams/test upsync_timeout=6m upsync_interval=500ms upsync_type=consul strong_dependency=off;
    upsync_dump_path /data/server/nginx_consul/conf/upstreams/upstream_consul.conf;
}

server {
    listen 18080;

    location = / {
        proxy_pass http://consul;
    }

    location = /upstream_show {
        upstream_show;
    }
}

conf/vhosts/ 目录下只有consul.conf 一个文件

@xiaokai-wang
Copy link
Member

may more detail...

  1. 系统环境:内核版本
  2. nginx 版本
  3. ./configure 后面参数列表

感谢!

@imjustfly
Copy link
Author

系统是centos6

$ uname -a
Linux user-6-151 2.6.32-431.5.1.el6.x86_64 #1 SMP Wed Feb 12 00:41:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

nginx版本如下

$ sbin/nginx -V
nginx version: nginx/1.9.9
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
configure arguments: --add-module=/data/install/nginx-upsync-module-master --prefix=/data/server/nginx_consul/

@imjustfly
Copy link
Author

确认在nginx 1.8.0 版本上不会出现这个问题

@xiaokai-wang
Copy link
Member

兼容 1.8.+ and 1.9.+

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants