nginx 1.1.15: crash

locojohn nginx-forum на nginx.us
Сб Фев 18 09:18:53 UTC 2012


fr 0
p *p

$1 = {upstream = 0x7fc76f262b50, downstream = 0x7fc76f2623d0,
free_raw_bufs = 0x0, 
  in = 0x0, last_in = 0x2238fa0, out = 0x223aae8, free = 0x223abb8, 
  busy = 0x223a938, input_filter = 0x4653d0
<ngx_http_fastcgi_input_filter>, 
  input_ctx = 0x227ba00, output_filter = 0x432f00
<ngx_http_output_filter>, 
  output_ctx = 0x227ba00, read = 0, cacheable = 0, single_buf = 0,
free_bufs = 1, 
  upstream_done = 0, upstream_error = 0, upstream_eof = 0,
upstream_blocked = 0, 
  downstream_done = 0, downstream_error = 0, cyclic_temp_file = 0,
allocated = 8, 
  bufs = {num = 8, size = 16384}, tag = 0x694380, busy_size = 65536, 
  read_length = 458766, length = 65528, max_temp_file_size = 1073741824,

  temp_file_write_size = 65536, read_timeout = 1800000, send_timeout =
600000, 
  send_lowat = 0, pool = 0x2238200, log = 0x216b320, preread_bufs = 0x0,

  preread_size = 14, buf_to_file = 0x0, temp_file = 0x223a5b8, num =
33}

(gdb) fr 3
#3  0x000000000044786e in ngx_http_upstream_process_upstream
(r=0x227ba00, 
    u=0x2239230) at src/http/ngx_http_upstream.c:2641
