I've just checked the source code for redis-py, but it seems to
properly close the socket when disconnect() is called. When this
happens, the socket is also closed from the side of redis-server. Are
you sure all the connections are properly closed from the Python side
of things?
Cheers,
Pieter
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
>
>
Simon Willison
<si...@simonwillison.net>
| Simon Willison <si...@simonwillison.net>
Please respond to : redi...@googlegroups.com Sent by: redi...@googlegroups.com
|
that's ok, it's a matter of TCP guarantees: probably you are not
reusing connections but opening a new one every time, that is
perfectly fine.
If you are doing this so fast that you are risking using all the
available ports, you should use this:
'echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse' for Linux
and 'sudo sysctl -w net.inet.tcp.msl=1000' for Mac OS X
Cheers,
Salvatore
On Mon, Sep 6, 2010 at 12:55 PM, Simon Willison <si...@simonwillison.net> wrote:
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
>
>
--
Salvatore 'antirez' Sanfilippo
http://invece.org
"We are what we repeatedly do. Excellence, therefore, is not an act,
but a habit." -- Aristotele
You might want to set tcp_tw_recycle to 1 also. We have similar issues in our environment and spent some time tuning things. You can also check out www.speedguide.net/read_articles.php?id=121 for more info.
Yes, adding this to my TODO list.
Some guy in the list with some good suggestion? I can only thing to
the following things:
1) networking tuning, like reusing connections, max number of FDs and so forth
2) filesystem. What's the best filesystem to, for instance, have good
fsync() performances? I think ext4, but different mount options will
change the outcome. Help appreciated about this.
3) copy-on-write: the overcommit policy should be set to 1
4) when using VM and persistence (rdb or AOF) it's a good idea to use
two disks if possible, one for the swap file, one for persistence.
Please help me elaborating this collectively here! So I can write a wiki page :)
Cheers,
Salvatore