it is happening to me that MySQL runs out of available connections on my search engine. okay, it was a small SPAM done by one of the members but anyway. there were around 100 searches performed per minute and each search took approx:
10 SELECT queries - to verify user, keyword, IP, etc.
10 INSERT queries - insert search, results, logs, etc.
that person was doing that - repeating his action - once/twice per second and MySQL took CPU to 99% because MySQL was not able to clean processes that fast. it ran out of connections, etc etc. you know the end, i guess.
admin tried to increase available connections, didnt help (and i am using connect, not pconnect).
at the end i had to turn webserver down and block user who was doing this.
my questions is:
i thought that a 2.8Mhz, 512MB is much more powerful than this! this example tells me that anyone is capable of bringing my service down to its knees and kill it. i dont even bother putting the search engine to 2 or 3 machines and play with load balancers, etc. because... what the heck.... if one person can kill one search engine, we only need 3 (or less) of them to kill three.
is there any solution to this?