Spring Cloud Zuul Performance Tuning

Source: Internet
Author: User
Tags semaphore

Spring Cloud Version:

Dalston.sr5

These two days through JMeter measured the performance of spring Cloud Zuul, with two virtual machine 8 core 8G and 4 cores 8G, host is 10 core Logic 20 core, Proxy service simple return string HELLO,VM heap memory 1G enough

First mention the test situation, it is worth mentioning that the test is not rigorous, because the use of virtual machine, and the virtual machine also ran some other things, so can not be the final guidance, for reference only.

8 The case of the core:

The performance of Zuul is about 75% of Nginx (8 worker),

Nginx 8 workers have a total cup occupancy rate of 360% (a bit odd)

Zuul occupies 750%

In case of 4 cores:

The Zuul is about 40% of Nginx (4 worker) performance,

Nginx has a total cup occupancy rate of 320%

Zuul occupies 380%

A strange phenomenon:

Nginx in the 4-core throughput 2w,8 nuclear throughput 1w6, do not increase the anti-drop, specifically do not know why.

Test Zuul, the previous several performance is relatively low, to the back is more stable and efficient, may be related to the JIT, it may be that the thread is created slower, the thread default life is one minute.

————————————————————————————————— Split Line ———————————————————————————————————————

Zuul default is to use semaphore isolation, and the size of the semaphore is 100, the requested concurrent thread more than 100 will be an error

You can increase the maximum value of the semaphore to improve performance by configuring the following:

Zuul:  semaphore:    5000

You can also use thread isolation instead, resizing the thread pool threads, which defaults to 10 threads, configured as follows: Hystrix

Zuul:  ribbonisolationstrategy:threadhystrix:  threadpool:              Default:       allowmaximumsizetodivergefromcoresize:true      maxqueuesize:-1
MaximumSize: Maximum number of threads

Allowmaximumsizetodivergefromcoresize: If MaximumSize is allowed to take effect, false then only coresize will take effect.
Maxqueuesize: Queue size for thread pool, 1 for using Synchronousqueue queue


The default configuration can be found in the two Java files of Hystrixthreadpoolproperties and zuulproperties.




A more reliable article:
https://www.sohu.com/a/221110905_467759


Spring Cloud Zuul as a gateway, which is a decent performance, after all, it provides more convenience than Nginx. No, just deploying a few more Zuul,zuul will not be a bottleneck.

Spring Cloud Zuul Performance Tuning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.