Java elastic client


(Fabioebner) #1

I create one app with elastic client, but only to startup my app i got 53 threads from elastic it's correct??

I alredy try to verify is my client are opened and dont open another

if (client==null){
		client = new TransportClient(ImmutableSettings.settingsBuilder()
	            .put("cluster.name", this.cluster).build())
	            .addTransportAddress(new InetSocketTransportAddress(host, port));
		}

tks

233 elasticsearch[Samuel Silke][[timer]] java.lang.Thread.sleep ( native code ) TIMED_WAITING false false 226218 0
stop 234 elasticsearch[Samuel Silke][scheduler][T#1] sun.misc.Unsafe.park ( native code ) TIMED_WAITING false false 27153 0
stop 235 elasticsearch[Samuel Silke][transport_client_worker][T#1]{New I/O worker #1} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 5
stop 236 elasticsearch[Samuel Silke][transport_client_worker][T#2]{New I/O worker #2} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 237 elasticsearch[Samuel Silke][transport_client_worker][T#3]{New I/O worker #3} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 238 elasticsearch[Samuel Silke][transport_client_worker][T#4]{New I/O worker #4} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 239 elasticsearch[Samuel Silke][transport_client_worker][T#5]{New I/O worker #5} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 24 New Relic Thread Service sun.misc.Unsafe.park ( native code ) TIMED_WAITING false false 152 0
stop 240 elasticsearch[Samuel Silke][transport_client_worker][T#6]{New I/O worker #6} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 241 elasticsearch[Samuel Silke][transport_client_worker][T#7]{New I/O worker #7} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 242 elasticsearch[Samuel Silke][transport_client_worker][T#8]{New I/O worker #8} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 243 elasticsearch[Samuel Silke][transport_client_worker][T#9]{New I/O worker #9} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 244 elasticsearch[Samuel Silke][transport_client_worker][T#10]{New I/O worker #10} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 245 elasticsearch[Samuel Silke][transport_client_worker][T#11]{New I/O worker #11} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 246 elasticsearch[Samuel Silke][transport_client_worker][T#12]{New I/O worker #12} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 247 elasticsearch[Samuel Silke][transport_client_worker][T#13]{New I/O worker #13} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 248 elasticsearch[Samuel Silke][transport_client_worker][T#14]{New I/O worker #14} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 249 elasticsearch[Samuel Silke][transport_client_worker][T#15]{New I/O worker #15} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 25 New Relic Deadlock Detector sun.misc.Unsafe.park ( native code ) TIMED_WAITING false false 152 0
stop 250 elasticsearch[Samuel Silke][transport_client_worker][T#16]{New I/O worker #16} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 251 elasticsearch[Samuel Silke][transport_client_worker][T#17]{New I/O worker #17} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 252 elasticsearch[Samuel Silke][transport_client_worker][T#18]{New I/O worker #18} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 253 elasticsearch[Samuel Silke][transport_client_worker][T#19]{New I/O worker #19} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 254 elasticsearch[Samuel Silke][transport_client_worker][T#20]{New I/O worker #20} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 255 elasticsearch[Samuel Silke][transport_client_worker][T#21]{New I/O worker #21} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 256 elasticsearch[Samuel Silke][transport_client_worker][T#22]{New I/O worker #22} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0
stop 257 elasticsearch[Samuel Silke][transport_client_worker][T#23]{New I/O worker #23} sun.nio.ch.EPollArrayWrapper.epollWait ( native code ) RUNNABLE true false 0 0


(Patrick Kik) #2

Your code seems fine. I agree that having that much threads is odd. Never tested it myself.


(system) #3