Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nacos内存占用量特别大 #11539

Closed
zhou-lang opened this issue Dec 22, 2023 · 7 comments
Closed

nacos内存占用量特别大 #11539

zhou-lang opened this issue Dec 22, 2023 · 7 comments

Comments

@zhou-lang
Copy link

Issue Description

测试环境上nacos集群中3个节点。每次在nacos启动以后,比如此时内存占用8G 。在启动以后,内存占用量会一直上升,过几天一直上升到-Xmx12g 的值,此后,程序过段时间偶尔会崩溃。

Describe what you expected to happen

一开始是使用的startup.sh 中默认的 -server -Xms12g -Xmx12g -Xmn2g -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=320m

后来由于内存使用量太大。增加了 -XX:+UseG1GC 去掉了-Xmn2g
改为:-server -Xms12g -Xmx12g -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=320m -XX:+UseG1GC

请问下像这种内存使用量过大的问题,是我限制的测试xmx最大值太小了。还是说nacos有一些自己优化内存的方法?

@985492783
Copy link
Contributor

用的哪个版本

@zhou-lang
Copy link
Author

测试2.2.1 生产2.0.3 都或多或少有这种情况出现。

@985492783
Copy link
Contributor

客户端版本太低了吗,单节点启动8G?我docker单机限制4G内存都用的还可以

@zhou-lang
Copy link
Author

客户端90%以上都是1.4
测试3节点 2.2.1,目前每个节点内存使用12g左右。 看监控注册的ipCount 大约300左右
生产3节点 2.0.3 ,目前每个节点内存使用32G左右。 监控看注册的ipCount curl "127.0.0.1:8848/nacos/actuator/prometheus" | grep ipCount 大约 1900

@985492783
Copy link
Contributor

可以把客户端升级2.x,1.x用的http会导致这个问题,2.x是grpc长连接

@zhou-lang
Copy link
Author

我想问下,现在测试和生产都是用nginx来代理的。
upstream nacos-8848 {
server ip1:8848 weight=10;
server ip2:8848 weight=10;
server ip3:8848 weight=10;
}
server {
listen 80;
server_name nacos.prod.com;
proxy_pass http://nacos-8848;
}

如果客户端升级成2.x以上。那我nginx配置还需要改动吗,需要改反向代理8848端口吗?
客户端的链接地址还要如何改动。 这个我在nacos的官网上文档里也没查到

@985492783
Copy link
Contributor

nginx可以看下这个,社区里有同学分享过,grpc端口是9848 #9004

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants