I have studied a dozen calculations of RAM usage. The are all bogus. Most are terribly pessimistic -- they assume that every thread is in the throws of a big sort, etc.
There is no perfect value for max_connections. But here are some guidelines:
* Your clients should disconnect when they are through. Keep @@global.wait_timeout low (say, 60 seconds) to kick out such naughty connectors.
* Beware of persistent connections from clients like Apache, with a high MaxClients; they can unnecessarily glom onto too many connections.
* Watch the high-water metric, Max_used_connections. If it gets close to max_connections, either raise max_connections, or figure out why there have been so many connections at once.
From experience with many systems, I say that 1000 in likely to be much too high.
For the newbie... Simply set it to 100. When (if) you are denied connections, dig deeper.
While we are in the area, rarely does thread_cache_size need to be more than 10.
For some other important settings, see:
http://mysql.rjweb.org/doc.php/memory