Home > Backend Development > PHP Tutorial > [Summary] [Architecture and Optimization] Brainstorm and learn from each other from Facebook_PHP Tutorial

[Summary] [Architecture and Optimization] Brainstorm and learn from each other from Facebook_PHP Tutorial

WBOY
Release: 2016-07-13 10:38:08
Original
1144 people have browsed it

I have little knowledge and I raise this question just to spark some ideas. I hope that everyone can make their own discussion on a certain technology or architecture solution or optimization method that may be used in Facebook in the field that they are good at. According to Tencent’s interview with Facebook’s Vice President of Technical Operations Jonathan Heiliger on September 1, 2008, we learned:
(1) Facebook claims to be the fourth most trafficked website in the world, with 90 million active users accessing Facebook’s 10,000 servers every day.
(2) 25TB data (28TB in December 2008), supported by 400,000 external developers, developed 25,000 sets of application software were purchased.
(3)Use LAMP (Linux, Apache, MySQL, PHP) technical architecture; database uses MySQL; uses Memcached cache SQL acceleration (the world's largest distributed Memcached cache, more than 800 For each server, the data cached in Memcached alone reaches more than 20 TB); use APC for opcode compilation and caching. The compilation execution of PHP is shown in the figure below:
[Summary] [Architecture and Optimization] Brainstorm and learn from each other from Facebook_PHP Tutorial

And Facebook’s cache The solution is as shown below:
facebook[Summary] [Architecture and Optimization] Brainstorm and learn from each other from Facebook_PHP Tutorial


(4)Some background applications are used Python, Perl and Java, and some gcc and Boost.

(5) Using SVN and Git for code management, and all internal software deployments within the enterprise use open source programs.


2. Possible MySQL architecture and optimization
(1) Vertical (unrelated data placed on different database servers) and horizontal segmentation of data (database hashing, such as user_id hashing), and then use MySQL Proxy/Spock Proxy to reverse the split table acting.
(2) Use variables reasonably and establish hash mapping relationships in local files for further segmentation.
(3) Master/Slave cluster architecture to achieve separation of reading and writing.
(4) Reasonable database structure design and index optimization

(5) Others: index cache, joint index, query cache, etc.


3. Possible system optimizations
(1) Use epoll model
(2) Asynchronous I/O
(3) fastcgi or other methods to implement multi-process
(4) sendfile system call increases network I/O traffic
4. Web architecture or front-end technology that may be used
(1) Separation of Web components, such as independent image servers, separation of JavaScript, CSS files, and dynamic scripts.
(2) Nginx reverse To the proxy (or Squid)
(3) Multi-copy load balancing
(4) HTTP persistent connection and reasonable use of browser cache, such as background image offset technology, and
5. Some stress tests that may or may not be used
(1) Apache ab performs stress test
(2) Apache’s prefork mode for stress testing of multi-process switching
(3) Use Nginx to support multi-process CPU Monitoring with IO

Memcached development under Linux, please refer to Ni Xuehan’s article http://bbs.phpchina.com/viewthread.php?tid=48667&highlight=linux%2B%CF%C2%B5%C4%2Bmemcached%2B%BF%AA%B7%A2
For Memcached’s distributed caching mechanism and related solutions, please read the following URL and related articles:
http://tech.idv2.com/2008/07/24/memcached-004/

http://www.bkjia.com/PHPjc/735126.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/735126.htmlTechArticleI am a person with limited knowledge, and I raise this question just to spark some ideas. I hope everyone can learn more about Facebook in their areas of expertise. A certain technology or architectural solution or optimization method that may be used in...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template