i have the problem
“Message” : “[02:10:49.659] Unable to Connect: sPort: 57036, Error: Value cannot be null.\r\nParameter name: segment\n at System.Net.RangeValidationHelpers.ValidateSegment(ArraySegment1 segment)\r\n at System.Net.Sockets.SocketPal.Send(SafeCloseSocket handle, IList1 buffers, SocketFlags socketFlags, Int32& bytesTransferred)\r\n at System.Net.Sockets.Socket.Send(IList1 buffers, SocketFlags socketFlags, SocketError& errorCode)\r\n at ServiceStack.Redis.RedisNativeClient.FlushSendBuffer()\r\n at ServiceStack.Redis.RedisNativeClient.SendReceive[T](Byte[][] cmdWithBinaryArgs, Func1 fn, Action1 completePipelineFn, Boolean sendWithoutRead)”, “StackTrace” : " at ServiceStack.Redis.RedisNativeClient.CreateConnectionError(Exception originalEx)\r\n at ServiceStack.Redis.RedisNativeClient.SendReceive[T](Byte[][] cmdWithBinaryArgs, Func1 fn, Action1 completePipelineFn, Boolean sendWithoutRead)\r\n at ServiceStack.Redis.RedisNativeClient.SendExpectData(Byte[][] cmdWithBinaryArgs)\r\n at ServiceStack.Redis.RedisClient.GetValue(String key)\r\n at RedisHelper.RedisString.Get(String key)\r\n at Pactet.Application.PacketService.d__1.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()\r\n at Packet.Controllers.PacketController.d__3.MoveNext()"
in my web 100requests/second in one request there are 4 get/set Redis
my code is
public class RedisManager
{
private static PooledRedisClientManager prcm;
///
///
///
private static void CreateManager()
{
var redis = AppSettings.settings.Redis;
string[] WriteServerConStr = SplitString(redis.WriteServerConStr, “,”);
string[] ReadServerConStr = SplitString(redis.ReadServerConStr, “,”);
prcm = new PooledRedisClientManager(ReadServerConStr, WriteServerConStr,
new RedisClientManagerConfig
{
MaxWritePoolSize = redis.MaxWritePoolSize,
MaxReadPoolSize = redis.MaxReadPoolSize,
AutoStart = redis.AutoStart,
});
}
public static IRedisClient GetClient()
{
if (prcm == null)
CreateManager();
return prcm.GetClient();
}
}
public abstract class RedisBase : IDisposable
{
public static IRedisClient Core { get; private set; }
private bool _disposed = false;
static RedisBase()
{
Core = RedisManager.GetClient();
}
in Service like:
RedisBase.Core.Set(“bbt_packet_123” , new { Time = DateTime.Now });
in my case errrors created more than 30/second