[Reprint] Please give some more memory Sprint Boot

Please give some more memory Sprint Boot

https://juejin.im/post/5c89f266f265da2d8763b5f9

 

Outline

SprintBoot Overall, the building is relatively easy, especially SpringCloud family bucket, referred to as micro-services close to the people, but the trends in container technology has matured, the face of huge memory consumption SprintBoot, small companies can not afford representation. Today, many JAVA micro-services framework had just been born mostly hit "lightweight", mainly because SprintBoot too.

JAVA-based micro-services framework No1-Spring Cloud

Introduction

There are big backer in Spring, updates, stability problems, maturity does not need to consider. In the JAVA-based mix of technical staff have heard about Spring's name it, so no shortage of programmers ...... and start of the difficulty of this very low, an architect may be omitted entirely. However, you are bound to pay on the server:

  • At least one "service discovery" of the server;
  • There may be a unified gateway Gateway;
  • You might need for a "distributed configuration management" Configuration Center;
  • Possible "service tracking," I know the request came from, where to go;
  • May need to "cluster control"; after the line found on the project, we need a lot of servers, each server increases, are feeling distressed in the cluster;

Pressure measured 30 seconds

Before the pressure test memory footprint

 

As shown, the memory footprint 304M.

 

When the memory footprint of pressure measurement

 

As shown, memory footprint 1520M (1.5G), CPU increased to 321%

 

Overview

 

 

to sum up

SprintBoot of a simple application, at least 1G memory, JAR after a relatively small micro-business point of service will be compiled about 50M; and the introduction of components SprintCloud will be relatively more, consume more resources will be relatively few.

Start time is about 10 seconds or so: Started Application in 10.153 seconds (JVM running for 10.915)

JAVA-based reactive programming toolkit Vert.x

Introduction

The backrest Eclipse Eclipse vert.x is used to build a formula in response to the application toolkit of the JVM. The location is not in conflict with SprintBoot, even Vert.x can combine SprintBoot use. Many Vert.x module provides a large number of micro assembly services, in many people's eyes is to select a micro-services architecture.

Huawei micro service framework Apache ServiceComb is to Vert.x as the underlying framework to achieve, in the "benchmarking website TechEmpower" in, Vert.x's performance is very brisk.

Pressure measured 30 seconds

Before the pressure test memory footprint

 

As shown, the memory footprint 65M.

 

When the memory footprint of pressure measurement

 

As shown, memory footprint 139M, CPU accounting for 2.1%, the feeling does not seem to be pressure test.

 

Overview

 

 

to sum up

After completion Vert.x single serving packaged approximately about 7M JAR, the container does not depend Tomcat, Jetty like, running directly on the JVM.

Vert.x resource consumption is very low, feeling a 1-core 2G server has been able to deploy many Vert.x service. Coding aspects of the problem is removed, really in line with small projects and small module. git on the market have been implemented based on open source gateway Vert.x -  VX-API-Gateway help files  fast on-line multi-language support, it is suitable for small projects.

Start time is less than 1 second:Started Vert.x in 0.274 seconds (JVM running for 0.274)

Other JAVA-based micro-Services Framework

Spark Java

  • jar is relatively small, about 10M
  • Accounting for small memory, about 30 ~ 60MB;
  • Performance can also, with similar SprintBoot;

Micronaut

  • Grails new favorite team;
  • Micro-services-based applications can use Java, Groovy and Kotlin write;
  • Compared SprintBoot have been more comprehensive;
  • Better performance, and encoding more similar SprintBoot;
  • Startup time and memory consumption more efficient than other aspects of the frame;
  • multi-language;
  • Dependency injection;
  • Built-in features a variety of local cloud;
  • Very new, just released 1.0.0

Jvlin

  • Very easy to get started;
  • Flexible, compatible synchronous and asynchronous programming ideas;
  • JAR small, 4 ~ 5M;
  • multi-language;
  • KOA's shadow;
  • Only about 2,000 lines of source code, source code is simple enough to understand and repair;
  • With the current trend;
  • multi-language;
  • Embedded server Jetty;

Quarkus

  • Fast start;
  • JAR small, about 10M;
  • Little documentation;

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/12599665.html