MaxConnectionsExceeded: Exceeded maximum connections.
Sry，I miss applying the wrapper in some functions. Running each request in a new thread is kinda silly...but ok? Presumably your wsgi server would handle all that. So you're probably running threads-in-threads?

Anyway...ok?
I wrote a wrapper to handle each request I received. Each request is in a separate thread.
Code Samples:
```
t = Thread(target=handle_request)
t.start()
```
The db config and wrapper:
```
    peewee_database = PooledMySQLDatabase(mysql_config['db'], host=mysql_config['host'], user=mysql_config['user'],
                                          password=mysql_config['password'], charset='utf8mb4', max_connections=20,
                                          stale_timeout=300)
    def wrap(*args, **kwargs):
        db = peewee_database
        try:
            db.connect()
            return func(*args, **kwargs)
        finally:
            db.manual_close()
```


Exception:
```
  File "/usr/lib/python2.7/site-packages/peewee.py", line 2681, in execute_sql
    cursor = self.cursor(commit)
  File "/usr/lib/python2.7/site-packages/peewee.py", line 2667, in cursor
    self.connect()
  File "/usr/lib/python2.7/site-packages/playhouse/pool.py", line 108, in connect
    return super(PooledDatabase, self).connect(reuse_if_open)
  File "/usr/lib/python2.7/site-packages/peewee.py", line 2630, in connect
    self._state.set_connection(self._connect())
  File "/usr/lib/python2.7/site-packages/playhouse/pool.py", line 154, in _connect
    raise MaxConnectionsExceeded('Exceeded maximum connections.')
MaxConnectionsExceeded: Exceeded maximum connections.
```

My peewee version: 3.3.4