Article Title: Linux Server: design of high-performance website architecture-LLMP. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
In website architecture design, you must be familiar with LAMP (Linux Apache Mysql Php.
LAMP is indeed a very good architecture, adhering to the design philosophy of freedom, openness, efficiency, and ease of use.
However, this article does not discuss LAMP. There are a lot of information about LAMP on the Internet.
Here, I would like to introduce you to another open-source website architecture derived from LAMP to improve performance.
1. Choose high-performance OS
First, it is hard to understand that the underlying support of any server is OS, and OS selection mainly includes Unix, Windows server, Linux, and BSD.
Among them, the open-source OS includes Linux, BSD and Some unix. From the current usage, Linux is still one of the preferred OS for websites.
However, due to its free nature, Linux has caused some inconvenience to selection-too many releases.
Mainstream versions include red hat (RHEL), Ubuntu, Hongqi, openSuSE, and debian.
Each release has its own characteristics, such as RHEL's stability, Ubuntu's ease of use, and great support for Hongqi's Chinese characters.
However, performance-oriented, stable, and easy-to-use are not the best choices.
We recommend a release version, which is a ultimate performance, highly customizable and optimized Linux-gentoo.
Gentoo performance optimization starts from the kernel source code compilation. By selecting different source code packages, you can adapt to different application scenarios.
(Different kernel Introduction: http://imkenwu.javaeye.com/blog/168906)
For example, in China, douban.com runs on a customized and optimized gentoo to support up to 25 million PVS per day.
Http://www.dbanotes.net/arch/douban_web_server.html
This type of traffic, even providing pure static content, is terrible.
In addition to the server itself, the most important thing to support such large traffic is the highly streamlined OS.
Therefore, to sum up, high-performance websites are recommended to use optimized and customized gentoo as the carrier.
2. Select High-Performance web server
Apache is the core web server of LAMP architecture. It is an open source, rich in modules, powerful functions, and stable.
100 of the top 49% websites in the United States use apache. Its influence can be seen.
However, there are advantages and disadvantages. The fatal defect of apache is that it is more bloated and powerful, which will definitely bring performance loss.
In the face of this situation, there is a sudden emergence in the market, that is, a more lightweight web server-lighty (lighttpd ).
The official definition for it is fly light.
It features low memory overhead, low cpu usage, good performance, and rich module support.
This gives him a market share of more than 14% in a short time. More and more people are choosing lighty as the front-end web server.
Here, in fact, high-performance web server is not lighty. But what's better is that we can also rely on gentoo's high customization.
To further improve the performance potential of lighty, you can customize lighty.
3. Select high-performance database
Databases guarantee dynamic content presentation and business data storage for any website.
Open-source databases on the market mainly include mysql, postgresql, berkeley db, and sqlite.
Here, for comparison,
Mysql: multithreading, multi-processor, high performance, more than 5.0 support transactions, rich data types and SQL syntax, cross-platform.
Postgresql: Object-oriented, web-integrated, supports transactions, and processes, which is slower than mysql.
Berkeley db: embedded, data operations are completed through interfaces, cross-language.
Sqlite: integrated with php. It supports ACID, large concurrency, and database locks.
From the above comparison, it is not difficult to see that mysql should be a comprehensive choice of performance, stability and functionality.
4. Select high-performance script language
Scripting languages that can be combined with lighty include ruby, php, python, and perl. The access method is mainly through fast-cgi.
[1] [2] Next page