Timothy, Thanks for the suggestion. Creating a million keys within the same with-server is possible, without seeing the NoRouteToHostException. So, hitting with-server so many times in so short a time period is definitely a bad idea (duh).
So, I think there is a problem with how my larger program (not in the gist) is using the redis-clojure library. I'm still seeing intermitted problems with "Not able to read expected number or bytes" which might be related. I'll post here if it turns out that it's related. Also, thanks for the dotimes/doseq suggestion. I hadn't worried about it, since it was just a quick example. But, thanks for the tip. Regards, Kyle On Jan 13, 1:29 pm, Timothy Pratley <timothyprat...@gmail.com> wrote: > 2010/1/14 mudphone <kyle...@gmail.com>: > > > I believe it has to do with opening too many sockets on the Redis > > server, rather than the total number of members in the set. > > Sounds possible. It would be worthwhile seeing if > (redis/with-server REDIS-SPEC > (dotimes [i 100000] (redis/sadd "large-set" (random-value i)))) > works as expected (ie: using just one connection) to help isolate the problem. > > From looking > athttp://github.com/ragnard/redis-clojure/blob/master/src/redis/interna... > it appears that the sockets are cleaned up... so I'm thinking it is > actually more likely that the sockets are closed, but that you use > them all so fast that none are available before you request a new one > because their timeout has not expired. Sockets bind to a fixed remote > host port and a (usually) random local port. But the local ports > cannot be reused immediately (there is a timeout) unless the socket > specifically is set as reuse. If you ran out of sockets I would expect > an exception more like "no file descriptors". You could run netstat > when your program is half-way done to get a better picture. > > > Any suggestions appreciated. > > Consider using dotimes, or doseq instead of loop/recur > (doseq [i (range 10 0 -1)] (println i)) ;; if you want to count down > instead of up > > I'm not a Redis user yet so apologies if not helpful. > > Regards, > Tim.
-- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en