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

访问子应用请求地址chat/share?shareId=a0rqbwmvzo7p41a0rlpetmyl,特别慢需要10s,有哪个地方可以优化吗? #1112

Closed
6 of 7 tasks
Andy1018 opened this issue Apr 1, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@Andy1018
Copy link

Andy1018 commented Apr 1, 2024

例行检查

  • 我已确认目前没有类似 issue
  • 我已完整查看过项目 README,以及项目文档
  • 我使用了自己的 key,并确认我的 key 是可正常使用的
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

你的版本

  • 公有云版本
  • 私有部署版本, 具体版本号:

问题描述

复现步骤

预期结果

相关截图
D6F01048-9357-4e29-97E9-36317F45F47D

@Andy1018 Andy1018 added the bug Something isn't working label Apr 1, 2024
@Andy1018
Copy link
Author

Andy1018 commented Apr 1, 2024

问题补充:源码方式启动,访问速度不慢。换成镜像启动速度就慢

@hkutangyu
Copy link

问题补充:源码方式启动,访问速度不慢。换成镜像启动速度就慢

我也碰到这个问题,请问解决了吗?

@Andy1018
Copy link
Author

Andy1018 commented Apr 1, 2024

@hkutangyu 没有。很奇怪的是偶尔重启一次访问速度又快了,这种情况只是偶尔会发生。绝不是硬件问题,无论是cpu、内存还是gpu都有很大空闲。

@hkutangyu
Copy link

@hkutangyu 没有。很奇怪的是偶尔重启一次访问速度又快了,这种情况只是偶尔会发生。绝不是硬件问题,无论是cpu、内存还是gpu都有很大空闲。

嗯,我们硬件都是128核,128GB的服务器,8卡3090。确实,我重启一下,就好了。

@Andy1018
Copy link
Author

Andy1018 commented Apr 1, 2024

@c121914yu 能提供下解决思路吗,比如在某几个请求页面加上日志信息

@c121914yu
Copy link
Collaborator

@c121914yu 能提供下解决思路吗,比如在某几个请求页面加上日志信息

可以试试,share 页去掉 ssr,重新打包看看。或者给 ssr 的数据库查询加上时间日志。

@Andy1018
Copy link
Author

Andy1018 commented Apr 2, 2024

@c121914yu 能提供下解决思路吗,比如在某几个请求页面加上日志信息

可以试试,share 页去掉 ssr,重新打包看看。或者给 ssr 的数据库查询加上时间日志。

是这个页面吗?share.tsx debug好像不走这个页面呢。。。

@c121914yu
Copy link
Collaborator

c121914yu commented Apr 2, 2024

@c121914yu 能提供下解决思路吗,比如在某几个请求页面加上日志信息

可以试试,share 页去掉 ssr,重新打包看看。或者给 ssr 的数据库查询加上时间日志。

是这个页面吗?share.tsx debug好像不走这个页面呢。。。

就是这个。
完整点: chat/share.tsx

@Andy1018
Copy link
Author

Andy1018 commented Apr 2, 2024

@c121914yu 能提供下解决思路吗,比如在某几个请求页面加上日志信息

可以试试,share 页去掉 ssr,重新打包看看。或者给 ssr 的数据库查询加上时间日志。

是这个页面吗?share.tsx debug好像不走这个页面呢。。。

就是这个。 完整点: chat/share.tsx

已测试,并不是share.tsx页面问题,问下在进入_app.tsx前,后台走的是那一部分逻辑?

@Andy1018
Copy link
Author

Andy1018 commented Apr 2, 2024

@c121914yu 能提供下解决思路吗,比如在某几个请求页面加上日志信息

可以试试,share 页去掉 ssr,重新打包看看。或者给 ssr 的数据库查询加上时间日志。

是这个页面吗?share.tsx debug好像不走这个页面呢。。。

就是这个。 完整点: chat/share.tsx

已测试,并不是share.tsx页面问题,问下在进入_app.tsx前,后台走的是那一部分逻辑?

进入程序入口页面_app.tsx就很慢,测试方法在_app.tsx function App({ Component, pageProps }: AppProps) {方法加日志,需要10s才会打印

@c121914yu
Copy link
Collaborator

c121914yu commented Apr 11, 2024

https://github.com/labring/FastGPT/pull/1173我在这个Pr中临时修复了这个问题。
关键问题在于,SSR渲染时候,没有使用已连接的数据库实例,目前是临时加了个强制连接操作,但是从日志看,也没看到MongoDB连接的日志(不过解决了数据库查询超时问题)。
具体原因后续继续排查。
@Andy1018 麻烦验证下,我在测试环境已通过。

具体是这个文件:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants