SSL session cache lifetime vs session ticket lifetime
mdounin at mdounin.ru
Mon Mar 31 10:57:37 UTC 2014
On Fri, Mar 28, 2014 at 11:38:53PM +0400, Valentin V. Bartenev wrote:
> On Thursday 27 March 2014 20:23:15 Maxim Dounin wrote:
> > Hello!
> > On Wed, Mar 26, 2014 at 01:34:19PM +0400, kyprizel wrote:
> > > will be "log_alloc_failures" better?
> > I think something like "log_nomem" will be good enough.
> > Patch:
> > # HG changeset patch
> > # User Maxim Dounin <mdounin at mdounin.ru>
> > # Date 1395937285 -14400
> > # Thu Mar 27 20:21:25 2014 +0400
> > # Node ID 2cc8b9fc7efbf6a98ce29f3f860782a1ebd7e6cf
> > # Parent 734f0babfc133c2dc532f2794deadcf9d90245f7
> > Core: slab log_nomem flag.
> > The flag allows to suppress "ngx_slab_alloc() failed: no memory" messages
> > from a slab allocator, e.g., if an LRU expiration is used by a consumer
> > and allocation failures aren't fatal.
> > The flag is now set in the SSL session cache code, and in the limit_req
> > module.
> > diff --git a/src/core/ngx_slab.c b/src/core/ngx_slab.c
> > --- a/src/core/ngx_slab.c
> > +++ b/src/core/ngx_slab.c
> > @@ -129,6 +129,7 @@ ngx_slab_init(ngx_slab_pool_t *pool)
> > pool->pages->slab = pages;
> > }
> > + pool->log_nomem = 1;
> > pool->log_ctx = &pool->zero;
> > pool->zero = '\0';
> > }
> Just a quick nitpicking.
> I'd suggest to put this log_nomem assignment in the last line as to follow
> order of elements in the structure definition.
IMHO, it looks silly this way, and that's why it was placed just
before the log_ctx assignment.
Note well that the order of elements in the structure is more
about memory efficiency, and following the order isn't something
More information about the nginx