PHP Error: Too many connections

1

I'm getting some messages from my application, from many connections running.

PHP Warning:  mysqli_connect(): (08004/1040): Too many connections in /home/rmour123/public_html/admin/conexao.php on line 31

Below is the form I've implemented:

    public static function getInstance() {
       if (!isset(self::$db)) {
         try{
             self::$db = mysqli_connect(HOST, USER, PASSWORD, DBNAME);
         } catch (Exception $e) {
             print "Erro: " . $e->getMessage(); 
         }
       }
       return self::$db;  
    } 

The question is, do I have a slow routine and that is blocking the other connections and thus reaching the limit set in MYSQL (in this case 150 connections)? Or is there anything else I did not notice?

    
asked by anonymous 07.03.2018 / 14:36

0 answers