当前位置:网站首页>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 .
边栏推荐
- 【ODX Studio编辑PDX】-0.1-如何快速查看各Variant变体间的支持的诊断信息差异(服务,Sub-Function...)
- What is the'function'keyword used in some bash scripts- What is the 'function' keyword used in some bash scripts?
- NC50965 Largest Rectangle in a Histogram
- Gas station [problem analysis - > problem conversion - > greed]
- Pointer - function pointer
- uniapp微信登录返显用户名和头像
- phpcms实现订单直接支付宝支付功能
- Unity publishes a method of webgl playing sound
- 附加:【登录信息存储】与【登录状态校验】;(包括:总结了到目前为止,有关【登录信息存储】与【登录状态校验】的所有内容;)
- 图形视图框架
猜你喜欢
SimpleITK使用——4. 奇怪的問題
[ODX studio edit PDX] -0.1- how to quickly view the differences in supported diagnostic information between variant variants (service, sub function...)
加油站[问题分析->问题转换->贪心]
世界环境日 | 周大福用心服务推动减碳环保
Source code analysis - lightweight asynchronous crawler framework Ruia
【板栗糖GIS】arcmap—如何批量修改注记要素的字体,颜色,大小等
Struct, bit segment, enumeration, union
Objects and object variables
UE4 game architecture learning notes
手写ORM(对象关系映射)增删改查
随机推荐
Methods of adding styles to native JS
Il n'est pas nécessaire d'appuyer longtemps sur la fonction de démarrage pour modifier Jelly [chapitre]
go 多线程数据搜索
Oracle-游标
Radis:Linux上安装Redis(步骤)
Market Research - current market situation and future development trend of high tibial osteotomy plate
分享 10 个 JS 闭包面试题(图解),进来看看你能答对多少
Market Research - current market situation and future development trend of genome editing mutation detection kit
Market Research - current market situation and future development trend of aircraft audio control panel system
Go condition variable
电商系统微服务架构
杰理之样机无触摸,拆机之后重新安装变正常【篇】
《乔布斯传》英文原著重点词汇笔记(九)【 chapter seven】
【洛谷P1541】乌龟棋【DP】
【板栗糖GIS】arcmap—如何批量修改注记要素的字体,颜色,大小等
数学建模——图与网络模型及方法(一)
悬镜安全在RSAC2022上斩获Global InfoSec Awards四项大奖
Jatpack------LiveData
佩服,竟然有人把高等数学这么晦涩难懂的科目,讲解得如此通俗易懂
Market Research - current situation and future development trend of sickle cell therapy Market