2641	src/http/ngx_http_upstream.c: No such file or directory.
(gdb) p *r
$2 = {signature = 1347703880, connection = 0x7fc76f2623d0, ctx =
0x2238610, 
  main_conf = 0x2164790, srv_conf = 0x2183c10, loc_conf = 0x219f9a0, 
  read_event_handler = 0x447c90
<ngx_http_upstream_rd_check_broken_connection>, 
  write_event_handler = 0x447ff0 <ngx_http_upstream_process_downstream>,

  cache = 0x0, upstream = 0x2239230, upstream_states = 0x2239160, 
  pool = 0x2238200, header_in = 0x2185f00, headers_in = {headers = {
      last = 0x227ba70, part = {elts = 0x22389d8, nelts = 13, next =
0x0}, 
      size = 48, nalloc = 20, pool = 0x2238200}, host = 0x22389d8, 
    connection = 0x0, if_modified_since = 0x0, if_unmodified_since =
0x0, 
    user_agent = 0x2238a38, referer = 0x2238a98, content_length = 0x0, 
    content_type = 0x0, range = 0x0, if_range = 0x0, transfer_encoding =
0x0, 
    expect = 0x0, accept_encoding = 0x2238ac8, via = 0x2238b88, 
    authorization = 0x2238a08, keep_alive = 0x0, x_forwarded_for =
0x2238bb8, 
    x_real_ip = 0x0, user = {len = 0, data = 0x0}, passwd = {len = 0,
data = 0x0}, 
    cookies = {elts = 0x2238d98, nelts = 1, size = 8, nalloc = 2, 
      pool = 0x2238200}, server = {len = 15, data = 0x21e8cdb
"myintranet.com"}, 
    content_length_n = -1, keep_alive_n = -1, connection_type = 2, msie
= 0, 
    msie6 = 0, opera = 0, gecko = 0, chrome = 1, safari = 0, konqueror =
0}, 
  headers_out = {headers = {last = 0x227bba8, part = {elts = 0x2238250,
nelts = 7, 
        next = 0x0}, size = 48, nalloc = 20, pool = 0x2238200}, status =
200, 
    status_line = {len = 6, data = 0x4743ce "200 OK"}, server = 0x0,
date = 0x0, 
    content_length = 0x0, content_encoding = 0x0, location = 0x0,
refresh = 0x0, 
    last_modified = 0x2238370, content_range = 0x0, accept_ranges = 0x0,

    www_authenticate = 0x0, expires = 0x2238280, etag = 0x0, 
    override_charset = 0x0, content_type_len = 24, content_type = {len =
24, 
      data = 0x2239fb3 "application/octet-stream"}, charset = {len = 0,

      data = 0x0}, 
    content_type_lowcase = 0x223a108
"application/octet-stream\223\245#\002", 
    content_type_hash = 15101500687776628637, cache_control = {elts =
0x223a0f8, 
      nelts = 1, size = 8, nalloc = 2, pool = 0x2238200}, 
    content_length_n = 825782, date_time = 0, last_modified_time = -1},

  request_body = 0x2239088, lingering_time = 0, start_sec = 1329543384,

  start_msec = 724, method = 2, http_version = 1000, request_line = {len
= 67, 
    data = 0x21e8c90 "GET
/ratesdb/?tab=admin&section=history&download_file=6826
HTTP/1.0\r\nHost"}, uri = {len = 19, 
    data = 0x2238ed3
"/index.php/ratesdb/?tab=admin&section=history&download_file=6826"},
args = {len = 44, 
    data = 0x2238ee7 "tab=admin&section=history&download_file=6826"},
exten = {
    len = 0, data = 0x0}, unparsed_uri = {len = 54, 
    data = 0x21e8c94
"/ratesdb/?tab=admin&section=history&download_file=6826
HTTP/1.0\r\nHost"}, method_name = {len = 3, 
    data = 0x21e8c90 "GET
/ratesdb/?tab=admin&section=history&download_file=6826 HTT---Type
<return> to continue, or q <return> to quit---
P/1.0\r\nHost"}, http_protocol = {len = 8, data = 0x21e8ccb
"HTTP/1.0\r\nHost"}, 
  out = 0x223aa08, main = 0x227ba00, parent = 0x0, postponed = 0x0, 
  post_subrequest = 0x0, posted_requests = 0x0, virtual_names =
0x2281fe0, 
  phase_handler = 11, 
  content_handler = 0x469250 <ngx_http_uploadprogress_content_handler>,

  access_code = 0, variables = 0x2238718, ncaptures = 8, captures =
0x2238e30, 
  captures_data = 0x22390cf "/index.php/ratesdb//index.php/ratesdb/New
Delhi", 
  limit_rate = 0, header_size = 467, request_length = 1024, err_status =
0, 
  http_connection = 0x216b378, 
  log_handler = 0x435d40 <ngx_http_log_error_handler>, cleanup =
0x22391c0, 
  subrequests = 51, count = 1, blocked = 0, aio = 0, http_state = 2, 
  complex_uri = 0, quoted_uri = 0, plus_in_uri = 0, space_in_uri = 0, 
  invalid_header = 0, add_uri_to_alias = 0, valid_location = 1, 
  valid_unparsed_uri = 0, uri_changed = 0, uri_changes = 10, 
  request_body_in_single_buf = 0, request_body_in_file_only = 0, 
  request_body_in_persistent_file = 0, request_body_in_clean_file = 0, 
  request_body_file_group_access = 0, request_body_file_log_level = 5, 
  subrequest_in_memory = 0, waited = 0, cached = 0, gzip_tested = 0,
gzip_ok = 0, 
  gzip_vary = 0, proxy = 0, bypass_cache = 0, no_cache = 0,
limit_conn_set = 1, 
  limit_req_set = 0, pipeline = 0, plain_http = 0, chunked = 0,
header_only = 0, 
  keepalive = 1, lingering_close = 0, discard_body = 0, internal = 1, 
  error_page = 0, ignore_content_encoding = 0, filter_finalize = 0, 
  post_action = 0, request_complete = 0, request_output = 1, header_sent
= 1, 
  expect_tested = 0, root_tested = 0, done = 0, logged = 0, buffered =
0, 
  main_filter_need_in_memory = 0, filter_need_in_memory = 0, 
  filter_need_temporary = 0, allow_ranges = 0, stat_reading = 0,
stat_writing = 1, 
  state = 0, header_hash = 2715320498552542, lowcase_index = 10, 
  lowcase_header = "connectioniedfer-encoding\000\000\000\000\000\000",

  header_name_start = 0x2313250 "\r\n", 
  header_name_end = 0x2313247 ": close\r\n\r\n", 
  header_start = 0x2313249 "close\r\n\r\n", header_end = 0x2313250
"\r\n", 
  uri_start = 0x21e8c94
"/ratesdb/?tab=admin&section=history&download_file=6826
HTTP/1.0\r\nHost", uri_end = 0x21e8cca " HTTP/1.0\r\nHost", uri_ext =
0x0, 
  args_start = 0x21e8c9e "tab=admin&section=history&download_file=6826
HTTP/1.0\r\nHost", 
  request_start = 0x21e8c90 "GET
/ratesdb/?tab=admin&section=history&download_file=6826
HTTP/1.0\r\nHost", request_end = 0x21e8cd3 "\r\nHost", 
  method_end = 0x21e8c92 "T
/ratesdb/?tab=admin&section=history&download_file=6826
HTTP/1.0\r\nHost", schema_start = 0x0, schema_end = 0x0, host_start =
0x0, 
  host_end = 0x0, port_start = 0x0, port_end = 0x0, http_minor = 0,
http_major = 1}


