gzip causing high cpu load for streaming traffic

steveh nginx-forum at nginx.us
Sat Jan 8 07:06:18 MSK 2011


Ok found the problem the send of the flv or mp4 is being triggered by an
X-Accel-Redirect header who's content type is text/html. It seems this
header is maintained by nginx when processing the flv send instead of
setting up one from the configured mime.types.

This is because the flv modules calls ngx_http_set_content_type to set
this up which returns NGX_OK without making any changes if there is
already content_type for the request. An existing content_type already
seems to be being inherited from the original response containing the
X-Accel-Redirect header, hence no change and the problem.

The docs clear state this is the case here:
http://wiki.nginx.org/XSendfile

This doesn't effect mp4's which I was testing with originally as the mp4
module blindly sets video/mp4 so works fine in this case.

So sorry for the noise all a case of gotcha I'm afraid.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,164484,164504#msg-164504




More information about the nginx mailing list