Comments (4)
From the flame graph provided, the memory usage mainly comes from two parts:
netpoll(*connection).init
:- indicates that a lot of connections are Accepted and maintained, not closed.
- If so, the memory performance may be normal.
netpoll(*LinkBuffer).growth
:- indicates that the memory is growing. Please confirm whether you have actively called
Release
to release the memory. for example - If you have done so, the memory performance may be normal.
- indicates that the memory is growing. Please confirm whether you have actively called
from netpoll.
My code looks like this
var eventLoop netpoll.EventLoop
func handler(ctx context.Context, conn netpoll.Connection) error {
data, err := conn.Reader().ReadBinary(conn.Reader().Len())
if err != nil {
logging...
return conn.Close()
}
....business logic......
conn.Reader().Release()
remote := net.Dial(remote server)
go func () {
_, err := io.Copy(remote,conn)
}
io.Copy(conn,remote)
}
What I am noticing is on a specific VPS provider, I get the memory issue but on another, i don't.
Here is the flame graph of another.
from netpoll.
PS: The first graph is abbreviated as Fig 1
, the second as Fig 2
I found that in the two graphs, the difference lies in the proportion of netpoll(*LinkBuffer).growth
The handleTCPProxy
in Fig 2
is inlined
but not in Fig 1
. Is there a difference here ?
Sorry for not finding other useful help.
from netpoll.
This is helpful thanks. I will reopen this issue if I find something more defined.
Thanks again.
from netpoll.
Related Issues (20)
- Can you write to a connection concurrently? HOT 2
- conn断连触发Writer().Malloc() 空指针panic HOT 1
- question: why not use `sync.Pool` HOT 8
- C++ server端重启造成client端panic HOT 6
- func OnRequest: context get 0 value under high concurrency HOT 3
- 当客户端主动关闭链接时,服务端获取不到完整的数据 HOT 7
- WSL2 run go build report netpoll error HOT 1
- Client 支持代理吗? HOT 1
- 什么时候可以支持UDP? HOT 2
- netpoll should handle error with backoff HOT 3
- err.Error() never contains "closed" HOT 1
- Why `SetFinalizer` is needed when `eventLoop` exit in `Serve` func HOT 1
- netpoll源码疑问 HOT 11
- uint value overflow error on aarch64 environment HOT 2
- [Fasthttp] panic: BUG: net.Listener returned (nil, nil) HOT 3
- "no such file or directory when flush" error
- Reporting a vulnerability HOT 1
- Status of netpoll io_uring HOT 4
- netpoll 是否支持32位系统? HOT 1
- resource temporarily unavailable error HOT 3
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 netpoll.