Bug 239464 - [patch] Add third-party slice patch with read ahead to www/nginx
Summary: [patch] Add third-party slice patch with read ahead to www/nginx
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jochen Neumeister
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-26 18:27 UTC by Ryan Steinmetz
Modified: 2019-08-06 08:49 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (joneum)


Attachments
slice readahead patch (17.66 KB, text/plain)
2019-07-26 18:27 UTC, Ryan Steinmetz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Steinmetz freebsd_committer freebsd_triage 2019-07-26 18:27:28 UTC
Created attachment 206085 [details]
slice readahead patch

Add additional (default disabled) patch to enable slice read ahead with the slice filter.
Comment 1 Jochen Neumeister freebsd_committer freebsd_triage 2019-07-29 18:40:57 UTC
Hey, Ryan,

thanks for the patch. Could you briefly explain what the module does exactly? For people who google, for example, who need something like that.
Thanks a lot :-)
Comment 2 Ryan Steinmetz freebsd_committer freebsd_triage 2019-07-29 18:46:06 UTC
The existing slice module (https://nginx.org/en/docs/http/ngx_http_slice_module.html) only starts fetching a given slice whenever bytes in that range for that slice is requested.

The patch allows you to configure a variable (slice_read_ahead X) which will cause nginx to start proactively reading X future slices.  This allows the node to start filling the cache ahead of the user to keep traffic less bursty as well as improve performance.
Comment 3 Ryan Steinmetz freebsd_committer freebsd_triage 2019-07-29 18:50:39 UTC
Er, to clarify: this patch allows you to control how many slices are read ahead of time.  By default, slice will read them all as fast as they can.  Even if a user just asked for bytes in the first slice and stopped their download.
Comment 4 Jochen Neumeister freebsd_committer freebsd_triage 2019-07-30 06:44:04 UTC
Heya Ryan,

I don't see a description for the module in "make config" right now. Can you confirm that?

[x] STREAM_SSL_PREREAD       Enable stream_ssl_preread module (SSL req.)
[x] HTTP_SLICE_AHEAD         
[ ] AJP                      3rd party ajp module 


This is included in the patch:
 HTTP_SLICE_DESC=		Enable http_slice module
 HTTP_SLICE_AHEAD=		Enable slice read ahead patch
 HTTP_SSL_DESC=			Enable http_ssl module

it is missing the "Enable slice read ahead patch"
Comment 5 Ryan Steinmetz freebsd_committer freebsd_triage 2019-07-30 14:42:07 UTC
Sorry, typo on my part:

HTTP_SLICE_AHEAD=
should be
HTTP_SLICE_AHEAD_DESC=

I can generate a new patch if required, just let me know.
Comment 6 Jochen Neumeister freebsd_committer freebsd_triage 2019-08-01 08:46:18 UTC
From which source should the module be downloaded?
Comment 7 Ryan Steinmetz freebsd_committer freebsd_triage 2019-08-01 11:30:30 UTC
It's included in the diff as a patch.
Comment 8 Jochen Neumeister freebsd_committer freebsd_triage 2019-08-02 06:18:05 UTC
i dont find infos for a download into the diff
Comment 9 Ryan Steinmetz freebsd_committer freebsd_triage 2019-08-02 12:09:27 UTC
It is not a separate download.  It is a patch that is included in the diff that is optionally applied whenever the option is enabled:


===================================================================
--- files/extra-patch-src_http_modules_ngx__http__slice_read_ahead.c	(nonexistent)
+++ files/extra-patch-src_http_modules_ngx__http__slice_read_ahead.c	(revision 507359)
@@ -0,0 +1,456 @@
+--- src/http/modules/ngx_http_slice_filter_module.c.orig	2019-04-23 13:12:58 UTC
++++ src/http/modules/ngx_http_slice_filter_module.c
+@@ -2,6 +2,10 @@
+ /*
+  * Copyright (C) Roman Arutyunyan
+  * Copyright (C) Nginx, Inc.
++ * Copyright (C) Carey Gister
++ * Copyright (C) Metapeer, Inc.
++ *
++ * Retrieve slices with an optional look-a-head of N slices where N is a float value.
+  */
Comment 10 commit-hook freebsd_committer freebsd_triage 2019-08-06 08:46:58 UTC
A commit references this bug:

Author: joneum
Date: Tue Aug  6 08:46:37 UTC 2019
New revision: 508238
URL: https://svnweb.freebsd.org/changeset/ports/508238

Log:
  - Add https to MASTER_SITES
  - Add third-party slice read ahead patch

  PR:		239464 239083
  Sponsored by:	Netzkommune GmbH

Changes:
  head/www/nginx/Makefile
  head/www/nginx/Makefile.extmod
  head/www/nginx/Makefile.options.desc
  head/www/nginx/files/extra-patch-src_http_modules_ngx__http__slice_read_ahead.c