Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis's huge files won't delete?

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)

  • When Redis-server.exe is up , I see 3 large files :

    enter image description here

  • When Redis-server.exe is down , I see 2 large files :

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?

like image 449
Royi Namir Avatar asked May 14 '14 18:05

Royi Namir


4 Answers

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. "

like image 157
Deepak Avatar answered Nov 03 '22 17:11

Deepak


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.

like image 8
fabrosell Avatar answered Nov 03 '22 17:11

fabrosell


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.

like image 2
Ryan Rentfro Avatar answered Nov 03 '22 15:11

Ryan Rentfro


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.

like image 1
The Real Bill Avatar answered Nov 03 '22 15:11

The Real Bill