Closed kishendas closed 12 years ago
You need to install libevent. Please refer to the README for instructions.
Do I also have to install hiredis ? I am getting the below error now. I have libevent installed.
$ make cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o webdis.o webdis.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o cmd.o cmd.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o worker.o worker.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o slog.o slog.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o server.o server.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o libb64/cencode.o libb64/cencode.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o acl.o acl.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o md5/md5.o md5/md5.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o sha1/sha1.o sha1/sha1.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o http.o http.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o client.o client.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o websocket.o websocket.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o pool.o pool.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o conf.o conf.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o formats/json.o formats/json.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o formats/raw.o formats/raw.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o formats/common.o formats/common.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o formats/custom-type.o formats/custom-type.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o formats/bson.o formats/bson.c cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o hiredis/hiredis.o hiredis/hiredis.c hiredis/hiredis.c:827:31: error: second argument to 'va_arg' is of incomplete type 'void' va_arg(ap,void);
/usr/bin/../lib/clang/3.1/include/stdarg.h:35:50: note: expanded from macro 'va_arg'
#define va_arg(ap, type) __builtin_va_arg(ap, type)
^
1 error generated.
make: **\* [hiredis/hiredis.o] Error 1
No, hired is is bundled. This seems to be an issue when compiling with clang; I'll try to reproduce it.
I have updated hiredis, which should fix this issue. Could you please try out the latest master?
Looks good now. Thanks. Btw I am not able to connect to webdis, although the thread is up. Below is the list of commands that I tried - ( Sorry if I am doing something very basic wrong ) $ ./webdis & [2] 31597 $ curl http://127.0.0.1:31597/SET/hello/world curl: (7) couldn't connect to host [2]+ Done ./webdis $ curl http://127.0.0.1:7379/SET/hello/world $
What you wrote seems wrong; you started webdis and that created a process with PID 31597 and you tried to connect to TCP port 31597. I assume you then killed webdis (seeing as it shows Done ./webdis), and then tried to connect to the right port, 7379.
Run it, and connect to port 7379. You can use curl -v
to get more details.
Right, initially I gave the process id by mistake for the port, but corrected it later. So, this command seems to be killing the webdis process -> $ curl http://127.0.0.1:31597/SET/hello/world . Anyway with -v options its giving Http 503 ( Service unavailable) -
$ curl -v http://127.0.0.1:7379/SET/hello/world
GET /SET/hello/world HTTP/1.1 User-Agent: curl/7.21.4 libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 Host: 127.0.0.1:7379 Accept: /
< HTTP/1.1 503 Service Unavailable < Server: Webdis < Allow: GET,POST,PUT,OPTIONS < Access-Control-Allow-Origin: * < Connection: Keep-Alive < Content-Length: 0 <
Is redis running? I tried with redis running and it returned {"SET":[true,"OK"]}
. 503 Service Unavailable
means that webdis couldn't connect to redis.
Redis was running. I killed both redis and webdis processes and started them again. It looks good now. Btw does webdis persists the number of client connections to redis ? Are there any documents/examples or I would have to look at the code to learn more about Webdis. My requirement is to support web-analytics for about 500 million concurrent users. Thanks for all the help.
Great!
I'm glad to know it's working now. I'm not sure exactly what you mean, but webdis maintains persistent connections to redis, although it doesn't record the number of connections that have been made to itself.
For further references you can look at the code, or ask me here on GitHub or by email, no preference. I'd be interested to see how far you can scale redis and webdis.
$ make cc -c -O3 -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o webdis.o webdis.c In file included from webdis.c:1: ./server.h:4:10: fatal error: 'event.h' file not found
include
1 error generated. make: *\ [webdis.o] Error 1