构建高并发网站架构
https://www.cnblogs.com/leefreeman/p/3993449.html
特点:并发数高、访问量大、数据量大、用户分布广泛、网络环境复杂、稳定性高、易于扩展、安全性高
基础设施
服务器介绍:塔式服务器、机架式服务器、刀片式服务器、虚拟主机、虚拟机、服务器、云主机
网络设备介绍:交换机、防火墙、路由器
存储设备:san、nas、das
IDC:机房、机柜、网络、电源、空调
基本概念
http协议:超文本传输协议,http1.0是没有办法保持连接,http1.1可以保持连接,http1.1支持host请求头(一个服务器上配置多个域名)
linux查看head
[root@centos-01 kvm_data]# curl -I http://www.baidu.com HTTP/1.1 200 OK Accept-Ranges: bytes Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform Connection: Keep-Alive Content-Length: 277 Content-Type: text/html Date: Thu, 12 Jul 2018 01:35:20 GMT Etag: "575e1f5d-115" Last-Modified: Mon, 13 Jun 2016 02:50:05 GMT Pragma: no-cache Server: bfe/1.0.8.18 [root@centos-01 kvm_data]#
http状态码:200正常请求、301永久跳转、302临时跳转、304从缓存中取、401需要认证、403无权限、404图片或网页找不到、500服务器问题、502nginx服务器+php-fpm中常见,nginx请求php发现php文件找不到会报502、503常出现在代理服务器、504访问超时
url和uri:uri包含url
awstat日志分析
http://blog.51cto.com/freeloda/1346412
Apache服务器下查看服务器吞吐量
网站架构角色web
第一种:client-》web-》db
第二种:client-》cdn-》代理-》web-》缓存-》db
cdn:加速器,解决由于网络带宽小、用户访问量大、网点分布不均而产生的用户访问网站响应速度慢的根本原因,CDN目的是通过在现有的Internet中增加一层新的网络架构,将网站的内容发布到最接近用户的网络“边缘”,使用户可以就近取得所需的内容,解决 Internet 网络拥塞状况,提高用户访问网站的响应速度。
web:iis、Apache、nginx+php-fpm、tomcat+jdk
db:mysql/maridb/、postgresql、oracle、mangodb
nosql:memcached、redis
代理:squid、nginx、varnish
cdn就是一个带缓存的代理,
存储:fastdfs