So are you talking about limited them on the front end (aka a web service) or limiting the connections to the database? To limit connections to a database is usually quite dependent on the particular database. In PostgreSQL you can limit connections for a user with the alter user command:
\h alter user
Command: ALTER USER
Description: change a database role
Syntax:
ALTER USER name [ [ WITH ] option [ ... ] ]
where option can be:
(SNIP)
| CONNECTION LIMIT connlimit
(SNIP)
And just set the connection limit right there.