|
QuickStart
We moved to Redis.io!Redis home moved to http://redis.io, please visit our new home. |
► Sign in to add a comment
|
Search
|
|
QuickStart
We moved to Redis.io!Redis home moved to http://redis.io, please visit our new home. |
i wrote a program like this, but sometimes it will report error, i use the phpredis(c edition). <?php $num = 100000; $action = "get"; $stime = microtime(true); for($i=0;$i<$num;$i++){ $redis = new Redis(); $redis->connect("127.0.0.1", 6379); //for($i=0;$i<$num;$i++){
} $etime = microtime(true); echo "spent " . ($etime - $stime) . "\n";?> Fatal error: Uncaught exception 'RedisException?' with message 'Can't connect to 127.0.0.1:6379' in /opt/websites/blog.intra.iqwer.com/htdocs/phpredis/test.php:7 Stack trace: #0 /opt/websites/blog.intra.iqwer.com/htdocs/phpredis/test.php(7): Redis->connect('127.0.0.1', 6379) #1 {main} thrown in /opt/websites/blog.intra.iqwer.com/htdocs/phpredis/test.php on line 7
i have a question, is the redis object persistent? or every connection needs a new redis object, for example, if i have 1000 concurrency / s, will 1000 redis object be allocated?
Hey guys, take a look at php-redis platform: http://code.google.com/p/php-redis/. It contains basic functionality needed for standard data development needs.
I've written up a detailed how-to for getting up and running on CentOS, in case anyone is looking for installation help: http://blog.rosania.org/installing-redis-on-centos-4
Thank you, Paul, this is awesome tutorial!
¡Hello! It might be nice to explain how to cleanly stop the redis server.
Simple installation guide for ubuntu jaunty via deb package http://pragmatig.wordpress.com/2010/02/22/installing-redis-server-on-ubuntu-jaunty/
It would be good to note that the redis server needs to be running for "make test" to work. Otherwise, you get a connection refused error.
Another php implementation at http://code.google.com/p/php5-redis/ Easy to extend and add the new commands as redis develops
You should change the line:
"In order to test if the Redis server is working well in your computer make sure to run make test and check that all the tests are passed."
to
"In order to test if the Redis server is working well in your computer make sure to run ./redis-server in one terminal window and then, in another, run make test and check that all the tests are passed."
I follow saikat1 suggestion but I still get this error:
dbmspare02:redis-2.0.2 root# make test tclsh8.5 tests/test_helper.tcl --tags "" /bin/sh: tclsh8.5: command not found make: test? Error 127
I still can run the redis server and work on the client.
Any ideas?
@yuridrawing Seems like you don't have tcl8.5
Try, under Ubuntu:
sudo apt-get install tcl8.5
then run the make test again.
HTH
Thanks for your response Nilo, I'm using Mac OS X Leopard.
To start redis server without a conf file and specifying configuration arguments from the command line use this echo -e "maxmemory 500M\npidfile /tmp/redis-test.pid\ndaemonize yes" | redis-server -
Note the -e on echo which translates the \n into new lines and the - at the end of redis-server which tells it to read the configuration from stdin.
This is nice trick!!! I knew it is possible to do so, but never try it.