You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are upgrading our legacy 1.2.6 client to latest 2.0.601 version with our redis to elasticache upgrade. It could relate how we use the library, however we noticed a performance issue, and also see StackExchange.Redis.RedisTimeoutException, and I am able to replicate just use the .net framework 4.8 console app below, all the program doing is insert random numbers to elasticache by parallel:
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
namespace RedisSync
{
class Program
{
static void Main(string[] args)
{
var plexer = ConnectionMultiplexer.Connect("Our super secret connection string to elasticache with auth token and ssl enabled");
var tasks = new List<Task>();
var rnd = new Random();
var sw = Stopwatch.StartNew();
for (int taskCtr = 0; taskCtr < 500; taskCtr++)
tasks.Add(Task.Run(() =>
{
var rndKey = rnd.Next(10000);
try
{
plexer.GetDatabase().StringSet(
rndKey.ToString(),
rndKey,
TimeSpan.FromMinutes(5)
);
}
catch (Exception)
{
Console.WriteLine($"Failed to play key {rndKey}");
throw;
}
}));
try
{
Task.WaitAll(tasks.ToArray());
}
catch (AggregateException e)
{
foreach (var ie in e.InnerExceptions)
Console.WriteLine("{0}: {1}", ie.GetType().Name, ie.Message);
}
Console.WriteLine($"Takes {sw.ElapsedMilliseconds} ms, Press enter to finish");
Console.ReadLine();
}
}
}
When the program runs on 1.2.6, everything is fine. However when it runs on 2.0.601, it complains about timeout for 5000ms, using the exactly same code.
We have to reduce 500 to 16 or smaller number for the task list on my local, in order to avoid the timeout exception. But we will then see performance drops measured by the stopwatch.
Just want to see anything we did wrong?
The text was updated successfully, but these errors were encountered:
zhangxin511
changed the title
Performance between 1.2.6 and 2.*
Performance between 1.2.6 and 2.0.601
Jan 21, 2020
To whom it may concern,
We are upgrading our legacy 1.2.6 client to latest 2.0.601 version with our redis to elasticache upgrade. It could relate how we use the library, however we noticed a performance issue, and also see
StackExchange.Redis.RedisTimeoutException
, and I am able to replicate just use the .net framework 4.8 console app below, all the program doing is insert random numbers to elasticache by parallel:When the program runs on 1.2.6, everything is fine. However when it runs on 2.0.601, it complains about timeout for 5000ms, using the exactly same code.
We have to reduce 500 to 16 or smaller number for the task list on my local, in order to avoid the timeout exception. But we will then see performance drops measured by the stopwatch.
Just want to see anything we did wrong?
The text was updated successfully, but these errors were encountered: