MySQL millions high concurrent web site combat strategy

Source: Internet
Author: User

In the beginning of contact with the MySQL PHP to listen to a lot of people say: "MySQL ran a day hundreds of thousands of IP station can also, if millions of IP will not", the exact words do not remember, generally this meaning. There has been no good chance to verify this statement, one is never taken over such a large flow of the site, the second is the usual work is also busy, too lazy to take care of these, anyway, now do not need to hold the idea of this problem has been kept until recently, to understand this problem.

Just a few days ago the company's website (because this is the company's business content I do not say is that site) hereinafter referred to as a station, this a station in the year after the flow soared from seven hundred thousand or eight hundred thousand a day to a good millions of of IP, a day down nearly 10 million of PV let the entire server under high pressure overload of work, The occasional service is down.

The first reflection of the situation is the data statistics, one day down a data is not statistically, the original is MySQL stopped working.

This article is about the problem of our company several technical personnel solutions.

1. mysql server cluster

Because it is small companies in the capital and cost constraints, but also technically few technicians have contacted, so this method naturally let everyone veto.

Here is my personal understanding! Do not only add the cost of the cluster, but also the technical challenges, the current situation of our company is not realistic. Cluster is nothing but the pressure of a server to transfer to two or more servers, I understand so, perhaps I understand wrong, but also please advise.

2. Divide and conquer

This method and the cluster is similar, but to the statistics of the code on different servers running, because the company has a lot of low configuration server run tens of thousands of to hundreds of thousands of IP or no problem, we can divide millions of flow into 10 or so hundreds of thousands of of the quantity and statistics.

Advantages: Make full use of the current resources, solve the current problems.

Disadvantage: Such a method is not a long-term solution, sooner or later there will be problems. And it's a bit of a hassle when it comes to statistical data.

3. Modification of the statistic code

Because before the introduction of the data before the judge, the existence of this IP, routing and other processing, virtually increased the pressure on the server, so everyone to change the statistics code to a database inserted, regardless of 3,721 after processing.

This method basically keep the data of the day, but in processing due to the large amount of data, to and fro time is the server ran dead, and in the insertion of the time because of the design data structure when the index, also greatly consumes a lot of server resources.

Then the index is removed to the final processing time is old slow, not worth the candle.

Related Article

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.