Samuel Davies
Samuel Davies

Reputation: 152

AWS Elastic Beanstalk [warn]: could not build optimal types_hash, you should increase types_hash_max_size..?

I have created an API and successfully deployed it via AWS Elastic Beanstalk. The server is running and works as expected.

However, i downloaded the log file and the error.log shows [warn] xxxx#xxxx: could not build optimal types_hash, you should increase types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size

I am not sure what this warning means and how i fix it. From my understanding this warning is related to NGINX, but that's about as much as i know.

I have looked around and it seems i may be able to resolve this through implementing a .ebextensions directory and then subsequent <filename>.config files but I don't know which files are needed, if any?

I am new to AWS, and to deploying projects in general, so any help would be greatly appreciated!

Upvotes: 5

Views: 4524

Answers (1)

Andy
Andy

Reputation: 5091

This can be resolved this by creating a configuration file within .platform/nginx/conf.d, say 10-types-hash.conf:

# .platform/nginx/conf.d/10-types-hash.conf
types_hash_max_size 4096;

During the deployment process, Elastic Beanstalk copies this file to the /etc/nginx/conf.d directory which the main /etc/nginx/nginx.conf configuration file includes within its http config block.

You may need to adjust the 4096 value. I tested by SSH-ing into an instance and upping the value then running nginx -t until the warning went away.

Upvotes: 1

Related Questions