当前位置:网站首页>A method of asynchronous response of application service through load balancing
A method of asynchronous response of application service through load balancing
2022-04-23 21:57:00 【Three stone orders】
use C++ Built web The service does not support multithreading and asynchrony , You can open multiple applications with different ports , Then configure nginx Realization .
1、 Implement running the application through command parameters ; Here we use mfc Application as an example , Debugging can be set through properties ;
2、 Batch applications that open multiple different ports ;
echo off
taskkill /f /im XRayDetector.exe
start XRayDetector.exe 9697
start XRayDetector.exe 9698
start XRayDetector.exe 9699
start XRayDetector.exe 9700
3、 To configure nginx; download nginx, Notepad open conf/nginx.conf, Set up api Path and proxy port ;
upstream serverswitch {
server localhost:9697;
server localhost:9698;
server localhost:9699;
server localhost:9700;
}
server {
listen 9696;
server_name localhost;
location /api/xxx{
proxy_pass http://serverswitch;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
4、 Save and run nginx.exe That is to say http://localhost:9696/api/xxx, This request is automatically assigned to the previously opened port number 9697、9698 On top of the application ;
版权声明
本文为[Three stone orders]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204200615437154.html
边栏推荐
- 2. Finishing huazi Mianjing -- 2
- What if Jenkins forgot his password
- Detectron2 using custom datasets
- C winfrom DataGridView click on the column header can not automatically sort the problem
- ROS学习笔记-----ROS的使用教程
- [leetcode sword finger offer 10 - II. Frog jumping steps (simple)]
- YOLOv5 Unable to find a valid cuDNN algorithm to run convolution
- 引入结构化并发,Swift 5.5 发布!
- Leaf Smecta
- Resolve the "chromedriver executable needs to be in path" error
猜你喜欢
Database Experiment 2 data query
Database experiment VI integrity language experiment
Google 尝试在 Chrome 中使用 Rust
[leetcode sword finger offer 58 - I. flip word order (simple)]
Preliminary analysis of Airbase
DW basic course (II)
Google tries to use rust in Chrome
[leetcode refers to offer 18. Delete the node of the linked list (simple)]
Oracle updates the data of different table structures and fields to another table, and then inserts it into the new table
airbase 初步分析
随机推荐
Based on jsplumb JS to achieve multi list one to many connection effect
YOLOv5 Unable to find a valid cuDNN algorithm to run convolution
Idea import a project
[leetcode refers to offer 32 - III. print binary tree III from top to bottom (medium)]
CUDA, NVIDIA driver, cudnn download address and version correspondence
Minecraft 1.12.2 module development (43) custom shield
Question brushing plan - depth first search DFS (I)
上海确保疫情保供生活物资质量和食品安全
C language programming based on loop structure (PTA)
[leetcode refers to offer 10 - I. Fibonacci sequence (simple)]
Strictly, severely and quickly strengthen food safety supervision during the epidemic in Shanghai
阿里云回应用户注册信息泄露事件
Sharpness difference (SD) calculation method of image reconstruction and generation domain index
Ensuring the quality of living materials and food safety in Shanghai
Deep understanding of modern mobile GPU (continuously updating)
Database Experiment 2 data query
C # problem of updating data: dynamic SQL generation is not supported for multiple base tables
Question brushing plan -- backtracking method (I)
[leetcode refers to offer 22. The penultimate node in the linked list (simple)]
Online timing flow chart making tool