aosdev's avatar

Redis going down after 1 hour Laravel Sail

Hello,

I have a job queue around 6000 requests to a service. After i started this queue redis going down after 1 hour, when i checked docker ui i see redis exited , is there any limitation? After i start redis from docker ui, the queue going continue.

Here are my docker redis logs;

2023-07-26 17:00:24 1:C 26 Jul 2023 14:00:24.932 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
2023-07-26 17:00:24 1:C 26 Jul 2023 14:00:24.933 # Redis version=7.0.11, bits=64, commit=00000000, modified=0, pid=1, just started
2023-07-26 17:00:24 1:C 26 Jul 2023 14:00:24.933 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
2023-07-26 17:00:24 1:M 26 Jul 2023 14:00:24.934 * monotonic clock: POSIX clock_gettime
2023-07-26 17:00:24 1:M 26 Jul 2023 14:00:24.936 * Running mode=standalone, port=6379.
2023-07-26 17:00:24 1:M 26 Jul 2023 14:00:24.936 # Server initialized
2023-07-26 17:00:24 1:M 26 Jul 2023 14:00:24.942 * Ready to accept connections
2023-07-26 17:04:29 1:M 26 Jul 2023 14:04:29.589 * 10000 changes in 60 seconds. Saving...
2023-07-26 17:04:29 1:M 26 Jul 2023 14:04:29.599 * Background saving started by pid 64
2023-07-26 17:04:30 64:C 26 Jul 2023 14:04:30.929 * DB saved on disk
2023-07-26 17:04:30 64:C 26 Jul 2023 14:04:30.930 * Fork CoW for RDB: current 15 MB, peak 15 MB, average 8 MB
2023-07-26 17:04:30 1:M 26 Jul 2023 14:04:30.940 * Background saving terminated with success
2023-07-26 17:07:30 1:M 26 Jul 2023 14:07:30.988 * 10000 changes in 60 seconds. Saving...
2023-07-26 17:07:31 1:M 26 Jul 2023 14:07:31.004 * Background saving started by pid 100
2023-07-26 17:07:33 100:C 26 Jul 2023 14:07:33.809 * DB saved on disk
2023-07-26 17:07:33 100:C 26 Jul 2023 14:07:33.811 * Fork CoW for RDB: current 17 MB, peak 17 MB, average 9 MB
2023-07-26 17:07:33 1:M 26 Jul 2023 14:07:33.933 * Background saving terminated with success
2023-07-26 17:10:37 1:M 26 Jul 2023 14:10:37.660 * 10000 changes in 60 seconds. Saving...
2023-07-26 17:10:37 1:M 26 Jul 2023 14:10:37.693 * Background saving started by pid 138
2023-07-26 17:10:45 138:C 26 Jul 2023 14:10:45.670 * DB saved on disk
2023-07-26 17:10:45 138:C 26 Jul 2023 14:10:45.675 * Fork CoW for RDB: current 11 MB, peak 11 MB, average 6 MB
2023-07-26 17:10:45 1:M 26 Jul 2023 14:10:45.745 * Background saving terminated with success
2023-07-26 17:13:47 1:M 26 Jul 2023 14:13:47.767 * 10000 changes in 60 seconds. Saving...
2023-07-26 17:13:47 1:M 26 Jul 2023 14:13:47.811 * Background saving started by pid 176
2023-07-26 17:13:55 176:C 26 Jul 2023 14:13:55.849 * DB saved on disk
2023-07-26 17:13:55 176:C 26 Jul 2023 14:13:55.852 * Fork CoW for RDB: current 18 MB, peak 18 MB, average 17 MB
2023-07-26 17:13:55 1:M 26 Jul 2023 14:13:55.902 * Background saving terminated with success
2023-07-26 17:16:56 1:M 26 Jul 2023 14:16:56.271 * 10000 changes in 60 seconds. Saving...
2023-07-26 17:16:56 1:M 26 Jul 2023 14:16:56.315 * Background saving started by pid 213
2023-07-26 17:17:06 213:C 26 Jul 2023 14:17:06.435 * DB saved on disk
2023-07-26 17:17:06 213:C 26 Jul 2023 14:17:06.440 * Fork CoW for RDB: current 10 MB, peak 10 MB, average 7 MB
2023-07-26 17:17:06 1:M 26 Jul 2023 14:17:06.473 * Background saving terminated with success
2023-07-26 17:19:58 1:M 26 Jul 2023 14:19:58.238 * 10000 changes in 60 seconds. Saving...
2023-07-26 17:19:58 1:M 26 Jul 2023 14:19:58.289 * Background saving started by pid 256
2023-07-26 17:20:11 256:C 26 Jul 2023 14:20:11.908 * DB saved on disk
2023-07-26 17:20:11 256:C 26 Jul 2023 14:20:11.914 * Fork CoW for RDB: current 12 MB, peak 12 MB, average 8 MB
2023-07-26 17:20:12 1:M 26 Jul 2023 14:20:12.036 * Background saving terminated with success
2023-07-26 17:23:06 1:M 26 Jul 2023 14:23:06.596 * 10000 changes in 60 seconds. Saving...
2023-07-26 17:23:06 1:M 26 Jul 2023 14:23:06.647 * Background saving started by pid 291
2023-07-26 17:23:22 291:C 26 Jul 2023 14:23:22.851 * DB saved on disk
2023-07-26 17:23:22 291:C 26 Jul 2023 14:23:22.857 * Fork CoW for RDB: current 10 MB, peak 12 MB, average 10 MB
2023-07-26 17:23:22 1:M 26 Jul 2023 14:23:22.971 * Background saving terminated with success
2023-07-26 17:26:05 1:M 26 Jul 2023 14:26:05.704 * 10000 changes in 60 seconds. Saving...
2023-07-26 17:26:05 1:M 26 Jul 2023 14:26:05.773 * Background saving started by pid 328
2023-07-26 17:26:27 328:C 26 Jul 2023 14:26:27.864 * DB saved on disk
2023-07-26 17:26:27 328:C 26 Jul 2023 14:26:27.877 * Fork CoW for RDB: current 9 MB, peak 11 MB, average 8 MB
2023-07-26 17:26:27 1:M 26 Jul 2023 14:26:27.941 * Background saving terminated with success
2023-07-26 17:29:06 1:M 26 Jul 2023 14:29:06.018 * 10000 changes in 60 seconds. Saving...
2023-07-26 17:29:06 1:M 26 Jul 2023 14:29:06.105 * Background saving started by pid 364
2023-07-26 17:29:30 364:C 26 Jul 2023 14:29:30.681 * DB saved on disk
2023-07-26 17:29:30 364:C 26 Jul 2023 14:29:30.689 * Fork CoW for RDB: current 9 MB, peak 9 MB, average 9 MB
2023-07-26 17:29:30 1:M 26 Jul 2023 14:29:30.794 * Background saving terminated with success
2023-07-26 17:31:52 1:M 26 Jul 2023 14:31:52.938 * 10000 changes in 60 seconds. Saving...
2023-07-26 17:31:53 1:M 26 Jul 2023 14:31:53.017 * Background saving started by pid 393
2023-07-26 17:32:14 393:C 26 Jul 2023 14:32:14.749 * DB saved on disk
2023-07-26 17:32:14 393:C 26 Jul 2023 14:32:14.757 * Fork CoW for RDB: current 10 MB, peak 12 MB, average 11 MB
2023-07-26 17:32:14 1:M 26 Jul 2023 14:32:14.784 * Background saving terminated with success
0 likes
3 replies
frutality's avatar

