How to separate data servers from Web Servers

Source: Internet
Author: User
Let's talk about their advantages:


Data servers are separated from application servers and generally use SQL services. In this case, data security is increased. databases on the same LAN are not connected to the Internet and only serve application servers. The application server is only responsible for access, and the data server is only responsible for application data. Therefore, this benefit is obvious.

The connection between the two servers is displayed through the vswitch in the vro layer. If there are two data servers, one of which is a backup, the dual-nic may be used to use the "Heartbeat line". If there is no backup, these do not need to be considered at all, just use a normal network cable to connect to the switch.

 

Next we will discuss the basic configuration issues?

For small websites or B/S projects, the same physical machine can still be used as a web
Server and DB server. However, both of them occupy a large amount of CPU memory, disk I/O, it is best to let the two use different server hosts to provide services, to distribute the pressure, improve load capacity. In addition, if the two use the same network end, try to use the Intranet
Private IP Access, instead of public IP or these names.

Basically, no matter what software or hardware is used for applications on Web Services, it usually consumes CPU to process requests from multiple users at the same time. But for databases, CPU is not necessarily a large amount of consumption, but the ratio of memory to disk I/O to Web
Server
Yes.Therefore, we recommend that you use a normal PC for Webserver, but use a good CPU. While DB
Server, you don't have to worry about it. You should try to purchase advanced servers, use RAID 5 or 6 disk arrays, and have 4 GB or more memory.

 

If the number of online users continues to increase, you can add multiple web servers and dbservers) cluster, high-availability cluster high-availability (HA), and database cluster for larger distributed deployment.

 

Next, let's make a small comment on the above statement. Verification

 

Is a separate examination system server.
Web Serve and a DB server.

Extraction is performed at the same time. At this time, the CPU usage of the Web server is not high.Memory is1g usage only uses more than 900 m (1 GB virtualized by hard disk, 2 GB in total), You can see


 

 

 

The following figure shows the DB usage.

At this moment,CPUThe memory usage is almost normal, maintained at 10%, but twice that of the web service. Therefore, the DB service is consumed on the memory usage.


 

 

 

For more information, see

This service is a Web-integrated DB server.

This is also an ongoing test.

It is found that the CPU usage remains high with only one core, and almost none of the others is involved,This results in a waste of resources. How can this problem be avoided?

This introduces multi-threaded programming.

 

 

Introduction to multi-threaded programs.

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.