Created
January 24, 2016 21:31
-
-
Save rud/180a91e9ced34e5e3bbb to your computer and use it in GitHub Desktop.
ActiveRecord::Base - set short timeouts for production queries, nothing end-users do should be taking this long
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Do not suffer slow queries in production: | |
aggressive_timeout_settings: &aggressive_timeout_settings | |
adapter: postgresql | |
encoding: unicode | |
connect_timeout: 1 # second - network handshake time | |
checkout_timeout: 1 # second - connection pool checkout wait time | |
variables: | |
statement_timeout: 2500 # ms - maximum time for a single SQL query | |
production: | |
<<: *aggressive_timeout_settings | |
username: .. | |
database: ... | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment