卡夫卡+ Kafka 代理之间或代理与客户端之间可能打开的文件过多

发布于 2025-01-11 08:57:09 字数 2412 浏览 0 评论 0原文

我们的 Apache Kafka 服务器面临着非常大的问题 我们的 Kafka 服务器之所以增加,是因为“打开文件太多”,

我们的生产 Kafka 集群有 7 台机器,而 Kafka 版本是0.1

我们已经增加了将“kafka_user_nofile_limit”的两倍变为500000,而原始值为128000

但我们再次达到了高值并且代理崩溃了

另外我们可以清楚地看到 Kafka 日志中有许多行“打开文件太多”

我们看到了以下Jira案例

https://issues.apache.org/jira/browse/KAFKA-3317

但我们看不到什么这个 jira 的解决方案是什么,或者这个主要问题的解决方法是什么?

来自 jira

 Bug
Status:OPEN
Priority: Major
Resolution:Unresolved
Affects Version/s:
0.9.0.0, 0.9.0.1
Fix Version/s:None
Component/s:None
Labels:None
Environment:CentOS release 6.5 (Final)
kafka_2.11-0.9.0.1
Flags:
Important
Description
there is much open files in my java app client which write msg to kafka broker, i used

<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>0.9.0.1</version>
</dependency>
new api to write msg. when i use

lsof -p 8780 | wc -l
19184
lsof -p 8780 | grep XmlIpcRegSvc | wc -l
4920
lsof -p 8780 | grep pipe | wc -l
9576
lsof -p 8780 | grep eventpoll | wc -l
4792
where 8780 is my java app pid.

java 37121 app *796u IPv6 960673997 0t0 TCP mad183:50213->mad180:XmlIpcRegSvc (ESTABLISHED)
there are many ESTABLISHED XmlIpcRegSvc , and seems not closed.
and It likes use ipv6 .


 

来自我的 kafka 机器的示例

 more /etc/security/limits.d/kafka.conf

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

kafka   - nofile   500000
kafka   - nproc    65536

we are facing very major problem with our Apache Kafka servers
our Kafka servers are creased because "Too many open files"

we have production Kafka cluster with 7 machines , while Kafka version is 0.1

we already increases twice the "kafka_user_nofile_limit" to 500000 , while the original value is 128000

but again we are hit the high value and brokers are crashed

additional we can see clearly that many lines as "Too many open files" are in Kafka logs

we saw the following Jira case

https://issues.apache.org/jira/browse/KAFKA-3317

but we not see what is the solution for this jira or what is the workaround for this major problem ?

from jira

 Bug
Status:OPEN
Priority: Major
Resolution:Unresolved
Affects Version/s:
0.9.0.0, 0.9.0.1
Fix Version/s:None
Component/s:None
Labels:None
Environment:CentOS release 6.5 (Final)
kafka_2.11-0.9.0.1
Flags:
Important
Description
there is much open files in my java app client which write msg to kafka broker, i used

<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>0.9.0.1</version>
</dependency>
new api to write msg. when i use

lsof -p 8780 | wc -l
19184
lsof -p 8780 | grep XmlIpcRegSvc | wc -l
4920
lsof -p 8780 | grep pipe | wc -l
9576
lsof -p 8780 | grep eventpoll | wc -l
4792
where 8780 is my java app pid.

java 37121 app *796u IPv6 960673997 0t0 TCP mad183:50213->mad180:XmlIpcRegSvc (ESTABLISHED)
there are many ESTABLISHED XmlIpcRegSvc , and seems not closed.
and It likes use ipv6 .


 

example from my kafka machines

 more /etc/security/limits.d/kafka.conf

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

kafka   - nofile   500000
kafka   - nproc    65536

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文