Forum: NGINX cannot build variables_hash

D7ae0b9a7a7dac25f83121ff45877be7?d=identicon&s=25 John Watson (Guest)
on 2013-07-25 00:49
(Received via mailing list)
Upgraded from 1.2.9 to 1.4.1 and now started getting:

  [emerg] could not build the variables_hash, you should increase either
variables_hash_max_size: 512 or variables_hash_bucket_size: 64

Same configuration and even dropped (2) 3rd party modules.

nginx.conf and ./configure params:
https://gist.github.com/dctrwatson/6075317

adding this to http block fixes it:
  variables_hash_max_size 1024;

Any ideas? Or direction on debugging?

Thanks,

John
36a8284995fa0fb82e6aa2bede32adac?d=identicon&s=25 Francis Daly (Guest)
on 2013-07-25 02:36
(Received via mailing list)
On Wed, Jul 24, 2013 at 03:49:05PM -0700, John Watson wrote:

Hi there,

> Upgraded from 1.2.9 to 1.4.1 and now started getting:
>
>   [emerg] could not build the variables_hash, you should increase either
> variables_hash_max_size: 512 or variables_hash_bucket_size: 64

<snip>

> adding this to http block fixes it:
>   variables_hash_max_size 1024;
>
> Any ideas? Or direction on debugging?

What's the problem?

You got an error message which asked you to change one of two
directives;
you checked the documentation for those directives which pointed you to
another document which told you which one to change first; you changed
that one; and the error state no longer applies.

It looks perfect from here.

  f
--
Francis Daly        francis@daoine.org
01d109477433f1725357f49c29267615?d=identicon&s=25 Andrew Alexeev (Guest)
on 2013-07-25 12:55
(Received via mailing list)
On Jul 25, 2013, at 2:49 AM, John Watson <john@disqus.com> wrote:

>
> Any ideas? Or direction on debugging?

Hi John,

Any chance you could check it with 1.4.1+ and without _any_ 3rd party
modules?
D7ae0b9a7a7dac25f83121ff45877be7?d=identicon&s=25 John Watson (Guest)
on 2013-07-29 23:45
(Received via mailing list)
Hi Andrew,

Woops, completely forgot about doing that first before posting here.

It seems the issue is v0.21 of
http://wiki.nginx.org/NginxHttpSRCacheModulethat causes this issue.
I'll file a bug with agentzh on his Github repo.

Thanks for your help!
37f3ea777f96500b332a1a89d6027897?d=identicon&s=25 Yichun Zhang (agentzh) (Guest)
on 2013-07-30 20:49
(Received via mailing list)
Hello!

On Mon, Jul 29, 2013 at 2:44 PM, John Watson wrote:
> It seems the issue is v0.21 of http://wiki.nginx.org/NginxHttpSRCacheModule
> that causes this issue. I'll file a bug with agentzh on his Github repo.
>

Just for the reference, there is no bugs in ngx_srcache.

It's just that enabling many nginx modules (including standard ones
and 3rd-party ones) exceeds the variables_hash_max_size limit (default
value). See below for more details:

    https://github.com/agentzh/srcache-nginx-module/issues/21

Given the current rich ecosystem of nginx, maybe the nginx core should
increase the default value of variables_hash_max_size? Not sure
though.

Regards,
-agentzh
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2013-07-31 16:04
(Received via mailing list)
Hello!

On Tue, Jul 30, 2013 at 11:49:35AM -0700, Yichun Zhang (agentzh) wrote:

> and 3rd-party ones) exceeds the variables_hash_max_size limit (default
> value). See below for more details:
>
>     https://github.com/agentzh/srcache-nginx-module/issues/21
>
> Given the current rich ecosystem of nginx, maybe the nginx core should
> increase the default value of variables_hash_max_size? Not sure
> though.

How many variables are in total in the configuration in question?
Standard nginx with almost all modules compiled in (and a few
extra modules) here has just 114 variables, and 512 looks big
enough.

I suspect the real problem is hash collisions.  Especially this used
to hit people under qemu where cache line size of an emulated CPU
is detected as 32 by nginx, see here:

http://trac.nginx.org/nginx/ticket/352

Not sure how to properly address it though.  Right now I think
just automatically doubling bucket_size if we wasn't able to build
hash might be a good idea.

--
Maxim Dounin
http://nginx.org/en/donation.html
37f3ea777f96500b332a1a89d6027897?d=identicon&s=25 Yichun Zhang (agentzh) (Guest)
on 2013-08-01 01:05
(Received via mailing list)
Hello!

On Wed, Jul 31, 2013 at 7:03 AM, Maxim Dounin wrote:
>
> How many variables are in total in the configuration in question?

I've just checked. There are only 124 variables.

>
> I suspect the real problem is hash collisions.

Yeah, it seems like that :)

>  Especially this used
> to hit people under qemu where cache line size of an emulated CPU
> is detected as 32 by nginx, see here:
>

Well, this is a modern Linux x86_64 system running on real hardware
though :)

> Not sure how to properly address it though.  Right now I think
> just automatically doubling bucket_size if we wasn't able to build
> hash might be a good idea.
>

Yeah, this work-around looks good to me :)

Best regards,
-agentzh
2974d09ac2541e892966b762aad84943?d=identicon&s=25 icecola123 (Guest)
on 2013-08-02 04:02
(Received via mailing list)
Choose your favorite products and items, tell your life to bring some
fun,
welcome to join efox shop

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,241210,241467#msg-241467
2974d09ac2541e892966b762aad84943?d=identicon&s=25 icecola123 (Guest)
on 2013-08-05 04:14
(Received via mailing list)
Want to buy good quality and cheap tablet you, here is a good choice
efox

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,241210,241561#msg-241561
2974d09ac2541e892966b762aad84943?d=identicon&s=25 icecola123 (Guest)
on 2013-08-05 04:15
(Received via mailing list)
Want to buy good quality and cheap tablet you, here is a good choice
efox

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,241210,241562#msg-241562
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.