随笔分类 - 系统构架相关
系统构架相关代码与心得
摘要:背景: 有时要根据不同的请求头或者请求参数动态修改路由的uri 实现方案: 使用全局过滤器(很关键) https://blog.csdn.net/netyeaxi/article/details/115287385 package com.tl.gateway.filter; import java
阅读全文
摘要:1、引入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <grou
阅读全文
摘要:面试题之redis实现限制1小时内每用户Id最多只能登录5次 /// <summary> /// redis实现限制1小时内每用户Id最多只能登录5次 /// </summary> /// <param name="userid">用户id</param> public static void Ch
阅读全文
摘要:redis 中的默认的过期策略是volatile-lru 。设置方式 config set maxmemory-policy volatile-lru maxmemory-policy 六种方式 volatile-lru:只对设置了过期时间的key进行LRU(默认值) allkeys-lru : 删
阅读全文
摘要:一、 正常切换1)从服务器检查SHOW PROCESSLIST语句的输出,直到你看到Has read all relaylogwaiting for the slave I/O thread to update it2)确保从服务器已经处理了日志中的所有语句。 mysql> STOP SLAVE I...
阅读全文
摘要:1、主从配置#主从都要加入以下配置如下[mysqld]log-bin=mysql-bin#主从要不一样server-id=222 #在主上建立一个用户给从的用GRANT REPLICATION SLAVE,RELOAD,SUPER ON *.* TO backup@'%' IDENTIFIED BY...
阅读全文
摘要:#region TransTest public static void TransTest() { RedisClient client1 = new RedisClient(host, port); RedisClient...
阅读全文
摘要:在github上下载了ServiceStack.Redis,做测试发现有限制,居然从v4开始就收费,无聊时,做了个源码分析废话不多,上测试代码 try { for (int i = 0; i ("w", "1"); ...
阅读全文
摘要:具体的看注释,代码如下: 1 public static void TransTest() 2 { 3 RedisClient client1 = new RedisClient(host, port); 4 Redis...
阅读全文
摘要:redis的一此笔记1、redis-cli -p 63792、config get requirepass3、config set requirepass test1234、auth test123或者查看配置文件,可以看到requirepass,修改其值,重启Redismaster 有密码,sla...
阅读全文
摘要:现有020的系统架构走库存,取券通过Fetch前n条来实现买n张优惠券,但此做法在高并发时有严重的性能问题,性能问题主要体现在数据库。 为了优化此性能,系统改为redis,走队列模式,即生产者消费者。 以下是自己做性能测试一此小杂记。 1 public static void testEnqueue
阅读全文
摘要:马上要用redis来改造现有的o2o项目了,在linux下部署了个redis,顺便研究了下代码操作,分享下代码using System;using System.Collections.Generic;using ServiceStack.Redis;namespace SysBuild{ c...
阅读全文