Php connection to multiple databases, timeout issues

Source: Internet
Author: User
Php connects to multiple databases and times out RT. now I have multiple databases, some of which are still on different physical machines, and each database has the same table, now we need to query the centralized display of the same table in each Database. how can we solve this problem?
Now I am using a method where every DB is connected and the page is output after query. the speed is very slow in the case of thousands of DBS, and no 504 timeout occurs, tutorial-0-online !!


Reply to discussion (solution)

Remote Database connection is always slow. you can try to use a database service that supports distributed databases instead.
For example, oracle and SQL server

Mysql is used in the project. because the product is already external, it cannot be implemented for the time being .. Is there any better solution to this problem?

There are thousands of databases on different physical machines, which will be slow. you can cache the results of the first query, and then the query can be obtained from the cache.

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.