For today's large traffic sites, tens of millions of or even hundreds of millions of traffic every day, how to solve the problem of access? Here are some summary methods:
First, verify that the server hardware is sufficient to support the current traffic.
Ordinary P4 servers generally support up to 100,000 independent IP per day, if the traffic is larger than this, then you must first configure a more high-performance dedicated server to solve the problem, otherwise how optimization can not completely solve performance problems.
Second, optimize database access.
The server load is too large, an important reason is that the CPU load is too large, reduce the server CPU load, can effectively break the bottleneck. The use of static pages can minimize the load on the CPU. The foreground realizes completely static of course best, can not access the database completely, but for frequently updated website, static often cannot satisfy certain function.
Caching technology is another solution, which is to store dynamic data in cached files, which are called directly by Dynamic Web pages without having to access the database, and both WordPress and Z-blog Use this caching technique heavily. I have also written 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 the query SQL for the database. Avoid statements such as Select *from, where each query returns only the results you want, avoiding a large number of SQL queries over a short period of time.
Third, the prohibition of external hotlinking.
External Web site pictures or file hotlinking often bring a lot of load pressure, so should strictly limit the external to their own picture or file hotlinking, fortunately at present can simply through the refer to control hotlinking, Apache itself can be configured to prohibit hotlinking, IIS also has Third-party ISAPI implementations that can do the same. Of course, the forgery of refer can also be implemented through the code to hotlinking, but the current deliberate falsification of refer hotlinking is not much, you can not consider, or use of technical means to solve, such as in the image to add watermark.
Four, control the download of large files.
Large file downloads can take up a lot of traffic, and for non-SCSI hard drives, a large number of file downloads consume CPU, making the site less responsive. Therefore, try not to provide more than 2M of large file downloads, if you need to provide, it is recommended to put large files on another server. There are a number of free Web2.0 sites that offer photo sharing and file sharing, so try to upload images and files to these sharing sites.
V, the main flow of the use of different mainframe streaming
Put the files on a different host, providing different mirrors for the user to download. For example, if you feel that RSS files occupy a large amount of traffic, then use FeedBurner or Feedsky and other services to the RSS output on other hosts, so that other people access to the flow of pressure is mostly concentrated in the FeedBurner host, RSS does not occupy too much resources.
Use the flow analysis statistics software.
Install a traffic analysis and statistics software on the website, you can know immediately which place consumes a lot of traffic, which pages need to be optimized again, therefore, solve the traffic problem still need to carry on accurate statistic analysis to be able. The Flow analysis Statistics software I recommend is Googleanalytics (Google Analytics). I use the process to feel the effect is very good, later I will give a detailed introduction of googleanalytics some of the use of common sense and skills.
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.