Modules behaving differently on 32-bit and 64-bit systems?

andrewc nginx-forum at
Tue Oct 22 02:35:06 UTC 2013

Maxim Dounin Wrote:

> Quick looks suggests that the problem in xtoken module is likely 
> here:
> http_xtoken_module.c#660
> It tries to estimate size of shared memory zone needed to keep 
> it's data, but the estimate likely fails on 64-bit platforms due 
> to internal structures of slab allocator being bigger on these 
> platforms.

Thanks for the tip, Maxim. On line 13 of ngx_http_token_module.c I

#define XTOKEN_SHM_SIZE    (sizeof(ngx_http_xtoken_shctx_t))


#define XTOKEN_SHM_SIZE 65536

and rebuilt. It seems to work fine now.

65536 is purely arbitrary, and obviously not the most efficient use of
memory. I'll do some reading and see if I can rework that memory allocation



Posted at Nginx Forum:,243883,243943#msg-243943

More information about the nginx mailing list