Redis's huge files won't delete?
Asked Answered
A

4

27

I'm using Redis-server for windows ( 2.8.4 - MSOpenTech) / windows 8 64bit.

It is working great , but even after I run :

enter image description here

I see this : (and here are my questions)

enter image description here

Question :

— Didn't I just tell it to erase all DB ? so why are those 2/3 huge files are still there ? How can I completely erase those files? ( without re-generating)

NB It seems that it is doing deletion of keys without freeing occupied space. if so , How can I free this unused space?

Abduct answered 14/5, 2014 at 18:16 Comment(1)
If you never want your local redis to write to disk, you can follow the steps on this answer: https://mcmap.net/q/67972/-how-to-disable-redis-rdb-and-aofBlume
D
25

From https://github.com/MSOpenTech/redis/issues/83 "Redis uses the fork() UNIX system API to create a point-in-time snapshot of the data store for storage to disk. This impacts several features on Redis: AOF/RDB backup, master-slave synchronization, and clustering. Windows does not have a fork-like API available, so we have had to simulate this behavior by placing the Redis heap in a memory mapped file that can be shared with a child(quasi-forked) process. By default we set the size of this file to be equal to the size of physical memory. In order to control the size of this file we have added a maxheap flag. See the Redis.Windows.conf file in msvs\setups\documentation (also included with the NuGet and Chocolatey distributions) for details on the usage of this flag. "

Drolet answered 14/5, 2014 at 19:17 Comment(2)
these qfork.dat redis files occupied a total of 175GB with 16gb each. flushdb and flushall didn't have an impact, so just stopped the service the deleted the files as any other file on windows. Thanks a lot for the insight.Again
In latest stable version config param is named maxmemory.Keppel
E
8

I know this is an old thread, but I am facing the same issues with the file sizes.

In case you have problems with your C ssd drive (like me), you can make a directory junction:

1) Stop redis service
2) Move C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Redis folder to another drive / location.
3) Open a command prompt in C:\Windows\ServiceProfiles\NetworkService\AppData\Local then execute:

mklink /J "C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Redis" "[newpath]"

PD: [newpath] must be absolute, like "D:\directory junctions\Redis"

4) Start redis service. Now the files are in another drive.

Check http://ss64.com/nt/mklink.html if doubts regarding this command.

Eikon answered 14/10, 2015 at 15:56 Comment(1)
The best answer. Thank you. I'm used Treesize free, and found it, but need to delete it every month. now it's solved.Tetrad
B
2

I faced this same issue on my development machine. It was resolved by stopping the redis service and I used WinDirStat (which is what I used to detect the issue originally) to permanently delete these files in appdata/local/redis.

I then started redis back up and things were working fine.

Before following this same procedure others may want to ensure that this data isn't needed. In my case it wasn't critical since this is my development workstation.

Basile answered 11/11, 2015 at 1:6 Comment(0)
A
1

When you flush the DB you only flush the keys from memory. I'm not sure why you've got files of different names, it may be an artifact of the way the Windows port of Redis manages files, but Redis itself doesn't delete files when you remove keys. You will need to manage outdated files outside of Redis.

Anaxagoras answered 14/5, 2014 at 18:52 Comment(2)
The same way you delete other files in Windows. If you are looking for a programmatic way to remove files from a Windows server, that is a fundamentally different question. Bear in mind that if the Windows port of Redis creates these at various times this will happen again. I would ask on the mailing list for that port for details as to how they manage creation of RDB files - especially what appear to be temporary ones.Anaxagoras
I already mention in my question that those files are regenerated each timeAbduct

© 2022 - 2024 — McMap. All rights reserved.