How to solve the problem of network sharing software PHP How to solve the large traffic and high concurrency of the website

Source: Internet
Author: User
Tags dedicated server
First, verify that the server hardware is sufficient to support the current traffic.
Ordinary P4 servers generally support up to 100,000 independent IPs per day, if the traffic is larger than this,
Then you must first configure a higher-performance dedicated server to solve the problem
, otherwise optimization will not solve the performance problem completely.
Second, optimize database access.
Full static at the front desk, of course, it's best to not have access to the database at all, but for frequently updated sites,
Static often does not satisfy certain functions.
Caching technology is another solution, which is to store dynamic Data in a cache file, and the Dynamic Web page calls directly
These files without having to access the database again, WordPress and Z-blog are heavily using this caching technology. I
I also wrote a z-blog counter plug-in, also based on this principle.
If you do not avoid access to the database, you can try to optimize query SQL for the database. Avoid using
Select * from such a statement, each query only return the results of their own, to avoid a short period of large
Volume SQL queries.
Third, prohibit the external hotlinking.
External Web site pictures or file hotlinking often bring a lot of load pressure, so you should strictly restrict the external
In their own picture or file hotlinking, fortunately, can now simply through refer to control the hotlinking, Apache since
Can be configured to prohibit hotlinking, IIS also has some third-party ISAPI to achieve the same functionality. When
However, the forgery of refer can also be implemented through code to achieve hotlinking, but currently deliberately forge refer hotlinking is not much,
You can not think about it, or use non-technical means to solve, such as the image to add a watermark.
Four, control the download of large files.
Large file downloads can consume a lot of traffic, and for non-SCSI drives, a large number of file downloads can consume
CPU, which makes the website response ability drop. Therefore, try not to provide more than 2M of large file downloads, if required
, it is recommended that large files be placed on another server.
V. Use different hosts to divert the main flow
Put the files on different hosts and provide different images for users to download. For example, if you think the RSS file occupies
Traffic, use services such as FeedBurner or Feedsky to put the RSS output on other hosts, which
Most of the traffic pressure on other people's access is focused on FeedBurner hosts, and RSS doesn't take up too much resources.
VI, use traffic analysis statistics software.
Install a traffic analysis statistics software on your website to instantly know which places are consuming a lot of traffic and which pages
The surface needs to be optimized, so it is necessary to perform accurate statistical analysis to solve the traffic problems. I recommend making
The Traffic analysis statistics software used is Google Analytics. I use the process to feel its
The effect is pretty good, and I'll cover some of Google Analytics's usage tips and tricks later.

The above describes how to solve the local area network sharing software PHP to solve the problem of large traffic and high concurrency, including the solution of LAN sharing software content, I hope that the PHP tutorial interested friends helpful.

  • 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.