Persistent connection in mysql connection mode _ MySQL

Source: Internet
Author: User
Mysql persistent connection is a single-process, multi-threaded architecture.

Configuration parameters (for a single client)

Interactive_time execution (activity in activity State) times out

Wait_time wait for sleep

Max_connection

I was a php programmer and later switched to java. Why does mysql timeout occur when I connect to mysql for the second time in javaEE? After reading many articles, either add Reconnection = true or modify wait_time in my. cnf.

Scenario 1: a web program with a large number of php concurrencies. in this case, the php script timeout time and mysql execution time must be limited. Short link.

Scenario 2: If Client A needs to process data in batches, it is more appropriate to search for the client, so the persistent connection is more appropriate.

Recommended http://blog.sina.com.cn/s/blog_6f3ff2c90100otay.html
Http://www.php.net/manual/zh/pdo.connections.php

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.