User epiz_23862135 already has more than 'max_user_connections' active connections

Closing DBs has helped, am now trying to learn Singleton…

2 Likes

The connection limit on premium hosting is higher, so you’d be less likely to run into it. But solving the problem of inefficient connection usage by throwing more server power at it is not a sustainable solution.

It will help a bit. But you should know that while opening a database connection is fast, it’s not instant or free. So it’s much better to set up a database connection once and reuse that instead of opening a connection for every query and closing it afterwards.

Also, the Singleton pattern I referred to is very simple to implement and use.

4 Likes

What about persistent mysqli connections, is it a very bad idea? However am now conversant with the Singleton pattern

1 Like

Yes, it is a very bad idea. Not overstating that here. That other topic I linked to from November? That was caused first and foremost by using persistent connections.

That’s because persistent connections (probably) only work well within specific web server environments. And ours does not fit the bill, which likely results in many lingering persistent database connections which you can’t use because they are held by a different process.

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.