First, I understand your frustration, but please consider less harsh
words (using a bunch of exclamation marks isn't the best solution to
make your point clear).
Makes it much easier for people to be willing to discuss this
with you and work on a solution.
I'll try to answer your questions to the best of my knowledge.
1. Is there a solution to your problem?
Not that I know of. As stated before the current system is not able to
do that.
2. Why have replication at all then?
The meaning of the replication is
1) to have one or more slave instances that can be used to distribute the workload (reads can go to the slaves)
2) to be able to quickly promote a new master instance in case the first
master becomes unreachable (crashes, network issues, whatever)
3. The actual "even worse" situation
Yes, if a RDB is present, Redis will first try to load that.
Simply discarding all that data might not be a good idea in all cases.
Of course in your case, where _you_ know that it would be fine,
discarding would speed things up. Redis can't know that.
(Workaround would be to just move the RDB out of the way yourself)
What if the slave can't reach the master? The data would have been
deleted already. Not a good thing either.
"it transfers this big 64G memory dump to Node A"
Yip, true as well. How should Redis know about consistent data? It
can't know what changed on the master already.
Slaves are exact copies of the master. Re-sync shouldn't break this.
That's why it resyncs the whole data set.
PSYNC helps a little, but it needs to be improved to be usable after an
instance is restarted.
I hope this makes things more clear to you.
I'd be very happy if we can get the replication to work better
for scenarios like your's.
Kind regards,
Jan-Erik
P.S.:
about the memory fragmentation situation: That's due to how the
underlying malloc implementation works. The malloc implementation will
re-use free'd pages of memory, but it can't easily hand back all
allocated memory to the kernel.
The only thing to really return ALL the allocated pages back to the OS
is to exit your application. If you consider your peak memory usage
before you can avoid this. You should also look at the `maxmemory`
setting to avoid Redis eating all your RAM.
On Fri, Aug 22, 2014 at 11:26:25AM -0700, 张新峰 wrote:
> After reviewed Redis source code. Looks like things are even worth.
> In step 3, Node A will first load 64G rdb files from disk, then full
> sync to master. The first step to sync with master is just clear the data
> it just loaded and most part of the data is still useful(!!!!). And Node B
> then will dump its memory ( Why on earth do Redis community think memory
> dump is a good idea and do it all the times? We are very serious users and
> one minute of down time may relate to millions of dollars, dump of memory??
> Are you kidding me??) And then Node B will transfer this big 64G memory
> dump to Node A. (Are you kidding me again?? Even with Gigabyte bandwidth
> network, this may take about 1 minute to transfer and this may consume all
> the network bandwidth and brought the whole site down!!! And the foolish
> thing is that we just loaded most of the data!!!!)
>
> Then why on earth did Redis support replication??? Make thing worse when
> something wrong happened? Especially considering I saw somebody complaining
> that Redis has some memory fragement issue and looks like the suggestion
> from Redis community is just "restart service". (This must be kidding for
> the third time).
>
>
> Forgive me because we are just experimenting Redis and I may
> misunderstand something so some words may look very unpleasant. But we
> really hope there's solution to this very very common problem, so that we
> can use Redis happily ever after.
>
>
> On Saturday, August 23, 2014 1:44:52 AM UTC+8, janerik wrote:
> >
> > an email to
redis-db+u...@googlegroups.com <javascript:>.
> > <javascript:>.