惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
Help Net Security
Help Net Security
P
Proofpoint News Feed
J
Java Code Geeks
爱范儿
爱范儿
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
Google DeepMind News
Google DeepMind News
H
Help Net Security
G
Google Developers Blog
Jina AI
Jina AI
Vercel News
Vercel News
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
Lohrmann on Cybersecurity
S
Schneier on Security
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
Security Archives - TechRepublic
Security Archives - TechRepublic
阮一峰的网络日志
阮一峰的网络日志
N
News and Events Feed by Topic
GbyAI
GbyAI
B
Blog
O
OpenAI News
博客园_首页
Cisco Talos Blog
Cisco Talos Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hacker News: Ask HN
Hacker News: Ask HN
TaoSecurity Blog
TaoSecurity Blog
腾讯CDC
MongoDB | Blog
MongoDB | Blog
M
MIT News - Artificial intelligence
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
Webroot Blog
Webroot Blog
Simon Willison's Weblog
Simon Willison's Weblog
Y
Y Combinator Blog
C
Cisco Blogs
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
AI
AI
W
WeLiveSecurity
aimingoo的专栏
aimingoo的专栏
The Register - Security
The Register - Security
Project Zero
Project Zero
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale

博客园 - 风的影

微服务 口试常见题 SQL 大数据查询如何进行优化? 事件和委托的区别 虚方法(virtual)和抽象方法(abstract)的和接口(interface)的区别 C#算法 口试C#概念 口试Linq题 口试大数据及大并发问题 笔试题多线程 笔试代码考查 SQL笔试基础 口试基础 笔试基础知识 Asp.net项目从Vs2003转换到Vs2005的常见问题大全及解决方法 烦人的网页iframe去除 经典sql注入教程 C# 相当于ASP里Eval中的计算公式的方法(超简单的方法) 自己写的后台静态权限验证类
高并发的秒杀
风的影 · 2018-08-01 · via 博客园 - 风的影

原则:
1. 尽量将请求拦截在系统上游:
2. 读多写少,多使用缓存

• 浏览器和app:做限速,限制用户在X秒之内只能提交一次请求(比如虽然你在疯狂的摇微信,但其实x秒后才向后端发起一次请求)
• 站点层:按照uid做限速,做页面缓存,这时用uid,一个uid5秒只准透过一个请求。这样就能拦住99%的for循环请求。
• 服务层:按照业务做写请求队列控制流量(每个提供服务的服务器各一个队列)(每次只透有限的写请求去数据层,如下订单,做支付这样的写业务)。3k张火车票,只透3k个下单去db
• 数据层:这时已经没有多少压力了。全部透到数据库,100w个下单,0个成功,请求有效率是0%;透3k个请求到数据,全部成功,请求有效率100%