Whats the best way to optimize a server to handle many simultaneous connections to mysql? I have a good server with 2gb ram and a high end processor, I really need it to be able to handle at least 100 simultaneous connections, but it seems to crash if it hits that number.
That server should have plenty of grunt. The reason you get that errir is because MySQL (I am assuming you as using MySQL) has a setting called MAX_CONNECTIONS and I am pretty sure the default setting is 100. Up this value to 500 or whatever you need. Of course with more connections other settings mught have to be adjusted. Google MAX_CONNECTIONS and you will find info on it.
I got the same issue when my program had loaded a database with queries which required a large time for process. For me this error is indicates that it is a time to revise a logic of work with a database. To find out which requests got most of time you can use: Actually you can adjust a number of simultaneous connections by edit conf file my.cnf. Just add the line like -