当前位置:网站首页>Introduction and response to high concurrency
Introduction and response to high concurrency
2022-07-02 22:50:00 【Ximu Qi】
High concurrency
One 、 Introduction of high concurrency
What we call high and pointed out two aspects , The first aspect refers to that there are a large number of requests to access the system at the same time The second aspect refers to that there are a large number of requests to access the system in a period of time , There is an indicator in the general time period , Is the number of requests that can be processed in one second .
Two 、 High concurrency processing
2.1、 Improve the performance of a single server
For example, add memory ,CPU Auditing and so on .
2.2、 Deploy multiple machines to share the pressure
Use the help of load balancing , At the same time, the program needs to support the deployment of load balancing , For example, introduce Redis To unify storage Session;
2.3、 If the capacity of a single machine is limited , Far below the ceiling , You need to find performance bottlenecks :
2.3.1 database
Use read-write separation 、 Sub database and sub table 、 Multimaster 、 Improve the database processing capacity from the architecture ;
2.3.2 Introduce caching mechanism
Store data in memory , That is, the cache mechanism is introduced , Check the cache first , Query the database if it does not exist in the cache , Then store it in the cache .【 Cache consistency issues : You can subscribe binlog journal , perhaps MQ Methods to ensure the final consistency of data 】
2.3.3 introduce Redis colony
Redis Although the single machine performance is very high , But in order to support high concurrency , Generally, it needs to be deployed in a cluster .
3、 ... and 、 The solution to the problem of data processing ability
The maximum processing capacity of a business is tenthousand a second , But what should I do if there are millions of requests in a second ?
3.1 Use MQ
First put the request in MQ, Line up at the exit to consume according to the processing capacity , This method may require users to wait for a while to process the results , such as : Payment scenario 、 Buying scene 、 Seckill scene, etc .
3.2 Current limiting
If the processing capacity of the system is limited , It can only carry 10000 traffic per second , But what about millions of requests , At this time, the current can also be limited , Let the flow enter the system for processing in batches .
3.3 DNS Load balancing
If the request inlet flow is too large , You can use DNS Load balancing , Distribute the same domain name access to different nodes for processing .
3.4 CDN
Put static resources in CDN To speed up access ;
3.5 Search using ES;
3.6 Split into micro Services
Split the system , Change to micro service , Deploy each module as a cluster independently , That is, each module is a cluster .
3.7 other
In terms of code , Use multithreading to improve processing power , Use connection pooling to reduce database connections 、 The overhead of remote calls .
边栏推荐
- 解决 excel 文件上传时更改选中的文件出现错误net::ERR_UPLOAD_FILE_CHANGED
- [micro service sentinel] rewrite Sentinel's interface blockexceptionhandler
- php优化foreach中的sql查询
- [chestnut sugar GIS] ArcMap - how to batch modify the font, color, size, etc. of annotation elements
- 杰理之快速触摸不响应问题【篇】
- [LeetCode] 反转字符串中的单词 III【557】
- I admire that someone explained such an obscure subject as advanced mathematics so easily
- 【微服务|Sentinel】重写sentinel的接口BlockExceptionHandler
- 大话云原生之负载均衡篇-小饭馆客流量变大了
- U++ learning note pile
猜你喜欢

世界环境日 | 周大福用心服务推动减碳环保

Task and privilege level protection

Developers share | HLS and skillfully use Axi_ Customize the master bus interface instructions and improve the data bandwidth - area exchange speed

任务和特权级保护

NC50965 Largest Rectangle in a Histogram
![[LeetCode] 多数元素【169】](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[LeetCode] 多数元素【169】

百度智能云-创建人脸识别应用

Dynamic memory allocation (malloc calloc realloc free)

UE4 game architecture learning notes

SimpleITK使用——4. 奇怪的問題
随机推荐
附加:【登录信息存储】与【登录状态校验】;(包括:总结了到目前为止,有关【登录信息存储】与【登录状态校验】的所有内容;)
Struct, bit segment, enumeration, union
UE4 游戏架构 学习笔记
【ODX Studio编辑PDX】-0.1-如何快速查看各Variant变体间的支持的诊断信息差异(服务,Sub-Function...)
Introduction to database system Chapter 1 short answer questions - how was the final exam?
E-commerce system microservice architecture
Oracle-游标
Baidu AI Cloud - create a face recognition application
PHP wechat red packet grabbing algorithm
Il n'est pas nécessaire d'appuyer longtemps sur la fonction de démarrage pour modifier Jelly [chapitre]
影视随摘
Additional: [login information storage] and [login status verification]; (including: summarizing all the contents of [login information storage] and [login status verification] so far;)
杰理之内置关机电流 1.2uA,之后不能长按开机【篇】
go 4種單例模式
Pointer array parameter passing, pointer parameter passing
Regular expression (2)
go 4种单例模式
Radis:Linux上安装Redis(步骤)
Build your own website (22)
Market Research - current market situation and future development trend of handheld wound imaging equipment