Opened 3 years ago

Closed 3 years ago

#1345 closed enhancement (invalid)

improve slice subrequest memory free

Reported by: cjhust@… Owned by:
Priority: minor Milestone:
Component: other Version: 1.11.x
Keywords: Cc:
uname -a: 3.10.0-327.22.2.el7.x86_64
nginx -V: nginx version: nginx/1.12.1
configure arguments: --prefix=/root/cjhust --with-debug --with-http_stub_status_module --with-http_slice_module --with-pcre=addons/pcre-8.40

Description

server {

listen 9001;
server_name localhost;


location / {

root html;

}

}

server {

listen 9000;

proxy_max_temp_file_size 0;

location / {

slice 64k;
proxy_set_header range $slice_range;
proxy_pass http://127.0.0.1:9001;

}

}

#curl http://127.0.0.1:9000/1G.mp4 -o /dev/null -v --limit-rate 3000000
the memory will keep growing.


after patch https://github.com/cjhust/ngx_mod/blob/master/patches/nginx-1.12.1-slice-memory-free.patch

the memory will not keep growing.

this patch also runs for a good while on our CDN system.

Change History (1)

comment:1 by Roman Arutyunyan, 3 years ago

Resolution: invalid
Status: newclosed

The patch looks dirty. Pool reference is irrelevant to the ngx_buf_t structure in which you put it. Detecting the point where subrequest buffers are no longer needed is unreliable.

It would be enough to release proxy_buffers/proxy_buffer_size and output_buffers, but it's not clear how to do this properly. Other allocations are usually small and probably can be ignored.

PS: Patches are normally submitted via nginx-devel@… mailing list.

Note: See TracTickets for help on using tickets.