Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4420 - trunk/src/http/modules

Anonymous User
January 30, 2012 05:02AM
Author: vbart
Date: 2012-01-30 10:01:39 +0000 (Mon, 30 Jan 2012)
New Revision: 4420

Modified:
trunk/src/http/modules/ngx_http_limit_req_module.c
Log:
Limit req: number of cleanup calls reduced.

Doing a cleanup before every lookup seems to be too aggressive. It can lead to
premature removal of the nodes still usable, which increases the amount of work
under a mutex lock and therefore decreases performance.

In order to improve cleanup behavior, cleanup function call has been moved right
before the allocation of a new node.


Modified: trunk/src/http/modules/ngx_http_limit_req_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_limit_req_module.c 2012-01-30 09:41:49 UTC (rev 4419)
+++ trunk/src/http/modules/ngx_http_limit_req_module.c 2012-01-30 10:01:39 UTC (rev 4420)
@@ -182,8 +182,6 @@

ngx_shmtx_lock(&ctx->shpool->mutex);

- ngx_http_limit_req_expire(ctx, 1);
-
rc = ngx_http_limit_req_lookup(lrcf, hash, vv->data, len, &excess);

ngx_shmtx_unlock(&ctx->shpool->mutex);
@@ -385,6 +383,8 @@
+ offsetof(ngx_http_limit_req_node_t, data)
+ len;

+ ngx_http_limit_req_expire(ctx, 1);
+
node = ngx_slab_alloc_locked(ctx->shpool, size);

if (node == NULL) {

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4420 - trunk/src/http/modules

Anonymous User 1023 January 30, 2012 05:02AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 214
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready