ngx.shared.dict - locking mechanism ?

Yichun Zhang (agentzh) agentzh at
Thu Nov 13 00:02:59 UTC 2014


On Wed, Nov 12, 2014 at 3:01 PM, josephlim wrote:
> I was wondering what happens when multiple workers access the
> ngx.shared.dict in the http lua module ? Are there conflicts/locking that
> could potentially impact performance of nginx? We are talking about 32
> workers in my use case.

It uses the lock mechanism provided by the nginx core to ensure
atomicity and consistency. Basically it uses spinlocks to try first,
failing that, falling back to semaphores.


More information about the nginx mailing list