Redis's huge files won't delete?

13,222

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.

Share:
13,222

Related videos on Youtube

Royi Namir
Author by

Royi Namir

Updated on June 06, 2022

Comments

  • Royi Namir
    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 :

    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?

  • The Real Bill
    The Real Bill almost 10 years
    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.
  • Royi Namir
    Royi Namir almost 10 years
    I already mention in my question that those files are regenerated each time
  • coding_idiot
    coding_idiot about 9 years
    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.
  • Wirone
    Wirone about 7 years
    In latest stable version config param is named maxmemory.
  • Igor Kurkov
    Igor Kurkov almost 2 years
    The best answer. Thank you. I'm used Treesize free, and found it, but need to delete it every month. now it's solved.