Hi, Marc,

First, sorry for a very late reply and thanks for persisting.

On Aug 02, Marc wrote:
> > 
> > I'm afraid, I don't understand your use case.
> > 
> > There are, basically, three limits now: max_user_connections,
> > max_connections, OS limit.
> > 
> > An ordinary user would connect many times, hit max_user_connections
> > and stop. Or will keep connecting and get disconnects because of
> > max_user_connections.
> 
> and after exhausting max_user_connections it will exhaust
> max_connections (which I have a problem with)

For an ordinary user that exhausted his max_user_connections limit, the
connection process will work like:
1. connect
2. check max_connections
3. authenticate
4. check max_user_connections
5. get rejected

to exhaust max_connections a user must keep connecting faster than he's
rejected. Otherwise he'll be rejected on the step 5 without ever hitting
max_connections limit, right?

This means that to avoid hitting max_connections, we need to decrease
the time between step 1 and step 5.

What authentication are you using? Could it be something complex and
slow? Likely not, but I thought I'd ask.

MariaDB has connect_timeout but it only covers step 1. We can introduce,
say, "authentication_timeout" to cover the whole authentication process
to make sure a user cannot stall it much.

SSL makes connecting much slower too, it matters if you have a lot of
short-lived connections. Do you have SSL enabled?

A connection pool is a common approach to avoid lots of connections,
then your usera will never even connect to MariaDB, it'll be rejected by
the connection pool.

Do you know how many connections per second does your usera attempts?

> > A malicious user would connect and wouldn't authenticate, this will
> > exhaust max_connections and nobody will be able to connect to the
> > server anymore. max_user_connections won't help here.
> 
> This is not my use case

ok, good to know. Let's focus on the legitimate user case for now.

Regards,
Sergei
Chief Architect, MariaDB Server
and [email protected]
_______________________________________________
discuss mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to