общий конфиг:

#user nginx nginx;
user nginx www;
worker_processes 4;
worker_rlimit_nofile 131072;
worker_rlimit_core 500M;
working_directory /var/tmp;
#worker_cpu_affinity 0001 0010 0100 1000;

pcre_jit on;

error_log /var/log/nginx/error_log warn;

events {
        worker_connections 65536;
        use epoll;
}

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

        log_format main
                '$remote_addr - $remote_user [$time_local] '
                '"$request" $status $bytes_sent '
                '"$http_referer" "$http_user_agent" '
                '"$gzip_ratio" $request_time';

        # limit simultaneous connections
        limit_conn_zone $binary_remote_addr zone=addr:1m;
        limit_conn addr 16;

        client_header_timeout 10m;
        client_body_timeout 10m;
        send_timeout 10m;

        client_max_body_size 700m;
        connection_pool_size 256;
        client_body_buffer_size 1024k;
        client_header_buffer_size 8k;
        large_client_header_buffers 4 8k;
        request_pool_size 4k;

        proxy_buffering on;
        proxy_buffer_size 4k;
        proxy_buffers 4096 4k;

       open_file_cache max=2000 inactive=60s;
#        open_file_cache off;
       open_file_cache_valid 60;
        open_log_file_cache max=1000 inactive=60s valid=1m;

        geoip_country /usr/share/GeoIP/GeoIP.dat; # the country IP
database
        geoip_city    /usr/share/GeoIP/GeoLiteCity.dat; # the city IP
database

        gzip on;
        gzip_min_length 1100;
        gzip_buffers 4 8k;
        gzip_types text/plain text/css application/x-javascript text/xml
application/xml application/xml+rss text/javascript;

        output_buffers 1 32k;
        postpone_output 1460;

        aio on;
        directio 512;
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;

        keepalive_timeout 75 20;
        keepalive_disable msie6;

        ignore_invalid_headers on;
        server_name_in_redirect on;
        merge_slashes on;

        fastcgi_keep_conn on;
        fastcgi_pass_request_headers on;
        fastcgi_intercept_errors on;
        fastcgi_buffer_size 32k;
        fastcgi_buffers 8 16k;
        fastcgi_read_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_store_access user:rw group:r;

        # use the map module to correctly set $script_url variable
        map $uri $script_url {
          ~^(?<script_filename>.+\.(php|html))(?<path_info>.+)$
$path_info;
          ~^(?<script_filename>.+\.(php|html))$ $script_filename;
        }

        index index.html;

        upstream phpfarm {
          server unix:/var/run/fastcgi/php-fpm-1.sock weight=100
max_fails=3 fail_timeout=5;
          server unix:/var/run/fastcgi/php-fpm-2.sock weight=100
max_fails=3 fail_timeout=5;
          server unix:/var/run/fastcgi/php-fpm-3.sock weight=100
max_fails=3 fail_timeout=5;
          keepalive 512;
        }

        # upload progress
        upload_progress uploads 1m;
        upload_progress_content_type "application/json";
        upload_progress_json_output;

        # http concat
        concat on;
        concat_max_files 20;

