Limit MySQL Connections by user

Has anyone here set up MySQL Connection limiting on a ‘per-user’ basis?

We have a user which today has, had 200 connections to the MySQL Server, which caused load to increase to a very heavy level, and causing all hosted sites to receive the Too Many connections error message.

I realise that there is something in the programming which isn’t closing connections or something is going awry when their site is getting heavy visitors, but we’d like to be able to limit their connections for their user, or more preferably, their user group.



Simply set max_user_connections in /etc/my.cnf.

Are they using persistent connections? Maybe if you disable that somehow that could help?