Comments (6)
怎么你们提 issue 都不按 template 填的?不要删掉 template 内容自己填啊!这样缺少很多必要信息,
- 什么操作系统?
- Go 是哪个版本?
- gnet 是哪个版本?
还有,麻烦贴下完整代码,不然不太好具体分析。
from gnet.
不好意思,这个是我疏忽了,我点提交issue 要求登录,登陆完返回的界面并没有template 的内容,是空的。
1.是wsl2 的ubuntu18.04
2.go 是1.13.1和1.13.3
3.版本是v1.0.0-beta.6
你那边想了解我go的项目代码,还是pprof打印的内容?
from gnet.
@luyu6056
代码和 pprof 输出都贴一下吧,要是不太方便发在 issue 里的话发我邮箱也行:[email protected],
我现在看你描述现象,我的一个猜测是 eventfd 的写入数达到最大值了, 如 man 手册说的那样:
write(2)
A write(2) call adds the 8-byte integer value supplied in its
buffer to the counter. The maximum value that may be stored
in the counter is the largest unsigned 64-bit value minus 1
(i.e., 0xfffffffffffffffe). If the addition would cause the
counter's value to exceed the maximum, then the write(2)
either blocks until a read(2) is performed on the file
descriptor, or fails with the error EAGAIN if the file
descriptor has been made nonblocking.
A write(2) fails with the error EINVAL if the size of the
supplied buffer is less than 8 bytes, or if an attempt is made
to write the value 0xffffffffffffffff.
你代码里是不是大量调用 AsyncWrite ?导致把 eventfd 塞满了所以阻塞,不过它的最大值是很大的,正常来说不会触到最大值的,所以还是看下具体代码我再仔细分析下。
from gnet.
好消息是,我调用了goroutine去处理消息回调AsyncWrite,完成了连续1000个消息接发请求,我建议在代码上对AsyncWrite进行goroutine异步处理,等晚上回家我把问题代码发到你邮箱
from gnet.
@luyu6056
额。。。 AsyncWrite
方法本来就是设计来放到 goroutine 异步写的,README 也有相关说明:带阻塞逻辑的 Server,不过理论上就算是直接调用 AsyncWrite
也不应该会阻塞,所以先看看代码吧,我确认下是 bug 还是你的写法问题。
from gnet.
BTY, 温馨提示 v1.0.0-beta.7 已经 released 了,做了一些小优化,可以升级到这个版本😀
from gnet.
Related Issues (20)
- [Question]: gnet engine is stopping with error: kevent add|clear:function not implemented HOT 5
- [Question]: 您好大佬,这个库的epoll的底层实现是用纯go实现的吗?没有用到cgo是吧? HOT 1
- [Feature]: how to disable logging? replace uber zap with zerolog too pls HOT 3
- [Question]: The TechEmpower Benchmark is misleading, but can we make it even faster? HOT 1
- [Feature]: add synchronization for Conn to make it concurrency-safe HOT 1
- [Question]: What is the maximum number of cores tested by anyone? I just tested 192 cores and it's better than evio etc but... HOT 7
- [Question]: Will the OnTraffic function be called concurrently? HOT 1
- [Question]: Validate the approach of implementing persistent TCP connections. HOT 1
- [Bug]: Calling Dial() in version 2.4 of Windows 10 will block HOT 4
- [Question]: I would like to verify whether this problem in the screenshot will cause the memory of the service to slowly increase. HOT 1
- [Feature]: support edge-triggered I/O
- [Question]: Is the netpoll v1 version defaulting to horizontal triggering, and the V2 version defaulting to edge triggering? HOT 15
- [Bug]: fatal error: concurrent map read and map write HOT 1
- Inconsistent behaviors with SO_REUSEPORT on Linux and *BSD HOT 7
- Don't use SO_REUSEPORT on Unix domain sockets HOT 1
- Don't disable SO_REUSEPORT on DragonFlyBSD HOT 1
- [Question]: gnet client works not as expected even tho i did it according to the api ref HOT 1
- [Bug]: GNET client not working as expected HOT 4
- [Bug]: example gnet for echo tcp uses too much memory HOT 7
- [Bug]: Read returns io.ErrShortBuffer on closed connection HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gnet.