Giter VIP home page Giter VIP logo

Comments (8)

PotatoCloud avatar PotatoCloud commented on June 1, 2024

该问题百分百复现

from gnet.

panjf2000 avatar panjf2000 commented on June 1, 2024

看你这 profiling 结果,你的服务器一直在接收新连接吧?是不是你的客户端使用的是短连接,用完就丢?而且在频率很高。

from gnet.

PotatoCloud avatar PotatoCloud commented on June 1, 2024

没有,websocket业务,看了下服务器上的连接数,就几百个,而且重启完不会出现CPU占用率很高的情况。这种情况是保持了大量的连接后出现的...

from gnet.

panjf2000 avatar panjf2000 commented on June 1, 2024

所以复现的步骤是:

  1. 先发起大量的连接,然后 CPU 占用飙升;
  2. 客户端关闭大部分连接之后,CPU 占用率没有下降。

这样?

有没有试过不要用 gnet.WithReuseAddr(true), gnet.WithReusePort(true) ?

from gnet.

panjf2000 avatar panjf2000 commented on June 1, 2024

还有,能不能详细描述复现这个问题的步骤,以及能够稳定复现的客户端和服务端代码?

from gnet.

PotatoCloud avatar PotatoCloud commented on June 1, 2024
  1. 发起大量的连接后,CPU占用一开始不会飙升,而是过一段时间后才会飙升
  2. 是的
  3. 没试过不使用 gnet.WithReuseAddr(true), gnet.WithReusePort(true)

from gnet.

panjf2000 avatar panjf2000 commented on June 1, 2024

如果可以的话,请用 bug report 的模板重新建一个 issue,填上所有必要的信息。

from gnet.

PotatoCloud avatar PotatoCloud commented on June 1, 2024

每次CPU飙升都是 +100% +100% 这样🤔

from gnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.