Comments (3)
Hi Aaron,
You talked about using SocketAsyncEventArgs in Helios 2.0. From experience, you need to pool them to get better results than BeginReceive/BeginSend. I'm not very familiar with the Helios 1.X codebase, but it doesn't seem to pool its Send buffers, have you thought about a strategy for send buffer pooling in Helios 2.0?
Jeff
from helios.
SocketAsyncEventArgs pooling is questionable:
- for long living connections even the use of non-pooled SAEA is already an advantage over BeginReceive/BeginSend (well, that is the point SAEA was introduced in the first place);
- for short living connections pooling of SAEA might make sence.
Anyway pooling logic complicates the code.
Now I tend to aquire/release buffers from the pool on every new/completed network operation.
And create/dispose 2xSAEA on accept/close of a connection.
Though it all may be an oversight from my side on socket-server architecture ;)
from helios.
@Maximusya I think your design is good, but assigning only one SAEA for write operation on the socket force you to copy the buffer you want to send in the SAEA's buffer.
If you replace your traditional buffer pool by a SAEA pool, you can write directly in the SAEA buffer and send that to the socket. So one less Buffer.Copy per write.
Another advantage is that the socket can release the SAEA when it is done writing, so a connection will consume less memory when it's not writing data.
To optimize things further, your pool can allocate large buffers so they end up in the Large Object Heap. Then multiple SAEA can all point to the same buffer with different offset/count. This will result in less fragmentation and less pressure in the GC because it won't need to compact the heap.
from helios.
Related Issues (20)
- Does helios 2.1 supported for UDP server?
- [Question] Status vs DotNetty
- Helios IPV4/IPV6 issue on Mono
- Get build chain running on Mono
- Add additional specs for testing DNS resolution inside Helios HOT 1
- Not been updated。。。
- Need to adjust TCP KeepAlive timeouts
- All things considered, how about removing obsolete flag from legacy Helios 1.x APIs? HOT 1
- can make a CHAT DEMO for helios 2.1.3?
- The unhandled exception in akka.net framework from mono HOT 2
- DNX/.NET Core support
- got a System.OutOfMemoryException HOT 6
- Cluster sample HOT 1
- More basic examples (eg. telnet echo server) HOT 3
- Akka remote no long behaves correctly with 1.4.2 version of helios
- System.Collections.Generic.KeyNotFoundException HOT 1
- After Connection Double Disconnection HOT 4
- Need to decrease allocations inside Helios reactors HOT 3
- NRE on starting TcpClient.BeginReceive
- 2.0什么时间能完成? HOT 5
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 helios.