It is time-consuming to establish a connection between wordpress and mysql.

Source: Internet
Author: User
Tags website server
Establishing a connection between wordpress and mysql takes a long time for wordpress to be set up and can be used. However, every time a page is opened, it takes more than 7 seconds... My wordpress is installed on a virtual host, and the mysql database is on a vps. I used the C # code to connect to mysql and found that the MySqlConnection object is Open, which is very time-consuming to establish a connection with mysql wordpress and mysql.
Once wordpress is set up, it can be used. However, every time a page is opened, it takes more than 7 seconds... My wordpress is installed on a virtual host, and the mysql database is on a vps.

I used the C # code to connect to mysql and found that the MySqlConnection object Open is that it takes about five seconds to establish a connection with the mysql database, so the problem is identified here.

My problem is that every time wordpress queries, it needs to re-open a connection to the database and then turn it off when it is used? Why keep persistent connections?

I wonder if you have encountered the same problem as me. do you usually put the website server and database on the same machine?

------ Solution --------------------
It should be the problem between your two hosts. ping the VPS on the wordpress Host.
Long links are not the root cause of the problem. Your c # access speed is slow, which proves to be a host problem.
------ Solution --------------------
If you are not on the same machine, it will naturally be slower.

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.