]> git.kaiwu.me - nginx.git/commitdiff
log 503 error reason
authorIgor Sysoev <igor@sysoev.ru>
Mon, 8 Dec 2008 14:12:29 +0000 (14:12 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 8 Dec 2008 14:12:29 +0000 (14:12 +0000)
src/http/modules/ngx_http_limit_zone_module.c

index 824803d34f333abcb9b50626d210d81181c3a233..3fc4efada8ddbc17a6b5f2241c4e05ca042689e1 100644 (file)
@@ -189,6 +189,10 @@ ngx_http_limit_zone_handler(ngx_http_request_t *r)
 
                 ngx_shmtx_unlock(&shpool->mutex);
 
+                ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+                              "limiting connections by zone \"%V\"",
+                              &lzcf->shm_zone->name);
+
                 return NGX_HTTP_SERVICE_UNAVAILABLE;
             }
 
@@ -206,6 +210,11 @@ ngx_http_limit_zone_handler(ngx_http_request_t *r)
     node = ngx_slab_alloc_locked(shpool, n);
     if (node == NULL) {
         ngx_shmtx_unlock(&shpool->mutex);
+
+        ngx_log_error(NGX_LOG_CRIT, r->connection->log, 0,
+                      "could not allocate memory in zone \"%V\"",
+                      &lzcf->shm_zone->name);
+
         return NGX_HTTP_SERVICE_UNAVAILABLE;
     }