If you connect to the leaf node (mysql -u root --port 3307 -h 127.0.0.1) and run select @@max_connections what do you see? It should be 100000. If I had to guess the ulimits MemSQL is running with are too low so the leaf node automatically lowered max_connections to avoid running out of file descriptors. See: SingleStoreDB Cloud · SingleStore Documentation
In your script above, you are running the mysql command in the background. This means that you are opening a new connection to the Master Aggregator 20 times in parallel. Each connection to the master aggregator will open as many connections to the leaf as you have partitions. Combine this knowledge with @adam’s response - if you have too low of a NOFILE ulimit, this could cause the issue you described.
As a general note - do you actually want to benchmark parallel query performance - or do you just want to run your benchmark 20 times? If you want to do the latter I suggest removing the trailing & so that each instance of the mysql command runs serially rather than in parallel.
As I assume 200 client execute query at the same time, I’d like to benchmark parallel query performance. In my environment, up to 60 connections were available in parallel.