comparison src/http/ngx_http_core_module.c @ 6443:fc72784b1f52

Threads: writing via threads pools in event pipe. The "aio_write" directive is introduced, which enables use of aio for writing. Currently it is meaningful only with "aio threads". Note that aio operations can be done by both event pipe and output chain, so proper mapping between r->aio and p->aio is provided when calling ngx_event_pipe() and in output filter. In collaboration with Valentin Bartenev.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 18 Mar 2016 06:44:49 +0300
parents cf3e75cfa951
children 155871d773cc
comparison
equal deleted inserted replaced
6442:6e10518f95d8 6443:fc72784b1f52
400 ngx_http_core_set_aio, 400 ngx_http_core_set_aio,
401 NGX_HTTP_LOC_CONF_OFFSET, 401 NGX_HTTP_LOC_CONF_OFFSET,
402 0, 402 0,
403 NULL }, 403 NULL },
404 404
405 { ngx_string("aio_write"),
406 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
407 ngx_conf_set_flag_slot,
408 NGX_HTTP_LOC_CONF_OFFSET,
409 offsetof(ngx_http_core_loc_conf_t, aio_write),
410 NULL },
411
405 { ngx_string("read_ahead"), 412 { ngx_string("read_ahead"),
406 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, 413 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
407 ngx_conf_set_size_slot, 414 ngx_conf_set_size_slot,
408 NGX_HTTP_LOC_CONF_OFFSET, 415 NGX_HTTP_LOC_CONF_OFFSET,
409 offsetof(ngx_http_core_loc_conf_t, read_ahead), 416 offsetof(ngx_http_core_loc_conf_t, read_ahead),
3606 clcf->client_body_in_single_buffer = NGX_CONF_UNSET; 3613 clcf->client_body_in_single_buffer = NGX_CONF_UNSET;
3607 clcf->internal = NGX_CONF_UNSET; 3614 clcf->internal = NGX_CONF_UNSET;
3608 clcf->sendfile = NGX_CONF_UNSET; 3615 clcf->sendfile = NGX_CONF_UNSET;
3609 clcf->sendfile_max_chunk = NGX_CONF_UNSET_SIZE; 3616 clcf->sendfile_max_chunk = NGX_CONF_UNSET_SIZE;
3610 clcf->aio = NGX_CONF_UNSET; 3617 clcf->aio = NGX_CONF_UNSET;
3618 clcf->aio_write = NGX_CONF_UNSET;
3611 #if (NGX_THREADS) 3619 #if (NGX_THREADS)
3612 clcf->thread_pool = NGX_CONF_UNSET_PTR; 3620 clcf->thread_pool = NGX_CONF_UNSET_PTR;
3613 clcf->thread_pool_value = NGX_CONF_UNSET_PTR; 3621 clcf->thread_pool_value = NGX_CONF_UNSET_PTR;
3614 #endif 3622 #endif
3615 clcf->read_ahead = NGX_CONF_UNSET_SIZE; 3623 clcf->read_ahead = NGX_CONF_UNSET_SIZE;
3827 ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0); 3835 ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
3828 ngx_conf_merge_size_value(conf->sendfile_max_chunk, 3836 ngx_conf_merge_size_value(conf->sendfile_max_chunk,
3829 prev->sendfile_max_chunk, 0); 3837 prev->sendfile_max_chunk, 0);
3830 #if (NGX_HAVE_FILE_AIO || NGX_THREADS) 3838 #if (NGX_HAVE_FILE_AIO || NGX_THREADS)
3831 ngx_conf_merge_value(conf->aio, prev->aio, NGX_HTTP_AIO_OFF); 3839 ngx_conf_merge_value(conf->aio, prev->aio, NGX_HTTP_AIO_OFF);
3840 ngx_conf_merge_value(conf->aio_write, prev->aio_write, 0);
3832 #endif 3841 #endif
3833 #if (NGX_THREADS) 3842 #if (NGX_THREADS)
3834 ngx_conf_merge_ptr_value(conf->thread_pool, prev->thread_pool, NULL); 3843 ngx_conf_merge_ptr_value(conf->thread_pool, prev->thread_pool, NULL);
3835 ngx_conf_merge_ptr_value(conf->thread_pool_value, prev->thread_pool_value, 3844 ngx_conf_merge_ptr_value(conf->thread_pool_value, prev->thread_pool_value,
3836 NULL); 3845 NULL);