Open ashkank83 opened 5 years ago
One day I would like to support Windows but it won’t be for a very long time. We rely heavily on the fork() system call which is not available on Windows and refactoring that out is a very large amount of work. There are no ports running on Windows that I know of.
The best way to work around this if you are primarily a windows shop is to run Linux+KeyDB in a HyperV VM. We also have an AMI coming soon for AWS with everything preconfigured.
@ashkank83 FYI, I usually install WSL on Windows and run stuff such as Redis this way. And also, Docker container is available on Windows
Progress is actually being made here. I’ve got initial support for forkless background saving working which is the primary blocker. There is still a lot of work to bring up Windows so I don’t want to promise any sort of timeline, but I will reopen this bug to track it.
Just want to provide a bit of a resistance to this: please don't allow any of the changes necessary to make Windows work negatively impact the codebase as-is. I feel like Windows servers for very inherently linux-oriented things are an antipattern and with WSL becoming mainstream and supported by Microsoft ports like these shouldn't be necessary anymore.
If it's going to make the code more complicated or incur even a single additional clock cycle of latency on the Linux side then it's not worth it IMO.
Hi @Qix-,
Forkless background saving is really about Linux performance first and foremost. The issue with using fork() for snapshotting is write amplification, if you modify even one byte on a page all 4K needs to be duplicated.
The other issue is that fork() time is related to the total dataset size. In contrast forkless background save has the same cost if your key is 1 byte or 500MB. This will become important as value sizes increase.
Forkless background save will be both faster and use less memory. So its a huge win for Linux.
It took me only a few minutes to get KeyDB built and running with cygwin. I haven't tested much, but starting the server & setting a few values over telnet worked a lot more smoothly that I thought it was going to.
Had to do something really sketchy with SO_REUSEPORT
, not quite sure what æffect deleting anetSetReusePort
will have.
SO_REUSEPORT use to be mandatory for multi-threading to work at all. In more recent builds if you remove this flag then we will only accept new connections on the main thread but should still be able to distribute them across threads.
SO_REUSEPORT and SO_REUSEADDR is supported on Windows as well. Here is the screenshot on Windows:
I was able to listen same port from multiple threads.
Looking forward to see Windows support of KeyDB in the future 👍
I'm trying to install keydb in WSL (Ubuntu 20.04) and I got this error when it reached the keydb-server step: "System has not been booted with systemd as init system (PID 1). Can't operate." I know WSL doesn't support systemd and has its own way of running a service. I'm also aware of hacks that can sort of make systemd availble, but they seem to have their own drawbacks. My question is, is that the way to go just to get keydb installed? Or am I missing something?
Hi Team,
I am also trying to install key-db using WSL on windows server, but i get the following error (same as @wanstr but i don't get through the installation)
$ echo "deb https://download.keydb.dev/open-source-dist $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/keydb.list $ sudo wget -O /etc/apt/trusted.gpg.d/keydb.gpg https://download.keydb.dev/open-source-dist/keyring.gpg $ sudo apt update $ sudo apt install keydb
@Kailash-Ramco If you really want to use it with WSL now, you can do it with genie. That's not a perfect solution though, hence my original question.
If anyone needs KeyDB to run on windows for development purposes, consider using a Docker container that auto starts in the background.
@aria-golliver Could you share your cygwin setup? I'm also trying to compile it, and having some issues I believe with malloc
In file included from ae.cpp:105:
ae_select.c: In function ‘int aeApiCreate(aeEventLoop*)’:
ae_select.c:43:32: error: invalid conversion from ‘void*’ to ‘aeApiState*’ [-fpermissive]
43 | aeApiState *state = zmalloc(sizeof(aeApiState), MALLOC_LOCAL);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| void*
ae_select.c: In function ‘int aeApiResize(aeEventLoop*, int)’:
ae_select.c:52:37: warning: unused parameter ‘eventLoop’ [-Wunused-parameter]
52 | static int aeApiResize(aeEventLoop *eventLoop, int setsize) {
| ~~~~~~~~~~~~~^~~~~~~~~
ae_select.c: In function ‘int aeApiAddEvent(aeEventLoop*, int, int)’:
ae_select.c:63:36: error: invalid conversion from ‘void*’ to ‘aeApiState*’ [-fpermissive]
63 | aeApiState *state = eventLoop->apidata;
| ~~~~~~~~~~~^~~~~~~
| |
| void*
ae_select.c: In function ‘void aeApiDelEvent(aeEventLoop*, int, int)’:
ae_select.c:71:36: error: invalid conversion from ‘void*’ to ‘aeApiState*’ [-fpermissive]
71 | aeApiState *state = eventLoop->apidata;
| ~~~~~~~~~~~^~~~~~~
| |
| void*
ae_select.c: In function ‘int aeApiPoll(aeEventLoop*, timeval*)’:
ae_select.c:78:36: error: invalid conversion from ‘void*’ to ‘aeApiState*’ [-fpermissive]
78 | aeApiState *state = eventLoop->apidata;
| ~~~~~~~~~~~^~~~~~~
| |
| void*
ae_select.c: In function ‘char* aeApiName()’:
ae_select.c:105:12: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
105 | return "select";
| ^~~~~~~~
Might be helpful: https://stackoverflow.com/a/76290679/21906181
any updates here ?
Hi, I know Redis cannot be deployed on Windows servers and I understand that KeyDB uses Redis, however just wondering if MS windows compatible builds are in the roadmap for you guys at all? Or are there any ports of keydb currently available for running on windows servers? Thx