# Nginx variables\_hash error

**URL:** <https://www.ruby-forum.com/t/nginx-variables-hash-error/205953>\
**Category:** NGINX\
**Created:** [April 19, 2011, 11:41am UTC](https://www.ruby-forum.com/t/nginx-variables-hash-error/205953 "2011-04-19T11:41:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [April 19, 2011, 11:41am UTC](https://www.ruby-forum.com/t/nginx-variables-hash-error/205953/1 "2011-04-19T11:41:30Z")

</div>

Hi Guys, I have started getting this error on some of my servers today.  
I have an automated system which generates configuration files based  
upon how many customers we have. Our nginx servers currently run MANY  
sites (server directives) and all of a sudden we started getting the  
follow error when trying to do an nginx reload…

[emerg]: could not build the variables\_hash, you should increase either  
variables\_hash\_max\_size: 512 or variables\_hash\_bucket\_size: 64  
configuration file /etc/nginx/conf/nginx.conf test failed

Any ideas on what is causing this and how I could resolve it. I have  
looked for a directive variables\_hash\_max\_size or  
variables\_hash\_bucket\_size on the wiki and I cannot find any  
documentation covering a directive with those names. Is this a  
compilation option I need to change to allow for more configurations?

The odd thing is, we have multiple servers and only some of the servers  
are having this issue. We are using nginx 0.8.53 on these servers.

Posted at Nginx Forum:

> **[Nginx variables\_hash error](https://forum.nginx.org/read.php?2,192277,192277#msg-192277)**
>
> Hi Guys, I have started getting this error on some of my servers today. I have an automated system which generates configuration files based upon how many customers we have. Our nginx servers currently run MANY sites (server directives) and all of a...

---

<div class="post-metadata">

**Author:** ![Nam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/41988e/32.png) [@Nam](https://www.ruby-forum.com/u/Nam)\
**Post date:** [April 19, 2011, 12:26pm UTC](https://www.ruby-forum.com/t/nginx-variables-hash-error/205953/2 "2011-04-19T12:26:39Z")

</div>

Hello!

On Tue, Apr 19, 2011 at 05:40:26AM -0400, Nam wrote:

> Any ideas on what is causing this and how I could resolve it.  
> [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/Optimizations#Hash_Tables)

Setting bigger variables\_hash\_max\_size and/or  
variables\_hash\_bucket\_size will indeed help.

> I have  
> looked for a directive variables\_hash\_max\_size or  
> variables\_hash\_bucket\_size on the wiki and I cannot find any  
> documentation covering a directive with those names. Is this a  
> compilation option I need to change to allow for more configurations?

No. This is just configuration directives of http core module,  
allowed at http{} level. Undocumented due to ENOTIME, but they  
are mostly covered by generic hash documentation.

> The odd thing is, we have multiple servers and only some of the servers  
> are having this issue. We are using nginx 0.8.53 on these servers.

This only occurs when using many (or long) variables in  
config.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Nam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/41988e/32.png) [@Nam](https://www.ruby-forum.com/u/Nam)\
**Post date:** [April 19, 2011, 12:36pm UTC](https://www.ruby-forum.com/t/nginx-variables-hash-error/205953/3 "2011-04-19T12:36:31Z")

</div>

On Tue, Apr 19, 2011 at 05:40:26AM -0400, Nam wrote:

> Any ideas on what is causing this and how I could resolve it. I have  
> looked for a directive variables\_hash\_max\_size or  
> variables\_hash\_bucket\_size on the wiki and I cannot find any  
> documentation covering a directive with those names. Is this a  
> compilation option I need to change to allow for more configurations?
> 
> The odd thing is, we have multiple servers and only some of the servers  
> are having this issue. We are using nginx 0.8.53 on these servers.

As Maxim suggests already:

http {  
variables\_hash\_max\_size 1024;

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![Nam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/41988e/32.png) [@Nam](https://www.ruby-forum.com/u/Nam)\
**Post date:** [April 19, 2011, 10:57pm UTC](https://www.ruby-forum.com/t/nginx-variables-hash-error/205953/4 "2011-04-19T22:57:38Z")

</div>

Thank you very much Igor and Maxim, I appreciate the help and the  
settings have indeed fixed the problem. Thanks again for both of you,  
and thanks for nginx.

Posted at Nginx Forum:

> **[Re: Nginx variables\_hash error](https://forum.nginx.org/read.php?2,192277,192433#msg-192433)**
>
> Hi Guys, I have started getting this error on some of my servers today. I have an automated system which generates configuration files based upon how many customers we have. Our nginx servers currently run MANY sites (server directives) and all of a...
