Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
60f90766
Commit
60f90766
authored
Jun 26, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provide a huge max buffer on the receive pipe (required splitting send/receive options)
parent
b3c880b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
PhysicalConnection.cs
...kExchange.Redis/StackExchange/Redis/PhysicalConnection.cs
+3
-3
SocketManager.cs
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
+16
-6
No files found.
StackExchange.Redis/StackExchange/Redis/PhysicalConnection.cs
View file @
60f90766
...
...
@@ -835,7 +835,7 @@ private static LocalCertificateSelectionCallback GetAmbientCertificateCallback()
return
null
;
}
async
ValueTask
<
SocketMode
>
ISocketCallback
.
ConnectedAsync
(
Socket
socket
,
TextWriter
log
,
PipeOptions
pipeOptions
)
async
ValueTask
<
SocketMode
>
ISocketCallback
.
ConnectedAsync
(
Socket
socket
,
TextWriter
log
,
SocketManager
manager
)
{
try
{
...
...
@@ -871,11 +871,11 @@ async ValueTask<SocketMode> ISocketCallback.ConnectedAsync(Socket socket, TextWr
Multiplexer
.
Trace
(
"Encryption failure"
);
return
SocketMode
.
Abort
;
}
pipe
=
StreamConnector
.
GetDuplex
(
ssl
,
p
ipeOptions
,
name
:
Bridge
.
Name
);
pipe
=
StreamConnector
.
GetDuplex
(
ssl
,
manager
.
SendPipeOptions
,
manager
.
ReceiveP
ipeOptions
,
name
:
Bridge
.
Name
);
}
else
{
pipe
=
SocketConnection
.
Create
(
socket
,
p
ipeOptions
,
name
:
Bridge
.
Name
);
pipe
=
SocketConnection
.
Create
(
socket
,
manager
.
SendPipeOptions
,
manager
.
ReceiveP
ipeOptions
,
name
:
Bridge
.
Name
);
}
OnWrapForLogging
(
ref
pipe
,
physicalName
);
...
...
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
View file @
60f90766
...
...
@@ -28,8 +28,8 @@ internal partial interface ISocketCallback
/// </summary>
/// <param name="socket">The socket.</param>
/// <param name="log">A text logger to write to.</param>
/// <param name="
pipeOptions">Pipe configuration
</param>
ValueTask
<
SocketMode
>
ConnectedAsync
(
Socket
socket
,
TextWriter
log
,
PipeOptions
pipeOptions
);
/// <param name="
manager">The manager that will be owning this socket.
</param>
ValueTask
<
SocketMode
>
ConnectedAsync
(
Socket
socket
,
TextWriter
log
,
SocketManager
manager
);
/// <summary>
/// Indicates that the socket has signalled an error condition
...
...
@@ -139,15 +139,25 @@ public SocketManager(string name, bool useHighPrioritySocketThreads)
Task
.
Run
(()
=>
WriteAllQueuesAsync
());
const
int
Receive_PauseWriterThreshold
=
1024
*
1024
*
1024
;
// let's give it up to 1GiB of buffer for now
var
defaultPipeOptions
=
PipeOptions
.
Default
;
_scheduler
=
new
DedicatedThreadPoolPipeScheduler
(
name
,
priority
:
useHighPrioritySocketThreads
?
ThreadPriority
.
AboveNormal
:
ThreadPriority
.
Normal
);
_pipeOptions
=
new
PipeOptions
(
SendPipeOptions
=
new
PipeOptions
(
defaultPipeOptions
.
Pool
,
_scheduler
,
_scheduler
,
pauseWriterThreshold
:
defaultPipeOptions
.
PauseWriterThreshold
,
resumeWriterThreshold
:
defaultPipeOptions
.
ResumeWriterThreshold
,
defaultPipeOptions
.
MinimumSegmentSize
,
useSynchronizationContext
:
false
);
ReceivePipeOptions
=
new
PipeOptions
(
defaultPipeOptions
.
Pool
,
_scheduler
,
_scheduler
,
defaultPipeOptions
.
PauseWriterThreshold
,
defaultPipeOptions
.
ResumeWriterThreshold
,
defaultPipeOptions
.
MinimumSegmentSize
,
pauseWriterThreshold
:
Receive_PauseWriterThreshold
,
resumeWriterThreshold
:
Receive_PauseWriterThreshold
/
2
,
defaultPipeOptions
.
MinimumSegmentSize
,
useSynchronizationContext
:
false
);
}
readonly
DedicatedThreadPoolPipeScheduler
_scheduler
;
readonly
PipeOptions
_p
ipeOptions
;
internal
readonly
PipeOptions
SendPipeOptions
,
ReceiveP
ipeOptions
;
private
readonly
Func
<
Task
>
_writeOneQueueAsync
;
...
...
@@ -274,7 +284,7 @@ private async void EndConnectImpl(IAsyncResult ar, ConnectionMultiplexer multipl
if
(
ignoreConnect
)
return
;
socket
.
EndConnect
(
ar
);
var
socketMode
=
callback
==
null
?
SocketMode
.
Abort
:
await
callback
.
ConnectedAsync
(
socket
,
log
,
_pipeOption
s
);
var
socketMode
=
callback
==
null
?
SocketMode
.
Abort
:
await
callback
.
ConnectedAsync
(
socket
,
log
,
thi
s
);
switch
(
socketMode
)
{
case
SocketMode
.
Async
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment