From: "Jesús Gabriel y Galán" Date: 2012-07-12T15:34:32+09:00 Subject: Re: the best way to match these domains. On Wed, Jul 11, 2012 at 6:18 PM, Eliezer Croitoru wrote: > i indeed looked at it. > it seems to fit my cache needs but not the filtering. > it really simplified many things for me with the "expire"(setex) method. > i need to store maximum of 3-6 minutes the key and the url so it fit's like > hell to me. Glad to hear that. > for a more robust lookups i need DB and i can cache the results in redis > because it's a one way ticket per domain for a long time. > i can add a domain result for half a day and it will do a really good work. > > my main problem is that i am using forks and redis ruby library dont like > it. > and also my eventmachine server has a "clenup" nasty method that releases > any old object when ending session so i do have a problem with it. > > if you have an idea on how to handle REDIS with forks i will be so happy. I have no experience with the redis ruby library (I've only used it in Java), but I guess the problem is that the library keeps a connection open, and when you fork, reusing this connection across processes is a problem. I don't know how this can be solved. If you are using this one https://github.com/redis/redis-rb, it says to seek for help here: "You can also ask for help at #redis-rb on Freenode." Maybe you could try to open the connection in each process individually after the fork. Jesus. Jesus.