These are chat archives for spring-cloud/spring-cloud

20th
Mar 2017
softmanu
@softmanu
Mar 20 2017 07:20

Hi,
which one is correct out of the following:-

zuul.host.max-total-connections
or
zuul.host.maxTotalConnections

are there any naming conventions being followed for the above properties.?

dragontree101
@dragontree101
Mar 20 2017 07:28
hi
i use zuul as gateway, and i found if my backend service block 4000 ms , and i use ApacheBench to test my service
if i directly send to nginx ab -n 90 -c 45 -H 'host: rpcclient.test.rhllor.net' 10.10.11.140/block_get?time=4000 use 8s time, i think is correct, and i send to zuul ab -n 90 -c 45 apitest.zuul.com/rpcclient/block_get?time=4000 it also use 8s time, if i change param n from 90 to 92 and change param c from 45 to 46, like ab -n 92 -c 46 -H 'host: rpcclient.test.rhllor.net' 10.10.11.140/block_get?time=4000 send to nginx also 8s time, but i send to zuul ab -n 92 -c 46 apitest.zuul.com/rpcclient/block_get?time=4000 will spend 12s time, i thinks zuul only support 45 thread asynchronous execute?
dragontree101
@dragontree101
Mar 20 2017 08:02
i found hystrix.threadpool.default.coreSize and default is 10, can i set this properties large ?
Dave Syer
@dsyer
Mar 20 2017 08:07
All the thread pools are configurable
Tomcat has one too
Threads are expensive though, so be ware of the likely cost
dragontree101
@dragontree101
Mar 20 2017 08:08
ye
Dave Syer
@dsyer
Mar 20 2017 08:08
You could easily optimize for this scenario and find that something else doesn't work as well as you want (like you run out of memory).
softmanu
@softmanu
Mar 20 2017 09:27

sorry for any basic questions since I am quite new to this so this can happen.

but for my question I think, I got it..

zuul.host.max-total-connections & zuul.host.maxTotalConnections are exactly same . it is just the naming conventions and nothing more.
thanks
Rasheed Amir
@rasheedamir
Mar 20 2017 15:23
What is the recommendation/approach to discover backing services e.g. elasticsearch cluster, mongo cluster etc. through some service discovery tool e.g. Consul? Given the fact that nodes might come and go from cluster; which means the "Client Bean" (elasticsearch, mongo, etc.) will need to be "refreshed"? Is there is any out of the box suppport for it?
Rasheed Amir
@rasheedamir
Mar 20 2017 15:31
thanks and just read it; but bit confused that will the new call which uses a bean that must be refreshed due to change in configuration will happen automagically or I need to enforce it somehow e.g. call /referesh endpoint?
Dave Syer
@dsyer
Mar 20 2017 16:00
The bean only gets refreshed when an EnvironmentChangedEvent is fired
You can do that with /refresh (for instance)
Rasheed Amir
@rasheedamir
Mar 20 2017 16:07

but if I want this to happen programtically & automatically? any suggestions plz ... we would like to do it in a way that others can benefit from this solution; as I see this as a common use case in microservices based environment

( in a non spring environment we have solved this problem by always quering our service discovery tool to have the latest list of the hosts; before doing any operation )

Spencer Gibb
@spencergibb
Mar 20 2017 16:09
Consul automatically does a refresh. If using config server, use the monitor endpoint
Or you can use the available APIs if you want to trigger it yourself
Rasheed Amir
@rasheedamir
Mar 20 2017 16:18
awesome great thanks @spencergibb @dsyer we will give it a try
Ersagun
@ersagun
Mar 20 2017 16:25
thank you guys