конфиг виртуального хоста:

        server {
                listen 80;
                server_name myintranet.com;

                access_log /var/log/nginx/myintranet.access_log main;
                error_log /var/log/nginx/myintranet.error_log debug;

                root /opt/www/myintranet.com;

                fastcgi_read_timeout 1800;
                fastcgi_send_timeout 1800;

                include fastcgi_php.conf;
                fastcgi_param PHP_VALUE
"include_path=$document_root:$document_root/ezahlers \n
register_globals=on";
                fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code;
                fastcgi_param GEOIP_COUNTRY_NAME $geoip_country_name;
                fastcgi_param GEOIP_CITY_NAME $geoip_city;

                error_page 404          http://$http_host/error/404;
                error_page 403          http://$http_host/error/403;

                location / {
                  index index.php index.html;
                  try_files $uri $uri/ /index.php$request_uri;
                }

                # common settings

                # deny access to .ht* files
                location ~ (/\.ht|\.inc$|\.tpl$) {
                  deny all;
                }
                
                location = /favicon.ico {
                  log_not_found off;
                  access_log off;
                }
                
                location = /robots.txt {
                  allow all;
                  log_not_found off;
                  access_log off;
                }
                
                location /jquery/ {
                  try_files $uri $uri/ @common;
                }
                
                location @common {
                # handle common requests for all sites: /jquery/....,
etc.
                  root /opt/www/_common;
                }
                
                location ~ /_?\.gif$ {
                  empty_gif;
                }
                
                location /images {
                  expires max;
                  access_log off;
                }

                location /sitedesign {
                  expires max;
                  access_log off;
                }

                location /xmlrpc {
                  limit_except POST {
                    deny all;
                  }
                  include fastcgi_params;
                  fastcgi_param SCRIPT_FILENAME
$document_root/index_xmlrpc.php;
                  fastcgi_pass phpfarm;
                }

                location ~ ^/stats/store/.*\.gif$ {
                  include fastcgi_params;
                  fastcgi_param SCRIPT_FILENAME
$document_root/ezstats/user/storstats.php;
                  fastcgi_pass phpfarm;
                }

                location ~ ^/mediacatalogue/catalogue/(?<catitem>.*)$ {
                  alias /ezmediacatalogue/catalogue/$catitem;
                }

                location ~ ^/combine-css=(?<files>.+)$ {
                  include fastcgi_params;
                  fastcgi_param SCRIPT_FILENAME
$document_root/combine.php;
                  fastcgi_param QUERY_STRING
type=css&files=$files&$args;
                  fastcgi_pass phpfarm;
                }

               location ~ ^/combine-js=(?<files>.+)$ {
                  include fastcgi_params;
                  fastcgi_param SCRIPT_FILENAME
$document_root/combine.php;
                  fastcgi_param QUERY_STRING
type=javascript&files=$files&$args;
                  fastcgi_pass phpfarm;
                }

                location /extrnauth {
                  include fastcgi_params;
                  fastcgi_param SCRIPT_FILENAME
$document_root/ezahlers/user/non-eZ/externalauth.php;
                  fastcgi_pass phpfarm;
                }

                location ~ /elearning/.+\.php(/.+|$) {
                  include fastcgi_php.conf;
                  fastcgi_param PHP_VALUE
"include_path=$document_root:$document_root/ezahlers \n
register_globals=off \n display_errors=off";
                  fastcgi_pass phpfarm;
                }

                location = /upload-progress {
                  access_log off;
                  report_uploads uploads;
                }

                # deny certain locations directly

                location ~ ^(/(?!non-eZ/)[^/]*)+/[\w-]+\.php(/.+|$) {
                  deny all;
                }

                location /ezfilemanager/files {
                  deny all;
                }

                location /ezimagecatalogue/catalogue {
                  deny all;
                }

                location /elearning/moodledata {
                  deny all;
                }

                location /ratedb/import_files {
                  deny all;
                }

                # main php handler

                location ~ ^.+\.php(/.+|$) {
                  fastcgi_pass phpfarm;
                  track_uploads uploads 30s;
                }

        }
        
        
fastcgi_php.conf:

          include fastcgi_params;

          fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
          fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
          fastcgi_param PATH_INFO $fastcgi_path_info;
          fastcgi_param PATH_TRANSLATED
$document_root$fastcgi_path_info;

          fastcgi_param  SCRIPT_URL $script_url;
          fastcgi_param  SCRIPT_URI $scheme://$http_host$script_url;

          try_files $fastcgi_script_name =404;

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,222557,222586#msg-222586



Подробная информация о списке рассылки nginx-ru