Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Using vertx to build a super large and highly available system with millions of concurrent requests

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Requirements: millions of concurrent connections, high availability

Technology selection: centos7,jdk8,vertx3.7.0,mysql8

Test time: successful again on May 20, 2019

Successfully implemented the architecture of millions of concurrent connection access.

Due to the limitation of the business confidentiality system, we can only give a general idea (if there is a high concurrency commercial R & D need, scan the QR code at the end of the article and add the author's Wechat):

Vertx makes it easier to do high concurrency based on Java. Vertx Cluster supports clusters of multiple machines. Even without clustering and nginx,zk, vertx can achieve millions of levels of high concurrency access when using a single server with multi-core and high configuration. Suppose you buy a CVM with 16Core64G memory and your business class is MyDemoVerticle, in order to make full use of each CPU, you can deploy it as follows:

DeploymentOptions options = new DeploymentOptions () .setInstances (16); vertx.deployVerticle ("com.mycompany.MyVerticle", options)

In this way, the system assigns an eventLoop to each instance.

Vertx automatically supports high availability mechanism. If you want to restart automatically when the service dies, you can add the-ha command to the deployment command.

Vertx run my-verticle.js-ha

-ha means that your vertx runs automatically in cluster mode. If you need to configure cluster details, you can refer to https://blog.csdn.net/ifrozen/article/details/79895413

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report