summaryrefslogtreecommitdiffhomepage
path: root/src/http
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-09-30 13:21:52 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-09-30 13:21:52 +0000
commit3266171fd4691d173f698f1c0c246322a94588e2 (patch)
treec6ff4969a31639d546af48a644c5c11b5716b82d /src/http
parent687b0e99ea4ff631e447fff2d177d0c9297529fc (diff)
downloadnginx-3266171fd4691d173f698f1c0c246322a94588e2.tar.gz
nginx-3266171fd4691d173f698f1c0c246322a94588e2.tar.bz2
read_ahead
Diffstat (limited to 'src/http')
-rw-r--r--src/http/modules/ngx_http_flv_module.c1
-rw-r--r--src/http/modules/ngx_http_gzip_static_module.c1
-rw-r--r--src/http/modules/ngx_http_index_module.c1
-rw-r--r--src/http/modules/ngx_http_static_module.c1
-rw-r--r--src/http/modules/perl/nginx.xs1
-rw-r--r--src/http/ngx_http_core_module.c9
-rw-r--r--src/http/ngx_http_core_module.h1
-rw-r--r--src/http/ngx_http_file_cache.c1
-rw-r--r--src/http/ngx_http_script.c1
9 files changed, 17 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_flv_module.c b/src/http/modules/ngx_http_flv_module.c
index 2afeb2809..995ac830e 100644
--- a/src/http/modules/ngx_http_flv_module.c
+++ b/src/http/modules/ngx_http_flv_module.c
@@ -106,6 +106,7 @@ ngx_http_flv_handler(ngx_http_request_t *r)
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
+ of.read_ahead = clcf->read_ahead;
of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;
diff --git a/src/http/modules/ngx_http_gzip_static_module.c b/src/http/modules/ngx_http_gzip_static_module.c
index 8080d9cb0..25ab64ca4 100644
--- a/src/http/modules/ngx_http_gzip_static_module.c
+++ b/src/http/modules/ngx_http_gzip_static_module.c
@@ -124,6 +124,7 @@ ngx_http_gzip_static_handler(ngx_http_request_t *r)
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
+ of.read_ahead = clcf->read_ahead;
of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;
diff --git a/src/http/modules/ngx_http_index_module.c b/src/http/modules/ngx_http_index_module.c
index b58aa97c2..fe2a121b6 100644
--- a/src/http/modules/ngx_http_index_module.c
+++ b/src/http/modules/ngx_http_index_module.c
@@ -205,6 +205,7 @@ ngx_http_index_handler(ngx_http_request_t *r)
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
+ of.read_ahead = clcf->read_ahead;
of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;
diff --git a/src/http/modules/ngx_http_static_module.c b/src/http/modules/ngx_http_static_module.c
index bc46b84a7..6743e769d 100644
--- a/src/http/modules/ngx_http_static_module.c
+++ b/src/http/modules/ngx_http_static_module.c
@@ -91,6 +91,7 @@ ngx_http_static_handler(ngx_http_request_t *r)
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
+ of.read_ahead = clcf->read_ahead;
of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;
diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs
index 077cf0ddf..8a20c4373 100644
--- a/src/http/modules/perl/nginx.xs
+++ b/src/http/modules/perl/nginx.xs
@@ -648,6 +648,7 @@ sendfile(r, filename, offset = -1, bytes = 0)
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
+ of.read_ahead = clcf->read_ahead;
of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 19d088160..9c00206d4 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -408,6 +408,13 @@ static ngx_command_t ngx_http_core_commands[] = {
#endif
+ { ngx_string("read_ahead"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_size_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_core_loc_conf_t, read_ahead),
+ NULL },
+
{ ngx_string("directio"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
ngx_http_core_directio,
@@ -2957,6 +2964,7 @@ ngx_http_core_create_loc_conf(ngx_conf_t *cf)
#if (NGX_HAVE_FILE_AIO)
lcf->aio = NGX_CONF_UNSET;
#endif
+ lcf->read_ahead = NGX_CONF_UNSET_SIZE;
lcf->directio = NGX_CONF_UNSET;
lcf->directio_alignment = NGX_CONF_UNSET;
lcf->tcp_nopush = NGX_CONF_UNSET;
@@ -3158,6 +3166,7 @@ ngx_http_core_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
#if (NGX_HAVE_FILE_AIO)
ngx_conf_merge_value(conf->aio, prev->aio, 0);
#endif
+ ngx_conf_merge_size_value(conf->read_ahead, prev->read_ahead, 0);
ngx_conf_merge_off_value(conf->directio, prev->directio,
NGX_MAX_OFF_T_VALUE);
ngx_conf_merge_off_value(conf->directio_alignment, prev->directio_alignment,
diff --git a/src/http/ngx_http_core_module.h b/src/http/ngx_http_core_module.h
index 9946c4f33..9d585e4ec 100644
--- a/src/http/ngx_http_core_module.h
+++ b/src/http/ngx_http_core_module.h
@@ -332,6 +332,7 @@ struct ngx_http_core_loc_conf_s {
size_t limit_rate; /* limit_rate */
size_t limit_rate_after; /* limit_rate_after */
size_t sendfile_max_chunk; /* sendfile_max_chunk */
+ size_t read_ahead; /* read_ahead */
ngx_msec_t client_body_timeout; /* client_body_timeout */
ngx_msec_t send_timeout; /* send_timeout */
diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c
index ca333fc14..4caca919a 100644
--- a/src/http/ngx_http_file_cache.c
+++ b/src/http/ngx_http_file_cache.c
@@ -281,6 +281,7 @@ ngx_http_file_cache_open(ngx_http_request_t *r)
of.min_uses = clcf->open_file_cache_min_uses;
of.events = clcf->open_file_cache_events;
of.directio = NGX_OPEN_FILE_DIRECTIO_OFF;
+ of.read_ahead = clcf->read_ahead;
if (ngx_open_cached_file(clcf->open_file_cache, &c->file.name, &of, r->pool)
!= NGX_OK)
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
index a92b1995a..f79345715 100644
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -1407,6 +1407,7 @@ ngx_http_script_file_code(ngx_http_script_engine_t *e)
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
+ of.read_ahead = clcf->read_ahead;
of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;