Nginx – Buffer limit for nginx

nginxopenwrtperformancereverse-proxy

I'm using nginx on an embedded platform (OpenWRT) as a reverse proxy in front of an IP camera, and I'm having an issue where the camera is pushing data to nginx more quickly than nginx is able to off-load it to the next stage.

With the reverse proxy removed, extra frames just get dropped and that's that. But nginx seems to buffer a substantial amount of the camera data (as much as 10-15 seconds worth of it), which manifests itself as excruciating lag to the viewer.

So, firstly, are there obvious things that could be done to increase the throughput of the reverse proxy? I'm not using html parsing or translation, just filtering a few directories to other places, and proxying the rest to the camera. Do some of the other proxy features like packet inspection need to be explicitly disabled?

Secondly, how can I drastically reduce or eliminate nginx's willingness to accumulate this large buffer? I would prefer to see it drop packets when overloaded rather than storing them up.

Thanks.

Best Answer

You can turn buffering off entirely with http://wiki.nginx.org/HttpProxyModule#proxy_buffering However, I don't think you can make it drop data.