Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6982411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:17:06+00:00 2026-05-27T18:17:06+00:00

I build an application (MySQL/PHP) which (in time) may use connections to distant (and

  • 0

I build an application (MySQL/PHP) which (in time) may use connections to distant (and maybe slow) MySQL servers. The app uses AJAX whispers which open the DB connections frequently. I have done some client side optimization, but never had courage enough to use persistent connections, which may be good idea here.

I am worried about idle mysql connections which may exceed the server limit resulting in need to restart the server. So I plan to use mysql.connection_timeout to 15s, which will kill every idle persistent connection after the limit? Or will it block system resources until the end of times of server process?

I won’t use transactions in whispers and every lock should be released after the connection is closed, right?

Are there any other persistent connection issues I should be aware of? (I have read the documentation already.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:17:06+00:00Added an answer on May 27, 2026 at 6:17 pm

    You don’t generally gain anything by using persistent connections with MySQL. Its connection protocol is already generally fairly fast. What you do lose is the guarantee of a “clean” operating environment when you use regular non-persistent connections.

    If any of your scripts die for any reason while in the middle of a transaction or leave server-side variables set, a persistent connection means that half-done transaction is still active when the connection is picked up again by some OTHER script.

    You can quite easily fall into a deadlock situation when this happens. The new script has no idea that it’s got an old/dirty connection, and MySQL cannot see that the original connecting script has gone away and do its own cleanup, so you end up with a garbage strewn environment.

    That being said, you can limit how many connections PHP will keep open on your behalf with the mysql.max_persistent setting. No matter how many connections you attemp to make from your scripts, PHP will never exceed that limit, so you can set it to be lower than MySQL’s own max_connections setting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a web application, which historically was built on a PHP/MySQL
I have a Facebook application build with PHP/MySQL, both are installed in the same
The SQL query in my web application(PHP/MySQL + Zend) uses a number of parameters
Im trying to build a feeds application in php in which im using a
We have an PHP/MySQL application where the users can create their own databases, which
For an application build on Spring MVC + Groovy + Google App Engine i
I need to build an application which will run on OS X, polling for
I've developed an open source application in php and mysql. I'd like to give
I need to build an application outside of my normal comfort zone (web/PHP/JavaScript). Should
I'm building a very small web ERP application with PHP / mySQL / CodeIgniter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.