B
B
Bogdan2017-06-07 16:39:46
Ruby on Rails
Bogdan, 2017-06-07 16:39:46

Where is the ENV["RAILS_MAX_THREADS"] variable set?

Hello. And do not tell me where the ENV["RAILS_MAX_THREADS"] constant changes, otherwise
users got an error

could not obtain a connection from the pool within 5.000 seconds (waited 5.000 seconds)

I googled what is needed in the database.yml file to increase the pool value. Would you like to change it through a constant? Thank you! Small clarification. Rails spin on Windows. Well, with the fact that these are environment variables, I have already figured out, but can I somehow transfer them without creating them?
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
Bogdan, 2017-06-07
@bogdan_uman

I'll answer myself :)
Everything was decided through foreman and the ".env" file in which you can set environment variables used in Rails

RAILS_MAX_THREADS=100
WEB_CONCURRENCY=2

A
Andrew, 2017-06-07
@undefined_title

env - enviroment, environment variable, if you have Linux set it on the command line, if locally you can do something like this:

touch .secrets.sh echo "export RAILS_MAX_THREADS=YOUR_MAX_THREADS" >> .secrets.sh && source .secrets.sh

D
Dmitri Sinitsa, 2017-06-07
@unabl4

Either in bash_profile (bash_rc) or in rbenv-vars

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question