microl44 / Julet

Website visualizing data from my watched movies, brought forward by the jul.
3 stars 1 forks source link

Implement a PDO connection pool without external APIs #80

Closed microl44 closed 1 year ago

microl44 commented 1 year ago

As the number of PDO connections grow larger, so will the load time between pages when multiple users accesses the site at the same time. To combat this, a PDO connection pool can be implemented with the general idea of having a global array of pdo connections, where each pdo call fetches the next connection, if available. If no such connection is available, it should then create a new PDO connection.

Once the code is done with the connection, it should return it to the connection pool at the end of the list.

If the issue is deemed too easy, async PDO query functions can be looked into.

microl44 commented 1 year ago

Important to note is that 151 established connections are the maximum for the default XAMPP settings. Further testing will be required to determine if the hosting hardware can even come close to that amount of connections without burning.

microl44 commented 1 year ago

Closed as the latest push (directly to main) implemented it. Didn't find any bugs after an exhaustingly 5 minutes of testing so we're probably fine. It's 4 in the morning, I'm going to bed and w/e happens happens.