Hello,
I am using ElasticSearch 1.0.0 with Kibana 3 on Solaris 11.1. My environment is as following.
$ ./elasticsearch -v
Version: 1.0.0, Build: a46900e/2014-02-12T16:18:34Z, JVM: 1.7.0_07
$ java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) Server VM (build 23.3-b01, mixed mode)
$ cat /etc/release
Oracle Solaris 11.1 X86
Copyright (c) 1983, 2012, Oracle and/or its affiliates. All rights reserved.
Assembled 19 September 2012
I was suffering from very high CPU usage of Java process.
When I connected to ES via Kibana, the CPU usage became 90%-100%. Strangely, user cpu usage was not so high, but sys cpu usage was very high with vmstat command.
I tried to examine system calls by using truss command. I found there are so many ioctl calls while connecting.
$ sudo truss -c -p 18496
syscall seconds calls errors
read .000 13 4
write .000 12
ioctl 1.043 142731
lwp_cond_wait .002 178 153
lwp_cond_signal .000 25
pollsys .000 54
lwp_mutex_timedlock .000 1
pread64 .016 1432
-------- ------ ----
sys totals: 1.062 144446 157
usr time: .387
elapsed: 3.620
$ sudo truss -p 18496
...
/47: ioctl(99, DP_POLL, 0xF6CB5750) = 1
/48: ioctl(102, DP_POLL, 0xF6C746D0) = 1
/49: ioctl(105, DP_POLL, 0xF6C33650) = 1
/48: ioctl(102, DP_POLL, 0xF6C746D0) = 1
/47: ioctl(99, DP_POLL, 0xF6CB5750) = 1
/48: ioctl(102, DP_POLL, 0xF6C746D0) = 1
/47: ioctl(99, DP_POLL, 0xF6CB5750) = 1
/49: ioctl(105, DP_POLL, 0xF6C33650) = 1
/47: ioctl(99, DP_POLL, 0xF6CB5750) = 1
/48: ioctl(102, DP_POLL, 0xF6C746D0) = 1
/49: ioctl(105, DP_POLL, 0xF6C33650) = 1
/47: ioctl(99, DP_POLL, 0xF6CB5750) = 1
/48: ioctl(102, DP_POLL, 0xF6C746D0) = 1
/49: ioctl(105, DP_POLL, 0xF6C33650) = 1
/47: ioctl(99, DP_POLL, 0xF6CB5750) = 1
/48: ioctl(102, DP_POLL, 0xF6C746D0) = 1
/47: ioctl(99, DP_POLL, 0xF6CB5750) = 1
...
I thought there are something wrong with HTTP KeepAlive. And, I considered to put HTTP Proxy between ES and Kibana(client browser) to disable KeepAlive. I setuped Apache mod_proxy to disable KeepAlive by folowing settings.
ProxyPass /es http://localhost:9200
ProxyPassReverse /es http://localhost:9200
SetEnv proxy-nokeepalive 1
And, I changed Kibana config.js to connect to ES via proxy. After that, the CPU usage dramatically came down. There may be some problem with HTTP KeepAlive at least on Solaris.
Thanks,
K.Cima