﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
84	failed (12: Cannot allocate memory) while sending mp4 to client	Vlad K	somebody	"File:
{{{
-rw------- 1 web web 2954987161 Jan  9 15:02 /xxxxxx/attachments/31/504/df213e53-926f-4660-94ee-e52a9f6fdca0.mp4
}}}

Nginx.conf:
{{{
http {
    include            mime.types;
    default_type       application/octet-stream;

    sendfile           off;  # Tried both with sendfile on and off
    server_names_hash_max_size          2048;
    server_names_hash_bucket_size       128;
    gzip                                on;
    gzip_min_length                     1000;
    gzip_buffers                        2000 64k;
    gzip_types                          text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    gzip_static                         on;
    client_max_body_size                5500m;
    client_body_buffer_size             256k;
    client_header_buffer_size           1k;
    large_client_header_buffers         4 4k;
    output_buffers                      1 32k;
    postpone_output                     1460;
    client_header_timeout               3m;
    client_body_timeout                 3m;
    send_timeout                        3m;
    proxy_connect_timeout               90;
    proxy_send_timeout                  90;
    proxy_read_timeout                  90;
    proxy_buffer_size                   4k;
    proxy_buffers                       4 32k;
    proxy_busy_buffers_size             64k;
    proxy_temp_file_write_size          64k;
    client_body_temp_path  tmp/client_temp;
    proxy_temp_path        tmp/proxy_temp;
    fastcgi_temp_path      tmp/fastcgi_temp;

    server {
        listen       80;
        server_name  localhost;
        access_log   nginx-access.log;
        server_name_in_redirect  off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      ===== cut =====

        location ~ /file/(.+\.mp4)$ {
            sendfile off;
            alias  $alias$1;
            mp4;
            mp4_buffer_size     5m;
            mp4_max_buffer_size 40m;
        }
}}}

Request:
{{{
- - [11/Jan/2012:20:07:59 +0800] ""GET /file/attachments/31/504/df213e53-926f-4660-94ee-e52a9f6fdca0.mp4?start=1000 HTTP/1.0"" 200 48979 ""-"" ""Wget/1.12 (linux-gnu)""
}}}

Nginx error message:
{{{
2012/01/11 20:07:59 [emerg] 15463#0: *1 malloc(18446744072188658253) failed (12: Cannot allocate memory) while sending mp4 to client, client: xxxxx, server: localhost, request: ""GET /file/attachments/31/504/df213e53-926f-4660-94ee-e52a9f6fdca0.mp4?start=1000 HTTP/1.0"", host: ""xxxxx""
}}}
OS:
{{{
CentOS Linux release 6.0 (Final)
}}}

Free:
{{{
# free
             total       used       free     shared    buffers     cached
Mem:       2055616    1648424     407192          0     175648    1226188
-/+ buffers/cache:     246588    1809028
Swap:      4128760          0    4128760
}}}
"	defect	closed	minor		nginx-module	1.1.x	fixed	mp4		" uname -a 
Linux cnha1.zencoo.com 2.6.32-71.el6.x86_64 #1 SMP Fri May 20 03:51:51 BST 2011 x86_64 x86_64 x86_64 GNU/Linux
Linux 2.6.32-71.el6.x86_64 #1 SMP Fri May 20 03:51:51 BST 2011 x86_64 x86_64 x86_64 "	"nginx version: nginx/1.1.12
built by gcc 4.4.5 20110214 (Red Hat 4.4.5-6) (GCC) 
TLS SNI support enabled
configure arguments: --user=propus --group=propus --prefix=/var/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --add-module=../nginx_upload_module-2.2.0 --add-module=../nginx_accept_language_module --add-module=../nginx_http_push_module-0.692 --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-file-aio --with-ipv6 --with-cc-opt='-O2 -g' --with-ld-opt=-Wl,-E"
