Skip to content

Instantly share code, notes, and snippets.

Jon Cole JonCole

Block or report user

Report or block JonCole

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JonCole
JonCole / TlsVersionTest.cs
Last active Jun 5, 2019
TLS Version Test
View TlsVersionTest.cs
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Security;
using System.Net.Sockets;
using System.Security.Authentication;
using System.Text;
using System.Threading.Tasks;
namespace System
View License-For-Source-Code.md

Summary

Unless otherwise noted, all source code under https://gist.github.com/joncole is licensed using an MIT License

MIT License

Copyright 2018 Jon Cole

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

View Redis-DebuggingKeyspaceMisses.md

Debugging Redis Keyspace Misses

Simply put, a keyspace "MISS" means some piece of data you tried to retrieve from Redis was not there. This usually means that one of the following things happened:

  1. The key expired
  2. They key was renamed
  3. The key was deleted
  4. The key was evicted due to memory pressure
  5. The entire database was flushed
  6. The key was never actually inserted
View Redis-BestPractices-General.md
@JonCole
JonCole / StackExchangeRedisExtensions.cs
Last active Mar 13, 2019
StackExchange.Redis Extension Methods
View StackExchangeRedisExtensions.cs
namespace StackExchange.Redis
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
public static class StackExchangeRedisExtensions
{
public static IEnumerable<IServer> GetMasterServers(this IConnectionMultiplexer connection)
@JonCole
JonCole / WhatHappenedToMyDataInRedis.md
Last active Oct 8, 2019
What happened to my data in Redis?
View WhatHappenedToMyDataInRedis.md

What happened to my data in Redis?

This post is a FAQ for Redis, when users don’t see the data they stored in Redis.

As per the Redis project, Redis is described as an in-memory data structure store. If you are using Redis as an LRU cache, you can see following recommendation from the Redis docs: Using Redis as an LRU cache

Lately, I have received multiple questions about when Redis will lose data. This data loss can be as simple as a few keys disappearing unexpectedly or complete loss of all data in Redis. Below I will talk about the most common causes as well as a few rare cases where this can happen.

Note: These scenarios are common to all Redis hosting environments, including self-hosting Redis in your own data center.

@JonCole
JonCole / RedisKeyspaceNotificationsExample.cs
Last active Sep 26, 2019
Redis Keyspace Notification Example
View RedisKeyspaceNotificationsExample.cs
using System;
namespace StackExchange.Redis
{
static class RedisKeyspaceNotifications
{
/// <summary>
/// NOTE: For this sample to work, you need to go to the Azure Portal and configure keyspace notifications with "Kxge$" to
/// 1) turn on expiration notifications (x),
/// 2) general command notices (g) and
@JonCole
JonCole / AzureRedis-PatchingExplained.md
Last active Oct 18, 2019
AzureRedis-PatchingProces
View AzureRedis-PatchingExplained.md

Azure Redis Patching Explained

Occationally customers will experience connection related errors in their client applications talking to Redis. Most often these errors are caused by one of the following:

  1. Redis was patched or a master/slave failover occurred.
  2. A client-side network configuration change was made. See below for details

In this article we will quickly discuss how patching works in Azure Redis and how this impacts clients. While this article talks mostly about patching, the experience is more or less the same when a failover occurs.

Redis Patching and Failover Details

@JonCole
JonCole / CrashDumpHelper.cs
Last active Sep 25, 2017
Crash Dump instructions and Helper code for doing it programmatically.
View CrashDumpHelper.cs
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
namespace System.Diagnostics
{
public static class CrashDumpHelper
{
/// <summary>
@JonCole
JonCole / SupportQuestionnaire.md
Last active May 3, 2017
Support Questionnaire
View SupportQuestionnaire.md

When contacting us with questions, please provide the following information to enable us to best help you.

Required Information

  • Cache Name

  • Date&Time when issue started and ended. Note: A 1-2 hour time window is ideal. If the issue is intermittent, please provide exact times for a few of the errors so that we can correlate with our logs.

    Important: Please Specify whether times are in UTC or some other Time Zone. If you do not clarify the time zone, we don't know what time

You can’t perform that action at this time.