-
Notifications
You must be signed in to change notification settings - Fork 244
Kafka Web Console release v2.0.0 is creating a high number of open file handles (against Kafka 0.8.1.1, ZooKeeper 3.3.4) #47
Description
I'm running Kafka Web Console release v2.0.0 against Kafka 0.8.1.1 and ZooKeeper 3.3.4
I'm consistently seeing the number of open file handles increasing when I launch Kafka Web Console after navigating to a topic on Zookeeper.
Once the file handles start to increase, they increase without any more navigation being done in the browser - meaning I only need to launch the web console and do nothing else beside monitor the number of open files and I'll see it increase every few seconds.
I've confirmed there are no other producers or consumers connecting to Kafka or Zookeeper.
After this runs for a while you'll get either of these errors:
- Run a Kafka command like this:
$INSTALLDIR/kafka/bin/kafka-topics.sh --zookeeper localhost:2181 --create --replication-factor 1 --partitions 4 --topic test2
You'll get an error like this:
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 0; nested exception is:
java.net.BindException: Address already in use
- Java clients might get an error like this (due to "Too many open files"):
java.io.FileNotFoundException: /src1/fos/dev-team-tools/var/kafka/broker-0/replication-offset-checkpoint.tmp
The ulimit for the id that my Kafka process runs under has a very large value for the "open files".
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 610775
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 500000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 610775
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
Note, I've also tried this Pull Request from @ibanner56 ( #40) which is related to these issues (#36 and #37 from @mungeol) but it did not fix the issue.
To reproduce on Linux do the following.
- Launch ZooKeeper
- Launch Kafka
- Create a topic with 4 partitions with 1 replication...
$INSTALLDIR/kafka/bin/kafka-topics.sh --zookeeper localhost:2181 --create --replication-factor 1 --partitions 4 --topic test2 - Open a Putty session and run this script in that window
while [[ 1 == 1 ]]; do
date
echo "zookeeper: $(ls -ltr /proc/`ps -ef |grep zookeeper.server|grep -v grep|awk '{print $2}'`/fd |wc -l)"
echo "Kafka: $(ls -ltr /proc/`ps -ef |grep kafka.Kafka |grep -v grep|awk '{print $2}'`/fd |wc -l)"
echo ""
sleep 5;
done
- Launch Kafka Web Console
- Browse to a topic
- Notice the number of "Kafka" connections in the Putty session should increase
- Wait several seconds. Notice the number of "Kafka" connections in the Putty session should increase again, without doing anything.
Sample output from the script in Topic Feed hangs browser #4 after running for a couple of hours (with 8 topics defined on the Zookeeper instance, 1 replication each, 4 partitions each).
Wed Jan 21 18:44:29 EST 2015
zookeeper: 37
Kafka: 6013
Wed Jan 21 18:44:34 EST 2015
zookeeper: 37
Kafka: 6013
Wed Jan 21 18:44:39 EST 2015
zookeeper: 37
Kafka: 6045
...
Wed Jan 21 18:51:23 EST 2015
zookeeper: 37
Kafka: 6461