how to increase maximum number of connections to database? [closed]

my server has CENTOS as Operating System,and uses apache as the web server.database software is MariaDB. server has 64 Gb of RAM, but once the number of daily visitors exceeds 12k,i get “error establishing a database connection.
can anyone tell me how i should increase “Maximum No. of Connections”?
It is currently 151.

Answer

Not a direct answer but something to think of. Your programming is RIDICULOUSLY bad. You indicate that you have more than 1% of your visitors active on a database at once. Note that I do not mean “concurrent visitors” or concurrent page operations – i mean concurrent db operations. That is a VERY high number.

12000 visitors PER DAY should at no point require 151 database connections. Not even 20. You seem to keep them open forever, possibly leaking them and not closing them at all.

Obviously wrong if every visitor does extreme long operations that require minute long sql statements. Which I somehow bet is not the case.

Attribution
Source : Link , Question Author : julia ann , Answer Author : TomTom

Leave a Comment