Using vertx to build a super large and highly available system with millions of concurrent requests
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