I understand we probably have multiple queries per page view. But there is no reason they can't be done sequentially using the same connection. That would limit it to one connection per user.
And as I said we could actually have queries use a static pool of connections - using less than one connection per user. BEfore getting that drastic it ought to be comparatively easy to limit us to one connection per user.
It's possible that there is a bug in the code where MySQL connections aren't properly closed in all circumstances, causing them to accumulate.
This would be consistent with the pattern we've been seeing, where the server gets slower and slower, and finally crashes, but when it comes back up again it is fast again.
No, it's not users.
I understand that Kristen. But I wouldn't expect more than one connection per user at any point in time. Unless I misunderstand what a connection is....
t edit
Or what Tom said. I hope he's right cause.... easy fix.
That's what I thought. But once the page is downloaded, the connection should be closed.
That'd be my guess too.
I thought that "200 concurrent mysql connections at the same time" would mean that 200 requests for pages are being made at the same time. Which I find hard to believe.
That would also be my guess, and it does sound a bit excessive. Especially since I thought we were a little quieter than usual today.
And I suspect we are closing connections once the page is loaded. But if we use a bunch of connections to load a page, and a bunch of people post or read at the same time, I can see how we could get up there.
We really ought to (and can easily ) limit it to one connection per page load.
I was wondering the same thing as Tom, but he actually knows the stuff and explained it better.
Isn't there a know bug in certain version of PHP and MySQl where resources are not released? I wonder if there is something similar for MySql connections. Let me go the the PHP boards and check it out quickly.
I suspect Tom is right. I can't find any well know bug where connections don't close. So we need to look at the actual code.
The simplest thing to do (and oh! look! it's a weekend!) is to run through the code and put explicit closes after every recordset is done with.
That's phase 1 of the process.
The second phase, is to actually run through the code and squeeze down the queries. This has been, she says sheepishly, on my plate for a while. Anyone want it?