PHP's approach to resolving and handling high-volume, large-traffic access to websites

Source: Internet
Author: User
Tags dedicated server

Method/Step
  1. First, verify that the server hardware is sufficient to support the current traffic normal P4 servers generally support up to 100,000 independent IPs per day, and if the traffic is larger than this, then you must first configure a higher-performance dedicated server to solve the problem, Otherwise, optimization is not a complete solution to the performance problem.

  2. second, the optimization of the database access foreground to achieve complete static is of course best, can not access the database at all, but for frequently updated sites, static often does not meet certain functions.

    Caching technology is another solution, that is, the dynamic data stored in the cache file, dynamic Web pages directly call these files, and no longer access to the database, WordPress and Z-blog are heavily using this caching technology if you do not avoid access to the database, Then 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, as far as possible to achieve "what is found", to follow the small table-based, the schedule supplemented, query conditions first index, first small after the big principle, Improve query efficiency. Volume SQL query.

  3. prohibit external hotlinking external website picture or file hotlinking often bring a lot of load pressure, so should strictly limit the external to their own picture or file hotlinking, fortunately, can now simply through the refer to control hotlinking, Apache itself can be configured to prohibit hotlinking, IIS also has some third-party ISAPI that can implement the same functionality. Of course, forged refer can also be implemented by code to achieve hotlinking, but the current deliberate forgery refer hotlinking is not much, you can first not consider, or use non-technical means to solve, such as the image of the watermark added.

  4. control the download of large files. large file downloads can consume a lot of traffic, and for non-SCSI hard drives, a large number of file downloads can consume CPU, resulting in reduced responsiveness. Therefore, try not to provide more than 2M of large file download, if required to provide, it is recommended to put large files on another server.

  5. 5

    use different hosts to divert the primary traffic to place files on different hosts and provide different images for users to download. For example, if you feel that the RSS files occupy a large amount of traffic, then use services such as FeedBurner or Feedsky to put the RSS output on other hosts, so that others access to the traffic pressure is mostly concentrated on FeedBurner host, RSS does not occupy too much resources.

  6. 6

    using the Traffic analysis statistics software to install a traffic analysis statistics software on the website, you can instantly know which places consume a large amount of traffic, which pages need to be optimized, therefore, to solve traffic problems also need accurate statistical analysis can be. The Traffic Analysis Statistics software I recommend is Google Analytics. If there are other traffic analysis software, welcome to share communication.

PHP's approach to resolving and handling high-volume, large-traffic access to websites

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.