Research on csdn.net System Architecture

Source: Internet
Author: User
Author: Ayouhttp: sudone. comcsdn, as the largest program development community in China, has influenced a full generation. It is the website of the domestic Magazine "programmer". I used to like "programmer" very much, and the articles in it are very good, at that time, I only paid 5 yuan each month to buy a magazine like this for 10 yuan. I was reluctant to leave it when I saw a magazine in year 35.

Author: Ayou http ://SuDone.com

As the largest program development community in China, csdn affects a full generation. It is the website of the domestic Magazine "programmer". I used to like "programmer" very much, and the articles in it are very good, at that time, I only paid 5 yuan each month to buy a magazine like this for 10 yuan. I was reluctant to leave it when I saw a magazine in year 35.

But today I have observed the csdn site's ArchitectureThe discovery is relatively simple. It seems that developers prefer to start from the program and focus on optimizing the code and database, so there is not much time to think about the overall system architecture.

I focused on several second-level domain names: www, news, Bbs/Community and blog. All static files such as www and news run through squ. IdCache, The app_squid architecture is used, and dns polling is used for traffic delivery.

By the way, we will discuss why many large websites prefer to use dns round robin as the homepage instead of using lvs or other Server Load balancerPolicy. This is because Server Load balancer first places all access requests on one ip address. Because there is only one ip address, the stability of this ip address is of great importance. Ip stability is affected by many factors: n vswitches, lines, machines, and so on. The homepage is likely to use Server Load balancer in different regions, so it is difficult to design the solution without using dns. Currently, common browsers and downloading software all have dns fault handling mechanisms, so dns can also shield some faults. Although its functions are not strong, it is also more practical. In contrast, even lvs has many miscellaneous issues, but it is not as good as dns performance and stability.

Csdn Static Page front-end cache ):
A DdRess: 211.100.26.121
Address: 211.100.26.122
Address: 211.100.26.123
Address: 211.100.26.124

The squid version 2.6.STABLE14 of these four machines can cause many problems:

1) The number of opened files indicates that the compilation parameters are different, or are the system configuration parameters different? The machine is released in two batches.
2) If epoll is not enabled for compilation, the performance may not be good. recompile it.
3) the cache is not fine-tuned, so the hit rate of these machines is very low and a lot of penetration occurs. I guess it is caused by not clearing the cache folder when I restart squid.
4) None of the content ExPires header, which is not a problem. stability is good. It is also troublesome for IIs to define expires in detail.
5) None of these static pages support g Zip CompressionA lot of bandwidth is wasted. This problem should be caused by the coordination problem between IIs and squid. You can add the nginx middle-layer proxy to handle it.

It can be seen that the system administrator of csdn is not very concerned about the system. From another point of view, the system can be stable, and the system is not optimized. I think this mentality is also very good.

If you are interested, refer:

Http://sudone.com/linux/squid_mgr.html

In this article, use:

Squidclient-p80 -hwww.csdn.net mgr: info.

Most of the blog and community pages are dynamic pages. csdn does not perform static processing, so no cache is available. Instead, it directly goes to the backend. Recently it has added nginx and uses nginx for load balancing.

I can't find out how many IIs are behind nginx. I think about the unstable status of csdn in the past, and it is much better to add nginx because nginx is used, therefore, the two systems support compression, which makes it easy to understand.

Bbs has never used caching, but it is a pity that systems like blogs do not use caching. In fact, both systems can use squid for full caching, since then, csdn can be very stable, but as mentioned above, developers usually prefer to optimize their own code, which is a limitation of thinking, it took me many years to jump out of the box and understand the simple principle of system optimization. Csdn uses nginx for load balancing, but it also understands that they hope to be more open and more progressive. I hope my favorite websites are stable and fast, so that I will be more comfortable when I am hanging out on the Internet. I hate csdn, Tianya, and Netease to comment on these things, but they are making progress, which is a good thing.

Because the front-end architecture of csdn is too simple, I am too lazy to draw a picture. In fact, it is estimated that csdn is not a simple thing. Many logics are hidden at the end of the code and database, which is unknown. Because the csdn code layer uses windows hosts and asp.net, since windows is used, there are certainly few tricky issues, so we still need to find a better front-end, it takes a long time to restore these app servers.

 

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.