Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
What is causing these insane database connection spikes?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Weasel" data-source="post: 467155" data-attributes="member: 9520"><p>Assuming WordPress is using PDO (but it also works similar to mysqli_*), when an instance of the PDO object is created in the script, a connection is made. Until the object is destroyed, or when the script finishes running, the connection is closed. So basically every time a user visits your non-static pages, it creates a connection and closes is once the server is done executing (/your page finishes loading). So most of the connections are short-lived.</p><p></p><p>If you really have that many connections all at once, it could also be someone is DDoSing your site (layer 7), bots are indexing your site or something like that. It would be weird for a cronjob to spawn so many connections, as the script probably just would use one connection for the processing.</p></blockquote><p></p>
[QUOTE="Weasel, post: 467155, member: 9520"] Assuming WordPress is using PDO (but it also works similar to mysqli_*), when an instance of the PDO object is created in the script, a connection is made. Until the object is destroyed, or when the script finishes running, the connection is closed. So basically every time a user visits your non-static pages, it creates a connection and closes is once the server is done executing (/your page finishes loading). So most of the connections are short-lived. If you really have that many connections all at once, it could also be someone is DDoSing your site (layer 7), bots are indexing your site or something like that. It would be weird for a cronjob to spawn so many connections, as the script probably just would use one connection for the processing. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
What is causing these insane database connection spikes?
Top