Ever Think
Ever Think

Reputation: 813

What does Max connections in my SQL exactly means?

We are building a POS app which is cloud based

We decided to 4GB VPS for MySQL And 2GB VPS for nodejs

Our client count will be atleast 5000 and atleast 1500 users will update the tables at same time

I checked how much memory does MySQL takes for 1500 concurrent connections

Now my doubt is , even 1500 connections at a time require more than 4GB RAM .

But I have seen lot and lot of DB servers serving lot of request just 4 GB RAM

Please explain me whether max user connections mean number of end users at front end OR something else?

(Not a duplicate question. I searched many Stack overflow questions but still confusing)enter image description here

Upvotes: 0

Views: 2607

Answers (3)

Buczek
Buczek

Reputation: 11

Small sample

  1. Python app needs from 1 to 8MB (stack_size) for one thread (if will be more connection server throw error stackoverflow (memory error))
  2. 1500 x 8MB => 12 GB for python app
  3. Mysql need 1.5 GB per 500 conn +-
  4. 1500 conn => 4.5GB (mysql)

Read:

https://www.percona.com/blog/2019/02/25/mysql-challenge-100k-connections/

https://www.percona.com/blog/2014/02/04/16000-active-connections-percona-server-continues-work-others-die/

Upvotes: 1

symcbean
symcbean

Reputation: 48387

atleast 1500 users will update the tables at same time

No, they won't. Depending on how badly your application is designed, you may have 5000 concurrent connections - updates will not all happen at the same time.

We decided to 4GB VPS

How did you decide?

Even if you were ask the question properly, it is not something which can be sensibly answered here.

Currently you are not in any position to evaluate any answers you get here - you don't understand the application you are writing nor capacity planning. Your question will be downvoted and closed. Read the linked discussion then go do some modelling and testing. Then go read up on MySQL tuning.

Upvotes: 1

Shadow
Shadow

Reputation: 34304

As MySQL documentation on max_connections setting says:

The maximum permitted number of simultaneous client connections.

So, this is the maximum number of concurrent mysql connections that you can have. Nothing to do with the number of front end users, this is purely a mysql level configuration.

Upvotes: 1

Related Questions