当前位置:网站首页>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
边栏推荐
- [leetcode refers to offer 52. The first common node of two linked lists (simple)]
- Pytorch preserves different forms of pre training models
- Is rust more suitable for less experienced programmers?
- 手撕《Google SRE Book》
- Getting started with detectron2
- MySQL 回表
- [SDU chart team - core] enumeration of SVG attribute class design
- Pipes and xargs
- Swift import third-party library reports an error no such module““
猜你喜欢
![[leetcode refers to the maximum profit of offer 63. Stock (medium)]](/img/37/478b53696f9327b7d435cdd887dd57.png)
[leetcode refers to the maximum profit of offer 63. Stock (medium)]

MySQL 回表

Pycharm Chinese plug-in


Pipes and xargs

Deep understanding of modern mobile GPU (continuously updating)

Oracle updates the data of different table structures and fields to another table, and then inserts it into the new table

Online Excel to CSV tool

轻量化项目管理思路
![[leetcode refers to offer 52. The first common node of two linked lists (simple)]](/img/bc/cd9c6ec29ecfef74940200e196aed3.png)
[leetcode refers to offer 52. The first common node of two linked lists (simple)]
随机推荐
ERP function_ Financial management_ Basic concepts of Finance
Minecraft 1.12.2 module development (43) custom shield
flomo软件推荐
Database Experiment 8 trigger experiment
如何发挥测试策略的指导性作用
presto on spark 支持3.1.3记录
ROS learning notes - tutorial on the use of ROS
[※ leetcode refers to offer 48. The longest substring without repeated characters (medium)]
opencv应用——以图拼图
Tsinghua University | webface260m: benchmark for million level deep face recognition (tpami2022)
IIS cannot load * woff,*. woff2,*. Solution of SVG file
Ubutnu20 installer centernet
Flomo software recommendation
Automatic heap dump using MBean
轻量化项目管理思路
MySQL 回表
Pytorch preserves different forms of pre training models
Based on jsplumb JS to achieve multi list one to many connection effect
This paper solves the cross domain problem of browser
Oracle updates the data of different table structures and fields to another table, and then inserts it into the new table