Comments (4)
连续请求几次cpu就跑到100%了
from jsonrpc4go.
文件:server/tcp.go
方法:handleFunc
去掉外层for循环
from jsonrpc4go.
感觉是缓存区太小,频繁对比eof导致cpu上升,我这边测试下
from jsonrpc4go.
1、issues #2 可以通过之前的配置PackageMaxLength实现,代码如下。默认的一次取数据slice已经足够长了,还出现数据不全的情况可能是因为你的tcp缓存区较小,程序已兼容
- server
s.SetOptions(server.TcpOptions{"\r\n", 2 * 1024 * 1024})
- client
c.SetOptions(client.TcpOptions{"\r\n", 2 * 1024 * 1024})
2、cpu飙升原因:连接断开后,主进程不退出,会死循环。你给出的解决方案解决不了长连接的情况,程序已加判断,在连接断开后,直接退出循环
from jsonrpc4go.
Related Issues (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 jsonrpc4go.