Welcome! Log In Create A New Profile

Advanced

Re: CentOS 5.5 + nginx + aio

October 17, 2010 06:53AM
>diff -u
]# diff -u -r nginx-0.8.50 nginx-0.8.50-patched/
diff -u -r nginx-0.8.50/src/core/ngx_output_chain.c nginx-0.8.50-patched/src/core/ngx_output_chain.c
--- nginx-0.8.50/src/core/ngx_output_chain.c 2010-10-15 22:33:14.000000000 +0600
+++ nginx-0.8.50-patched/src/core/ngx_output_chain.c 2010-10-15 04:48:47.000000000 +0600
@@ -74,18 +74,18 @@
}
}

+#if (NGX_HAVE_FILE_AIO)
+ if (ctx->aio) {
+ return NGX_AGAIN;
+ }
+#endif
+
out = NULL;
last_out = &out;
last = NGX_NONE;

for ( ;; ) {

-#if (NGX_HAVE_FILE_AIO)
- if (ctx->aio) {
- return NGX_AGAIN;
- }
-#endif
-
while (ctx->in) {

/*
diff -u -r nginx-0.8.50/src/http/ngx_http_copy_filter_module.c nginx-0.8.50-patched/src/http/ngx_http_copy_filter_module.c
--- nginx-0.8.50/src/http/ngx_http_copy_filter_module.c 2010-05-14 18:18:44.000000000 +0600
+++ nginx-0.8.50-patched/src/http/ngx_http_copy_filter_module.c 2010-10-15 04:53:23.000000000 +0600
@@ -118,8 +118,10 @@
ctx->filter_ctx = r;

#if (NGX_HAVE_FILE_AIO)
- if (ngx_file_aio && clcf->aio) {
- ctx->aio_handler = ngx_http_copy_aio_handler;
+ if (ngx_file_aio) {
+ if (clcf->aio) {
+ ctx->aio_handler = ngx_http_copy_aio_handler;
+ }
#if (NGX_HAVE_AIO_SENDFILE)
c->aio_sendfile = (clcf->aio == NGX_HTTP_AIO_SENDFILE);
#endif
@@ -156,6 +158,11 @@
ngx_file_t *file;
ngx_http_ephemeral_t *e;

+ if (r->aio) {
+ c->busy_sendfile = NULL;
+ return rc;
+ }
+
file = c->busy_sendfile->file;
offset = c->busy_sendfile->file_pos;

@@ -211,6 +218,8 @@

r->main->blocked++;
r->aio = 1;
+
+ ctx->aio = 1;
}


diff -u -r nginx-0.8.50/src/http/ngx_http_request.c nginx-0.8.50-patched/src/http/ngx_http_request.c
--- nginx-0.8.50/src/http/ngx_http_request.c 2010-07-05 19:35:20.000000000 +0600
+++ nginx-0.8.50-patched/src/http/ngx_http_request.c 2010-10-15 04:53:23.000000000 +0600
@@ -2218,17 +2218,17 @@
return;
}

- } else {
- if (wev->delayed || r->aio) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, wev->log, 0,
- "http writer delayed");
+ }

- if (ngx_handle_write_event(wev, clcf->send_lowat) != NGX_OK) {
- ngx_http_close_request(r, 0);
- }
+ if (wev->delayed || r->aio) {
+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, wev->log, 0,
+ "http writer delayed");

- return;
+ if (ngx_handle_write_event(wev, clcf->send_lowat) != NGX_OK) {
+ ngx_http_close_request(r, 0);
}
+
+ return;
}

rc = ngx_http_output_filter(r, NULL);
@@ -2244,7 +2244,7 @@

if (r->buffered || r->postponed || (r == r->main && c->buffered)) {

- if (!wev->ready && !wev->delayed) {
+ if (!wev->delayed) {
ngx_add_timer(wev, clcf->send_timeout);
}

diff -u -r nginx-0.8.50/src/os/unix/ngx_linux_aio_read.c nginx-0.8.50-patched/src/os/unix/ngx_linux_aio_read.c
--- nginx-0.8.50/src/os/unix/ngx_linux_aio_read.c 2009-11-05 19:12:30.000000000 +0600
+++ nginx-0.8.50-patched/src/os/unix/ngx_linux_aio_read.c 2010-10-15 04:48:47.000000000 +0600
@@ -95,6 +95,10 @@
n = io_submit(ngx_aio_ctx, 1, piocb);

if (n == 1) {
+ ev->active = 1;
+ ev->ready = 0;
+ ev->complete = 0;
+
return NGX_AGAIN;
}



>grep alert /path/to/error.log
Очень много алертов. Кусок:

2010/10/17 16:39:08 [alert] 18916#0: *159817 second aio post for "file.mp4" while sending response to client, client: 77.244.215.40, server: example.com, request: "GET file.mp4 HTTP/1.1", host: "example.com"
2010/10/17 16:40:03 [alert] 18899#0: *113623 second aio post for "file.mp4" while sending response to client, client: 212.142.93.180, server: example.com, request: "GET file.mp4 HTTP/1.1", host: "example.com"
Subject Author Posted

CentOS 5.5 + nginx + aio

Alex Vorona July 06, 2010 03:24AM

Re: CentOS 5.5 + nginx + aio

hg_04 July 06, 2010 04:59AM

Re: CentOS 5.5 + nginx + aio

Alex Vorona July 06, 2010 05:04AM

Re: CentOS 5.5 + nginx + aio

Boris Dolgov July 06, 2010 05:06AM

Re: CentOS 5.5 + nginx + aio

Panasonic1 October 14, 2010 06:10PM

Re: CentOS 5.5 + nginx + aio

Panasonic1 October 14, 2010 06:55PM

Re: CentOS 5.5 + nginx + aio

Panasonic1 October 15, 2010 06:23AM

Re: CentOS 5.5 + nginx + aio

Panasonic1 October 15, 2010 07:55AM

Re: CentOS 5.5 + nginx + aio

Panasonic1 October 15, 2010 01:53PM

Re: CentOS 5.5 + nginx + aio

Panasonic1 October 16, 2010 02:21AM

Re: CentOS 5.5 + nginx + aio

Panasonic1 October 17, 2010 06:53AM

Re: CentOS 5.5 + nginx + aio

Maxim Dounin October 14, 2010 06:26PM

Re: CentOS 5.5 + nginx + aio

Maxim Dounin October 15, 2010 07:18AM

Re: CentOS 5.5 + nginx + aio

Maxim Dounin October 15, 2010 09:34AM

Re: CentOS 5.5 + nginx + aio

Alex Vorona October 15, 2010 04:14PM

Re: CentOS 5.5 + nginx + aio

Maxim Dounin October 16, 2010 06:14AM

Re: CentOS 5.5 + nginx + aio

Maxim Dounin October 17, 2010 08:02AM

Re: CentOS 5.5 + nginx + aio

Alex Vorona October 12, 2010 02:06PM

Re: CentOS 5.5 + nginx + aio

Alex Sergeyev October 12, 2010 02:10PM

Re: CentOS 5.5 + nginx + aio

Maxim Dounin October 12, 2010 02:32PM

Re: CentOS 5.5 + nginx + aio

Alex Vorona October 12, 2010 03:06PM

Re: CentOS 5.5 + nginx + aio

Maxim Dounin October 12, 2010 04:08PM

Re: CentOS 5.5 + nginx + aio

Alex Vorona October 13, 2010 03:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 92
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready