11 days ago
Hello,
My question might sound stupid, but I'd rather ask just to be sure!
I currently have 24 GB of RAM and 24 vCPUs allocated to my MySQL database (using the Railway managed database plugin). A few days ago, I ran into major errors due to the maximum number of simultaneous connections to MySQL (I was hitting a hard limit of 100 max).
I did some research and saw that I could change this by setting the MYSQL_MAX_CONNECTIONS environment variable. Since I'm not a database expert, I'd really appreciate some advice.
I've optimized my code and I'm no longer getting the "Too many connections" error for now because traffic is low. However, my site is officially launching soon and I expect much higher traffic (and thus potentially a spike in MySQL connections).
Do you think I can use the MYSQL_MAX_CONNECTIONS variable to safely increase the allowed connections to 500? Most importantly, I noticed that when I add this variable to my managed MySQL service, I get the following warning in the UI: "Warning: Database configuration change - This will manually change an environment variable without updating the actual database configuration."
Does this mean the variable is completely ignored? If so, is there another "Best Practice" on Railway to increase this connection limit (without having to switch away from the managed database)?
Thanks in advance for your help!
0 Replies