Redis's huge files won't delete?
Solution 1
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. "
Solution 2
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.
Solution 3
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.
Solution 4
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.
Related videos on Youtube
Royi Namir
Updated on June 06, 2022Comments
-
Royi Namir almost 2 years
I'm using Redis-server for windows ( 2.8.4 - MSOpenTech) / windows 8 64bit.
It is working great , but even after I run :
I see this : (and here are my questions)
-
When
Redis-server.exe
is up , I see 3 large files : -
When
Redis-server.exe
is down , I see 2 large files :
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?
-
EfrainReyes over 7 yearsIf you never want your local redis to write to disk, you can follow the steps on this answer: stackoverflow.com/a/34736871/2563028
-
-
The Real Bill almost 10 yearsThe 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.
-
Royi Namir almost 10 yearsI already mention in my question that those files are regenerated each time
-
coding_idiot about 9 yearsthese qfork.dat redis files occupied a total of 175GB with 16gb each.
flushdb
andflushall
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. -
Wirone about 7 yearsIn latest stable version config param is named
maxmemory
. -
Igor Kurkov almost 2 yearsThe best answer. Thank you. I'm used Treesize free, and found it, but need to delete it every month. now it's solved.