K6 부하 테스트 터미널 창에서 WARN[0000] Request Failed error="Post \" http://localhost:8080/likes/redis\ ": dial tcp 127.0.0.1:8080: connectex: No connection could be made because the target machine actively refused it." 상기 에러가 계속 나옵니다. -- 테스트 결과 -- 이전 테스트 보다 20배정도 처리속도가 개선된건 확인했으나 실패율이 계속 뜨는건 OS차원의 문제일까요? (OS는 Windows 입니다) -- Redis 적용 이전 -- -- Redis 적용 이후 --
최근에 Redis 의 개발사가 라이선스 정책을 변경하면서, 더 이상 완전한 무료 오픈소스로 부르기 애매해지는 사건이 있었습니다. 이에 반발한 AWS, 구글 등 빅테크 기업들이 모인 Linux Foundation 에서 기존 Redis 코드를 그대로 복사해서(포크해서) 만든 진짜 100% 무료 오픈소스가 바로 Valkey 입니다. 라고 제미나이가 그러던데... 요즘은 Valkey를 선택하는 게 대세인가요?
안녕하세요 항상 강의 잘 수강하고 있습니다 ! 강의를 수강하다 질문이 생겨 여쭤보게 되었습니다. 강의 진행 시에는 Service 계층에서 Redis 설정을 적용시켰는데, Redis 설정은 Service 계층에서 적용하는 것이 일반적일까요 ? Repository나 Controller 계층에서도 걸어줘도 차이가 있는지 궁금해서 여쭤봅니다 !
안녕하세요 강사님 redis 를 잘 몰라서 공부중인데, 인터넷에 검색해보니(각종 gpt, claude)등도 실무에서 클러스터링 이슈 등으로 0번 이외의 DB는 사용하지 않는다는 설명이 있는 있는데, 0 DB 외에 1~16DB도 실무에서 쓰이나요? https://redis.io/docs/latest/operate/oss_and_stack/reference/cluster-spec/ 에서도 0 DB만 multiple databases를 지원한다고 나와있고 string 자료구조 강의에서 0 : 인증, 1: 캐싱, 3: 상품목록 등을 관리한다는 언급이 있어서 질문드립니다.
안녕하세요. redis 강의를 통해 간단한 프로젝트로 적용을 하려고 합니다. @Cacheable( value = "reviewList", key = "'review:store:' + #storeId + ':page:' + #pageable.pageNumber", cacheManager = "reviewCacheManager", condition = "#pageable.pageNumber == 0") @Transactional(readOnly = true) public Page<ResViewReviewDto> getReviews(UUID storeId, ReviewRepositorySearchConditionDto condition, Pageable pageable) { Page<ResViewReviewDto> reviews = reviewRepository.findReviews(storeId, condition, pageable); return new PageImpl<>(reviews.getContent(), pageable, reviews.getTotalElements()); } 원래는 return reviews를 했더니 계속 조회를 누르면 ClassCastException: LinkedHashMap cannot be cast to Page 이 오류가 나오게 됩니다. 강의에서는 그냥 getContent를 List로 반환값을 보냈는데 혹시 위 코드처럼 new PageImpl 형식으로 return 해도 괜찮을까요?
강사님, 캐싱 관련해서 실무적인 관점의 질문이 있습니다. 강의에서 String 타입의 value에 JSON 형식으로 데이터를 저장해서 캐싱 처리를 한다고 배웠는데, 실무에서 어느 범위까지 캐싱하는 게 적절한지 감을 잡고 싶습니다. 과거에 MyBatis의 동적 쿼리처럼 조건부 로직이 포함된 200줄짜리 복잡한 쿼리가 DB에서 파싱되는 시간 자체만으로도 성능 부하를 유발했던 경험이 있습니다. 쿼리 자체를 수정하는 것이 베스트겠지만, 현실적으로 어려울 때가 있었습니다. 이런 '고치기 힘든 악성 쿼리'의 실행 자체를 회피하는 목적으로 Redis 캐싱을 적극적으로 사용하는 전략에 대해 궁금합니다. 실무에서는 이런 경우: 1. 쿼리 결과 데이터가 어느 정도 크기(예: 수십 MB)까지 Redis에 캐싱을 허용하시나요? 데이터가 너무 크면 오히려 Redis에 부담이 될 것 같아서요. 2. 만약 결과가 너무 크다면, 페이징 처리된 일부만 캐싱하시나요? 아니면 보고서처럼 핵심 요약 데이터만 따로 캐싱하는 전략을 사용하시나요? 3. 특히 이런 복잡한 집계/통계 쿼리는 데이터 변경이 잦지 않은데, 이런 경우 TTL은 보통 어느 정도로 설정하시는지 강사님의 경험이 궁금합니다.
안녕하세요 강사님 수업 잘 듣고 있습니다. 강의 범위에서 조금 벗어난 것 같긴 하지만.. 레디스 서버 구성에 대해 궁금한 점이 있어서 질문 드립니다. 강의에서는 여러 대의 웹서버에서 레디스 서버 한 대로 요청을 보내는 구성에 대해서 설명하시는데, 레디스 서버는 이중화/다중화를 고려하지 않는 건지 궁금해서요. 웹서버가 수십 대로 구성되어 있더라도 레디스 서버는 보통 한 대로 운영하는 것인지 궁금합니다.
안녕하세요. redis에 대해 궁금한점이 있어서 문의드립니다! redis는 고객사에서 사용 허락을 받지 않는 한 사용하면 안 되나요? 추가로 비용이 들까요? 선배님이 비용이 든다고 하더라고요 저는 중복 로그인이나 조회수 관련해서 사용을 해보려고 했었는데요. 그냥 기존 방식대로 사용하라고 하시더라고요. 이런 고민 없이 개발을 해오다보니 문득 궁금해서 여쭤봤습니다!
간단한 영화 목록 조회입니다. 총 약 10000개의 데이터가 있습니다. redis를 적용하고 조회성능이 좋아진것은 맞지만 이상하게 redis를 적용하기 전에도 같은 조회를 계속해도 조회속도가 똑같이 빨라지는 현상을 겪고있습니다. 현재 이 movie는 MSA 의 여러 서비스 중 하나입니다. 혹시 MSA 아키텍쳐 자체가 문제가 될 수도 있나요? @Cacheable(cacheNames = "getMovies", key = "'movie:all'", cacheManager = "movieCacheManager") public List<Movie> getAllMovies() { return movieRepository.findAll(); } @GetMapping("/movies") public ResponseEntity<List<MovieDto>> getAllMovies() { List<Movie> allMovies = movieService.getAllMovies(); List<MovieDto> dtos = new ArrayList<>(); for (Movie movie : allMovies) { dtos.add(new ModelMapper().map(movie, MovieDto.class)); } return ResponseEntity.status(HttpStatus.OK).body(dtos); } @Configuration @EnableCaching // Spring Boot의 캐싱 설정을 활성화 public class RedisCacheConfig { @Bean public CacheManager movieCacheManager(RedisConnectionFactory redisConnectionFactory) { RedisCacheConfiguration redisCacheConfiguration = RedisCacheConfiguration .defaultCacheConfig() // Redis에 Key를 저장할 때 String으로 직렬화(변환)해서 저장 .serializeKeysWith( RedisSerializationContext.SerializationPair.fromSerializer( new StringRedisSerializer())) // Redis에 Value를 저장할 때 Json으로 직렬화(변환)해서 저장 .serializeValuesWith( RedisSerializationContext.SerializationPair.fromSerializer( new GenericJackson2JsonRedisSerializer() ) ) // 데이터의 만료기간(TTL) 설정(1분) .entryTtl(Duration.ofMinutes(1L)); return RedisCacheManager .RedisCacheManagerBuilder .fromConnectionFactory(redisConnectionFactory) .cacheDefaults(redisCacheConfiguration) .build(); } } @Configuration public class RedisConfig { @Value("${spring.data.redis.host}") private String host; @Value("${spring.data.redis.port}") private int port; @Bean public LettuceConnectionFactory redisConnectionFactory() { return new LettuceConnectionFactory(new RedisStandaloneConfiguration(host, port)); } }
안녕하세요. 토큰 관련해서 레디스에 저장하는 게 리프레시 토큰이라고 하셨는데요. 액세스 토큰을 저장 안 하는 건지 궁금합니다. 리프레시 토큰은 액세스 토큰이 만료될 떄 필요하니까 상대적으로 사용 빈도가 낮고 매 요청 시에는 액세스 토큰이 쓰이는 걸로 알고 있어서요. 그렇다면 수시로 검증해야 하는 토큰은 액세스 토큰이 아닐까 해서요. 감사합니다.
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:50) ~[spring-boot-devtools-3.5.3.jar:3.5.3] Caused by: org.springframework.data.redis.listener.adapter.RedisListenerExecutionFailedException: org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis at org.springframework.data.redis.listener.RedisMessageListenerContainer.lazyListen(RedisMessageListenerContainer.java:383) ~[spring-data-redis-3.5.1.jar:3.5.1] at org.springframework.data.redis.listener.RedisMessageListenerContainer.start(RedisMessageListenerContainer.java:361) ~[spring-data-redis-3.5.1.jar:3.5.1] at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:405) ~[spring-context-6.2.8.jar:6.2.8] ... 19 common frames omitted Caused by: org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.translateException(LettuceConnectionFactory.java:1858) ~[spring-data-redis-3.5.1.jar:3.5.1] at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.getConnection(LettuceConnectionFactory.java:1789) ~[spring-data-redis-3.5.1.jar:3.5.1] at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceC Redis 에러 (백엔드 에러는 이렇게 뜨고) 프론트 엔드 (로그인 하고 들어가는 거 잘됩니다. 채팅만 치면 저렇게 뜹니다.) EC2에서 redis 접속은 잘 됩니다. 프론트는 S3+cloudfront (도메인 적용 안함) 백엔드는 Redis(Elastic) + EC2+RDS +nginx 로 배포했고 몇시간 쨰 하는데 저 에러가 뜹니다. 혹시 프론트 배포가 잘 못 된건가요? 강사님 도와주세여ㅠㅠㅠ
Caused by: org.springframework.data.redis.listener.adapter.RedisListenerExecutionFailedException: org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis at org.springframework.data.redis.listener.RedisMessageListenerContainer.lazyListen(RedisMessageListenerContainer.java:383) ~[spring-data-redis-3.5.1.jar:3.5.1] at org.springframework.data.redis.listener.RedisMessageListenerContainer.start(RedisMessageListenerContainer.java:361) ~[spring-data-redis-3.5.1.jar:3.5.1] at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:405) ~[spring-context-6.2.8.jar:6.2.8] ... 19 common frames omitted Caused by: org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.translateException(LettuceConnectionFactory.java:1858) ~[spring-data-redis-3.5.1.jar:3.5.1] at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.getConnection(LettuceConnectionFactory.java:1789) ~[spring-data-redis-3.5.1.jar:3.5.1] at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:1586) ~[spring-data-redis-3.5.1.jar:3.5.1] at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.lambda$getConnection$0(LettuceConnectionFactory.java:1566) ~[spring-data-redis-3.5.1.jar:3.5.1] at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.doInLock(LettuceConnectionFactory.java:1527) ~[spring-data-redis-3.5.1.jar:3.5.1] 위에꺼는 백엔드 서버 에러이고 밑에는 프론트엔드 서버 에러입니다. 안녕하세요 강사님 채팅 서버와 프론트를 배포를 해서 Elastic Cache를 이용을 하고 있는데 EC2 랑 연결이 잘 되어 있으면서도 이런 에러가 뜹니다. 아무리 찾아봐도 더 해결사항이 보이지 않아 질문드립니다.