Are you sure it is 1 hour and not amount of jobs? I mean, if you start Redis and do not queue any jobs. Just let it run for an hour. Will it exit?

If not, then dig into your jobs: maybe there are some memory leaks or something. If Redis still goes down, then check docker configs. How are you running it?

P.S. How do you see it is down? I'm looking at provided logs and can't see any quit or crash related message.

aosdev's avatar

I'm not sure exact time but i'm sure about time. Because i tried a couple times to start queue, sometimes down after 1500 and another time 2500. My job is pretty simple, just send an array data with 5 fields to service and get array response with 6 fields and save it to database via model (ORM). I see it on docker uri stops

I'm kinda new at Redis, so how can i check memory leaks or docker configs about it?

hupp's avatar

@aosdev Check with Following points.

  1. Expiration of Redis Data: By default, Redis may have a configuration to evict keys that have been idle for a certain period. This could cause data to be removed after some time. Check the Redis configuration to see if there are any eviction policies or TTL (Time to Live) settings that might be affecting the data.

  2. Memory Limits: If Redis is running out of memory, it may automatically shut down. Inspect the Redis logs and monitor the memory usage of the Redis container to ensure it is not hitting any memory limits. You can adjust the memory limits in the Redis configuration if necessary.

  3. Docker Container Timeouts: Docker containers, including the Laravel Sail containers, may have a default timeout after which they are automatically stopped. This could cause Redis to go down. Check the Docker settings or compose file to see if there is a timeout set for the Redis container.

  4. Server Load: If the server where Redis is running becomes heavily loaded, it might cause Redis to crash or shut down. Check the overall server load and resource utilization to ensure there are no issues.

  5. External Interference: Sometimes, external factors can cause the Redis container to stop. It could be related to server infrastructure, network issues, or other external services interfering with Redis.

To troubleshoot the problem, follow these steps:

  • Review Redis logs for any error messages or clues about the shutdown.
  • Check Docker logs and resource usage for the Redis container.
  • Inspect your Laravel Sail configuration, including the Redis configuration.
  • Verify server resources and performance during the one-hour period.
  • Monitor the Redis container for any signs of memory issues or eviction patterns.

let me know your feedback once verify above things.

Please or to participate in this conversation.