- Reaction score
- 198
- Points
- 1,210
In the recent past, the "big" problem is overwhelming the database with connections. Basically the database starts to fall behind when things get busy, and connections stack up, eventually hitting our max (700*) at which point new connections are flat out refused. That's wen you see the "could not connect to database" error, which I am trying to resolve.
Yesterday's conversion will hopefully allow the database to respond faster, preventing a large "lineup" of connections from forming. Watching the performance, I did see it approach 700 yesterday, then immediately drop to ~400 as the requests were processed. I won't be so daring as to say the problem is fixed, but I believe things are improved. We will find out how much as we move forward.
Note that this does not in any way solve the "high server load" issue... in fact it may make it worse. Before, when processes were languishing about waiting to be served by the database, they weren't causing load. If we improve the database response time, the server has to do more work, faster to keep up. See the attached technical diagram for a more detailed explanation.
Cheers
Mike
* 700 does not mean only 700 users can be visiting the site. It's significantly more complicated, but essentially the web server forks processes to handle requests (each process handles many simultaneous and sequential requests), and each process then generally creates one connection.
Yesterday's conversion will hopefully allow the database to respond faster, preventing a large "lineup" of connections from forming. Watching the performance, I did see it approach 700 yesterday, then immediately drop to ~400 as the requests were processed. I won't be so daring as to say the problem is fixed, but I believe things are improved. We will find out how much as we move forward.
Note that this does not in any way solve the "high server load" issue... in fact it may make it worse. Before, when processes were languishing about waiting to be served by the database, they weren't causing load. If we improve the database response time, the server has to do more work, faster to keep up. See the attached technical diagram for a more detailed explanation.
Cheers
Mike
* 700 does not mean only 700 users can be visiting the site. It's significantly more complicated, but essentially the web server forks processes to handle requests (each process handles many simultaneous and sequential requests), and each process then generally creates one connection.