godown
godown copied to clipboard
func (c *Client) RPush(key, value string, values ...string) StatusResult
I seem to have found a new problem. In my application scenario, I need to use the rpush command to send 9000000 data entries. I started three instances to form a cluster, but in the end I found that the data in the list became 27000000 after the program was completed.
Here is my test code
package main
import (
"fmt"
"github.com/namreg/godown/client"
"time"
)
const data = `
ow9sif3W+Of+dqe2xoII1QJ2OoZFS5zjz4NtdQ49BhPOUdSlQtHVfStNlyLBxD7kxU/BV9h6PjDen2VSIbbV69jEAamcQtT4r8MTtghMC+9H/dgfNUQJQmtvHkJPqHTho1rBSRFseOpmhR9SW2CJL+0tfKGK6hziwTlbdi40qUDy905zbteLCxf2RiNDLkmwQTx+KfPVFvNPHzDOBrgvA52ZgivGlIur6r2djaAqp0XbLQN+3pw5bR1AtB/GL9x56MU+BVDg/IOQH15klpmR+EEsABF3vNo6FBL7i+JDu6ri9z9jEjMxL+UZ/lFvTkzQSiyNsigps8GnDtjuyq2ZWmdh02HMgCfNZyz9BvVZlU9PE4SgFPBtW49V080iX5t8/qlppMcRRBmOiShjmo54uTT4r+48fKMu3qX2p6F9n4jxMBbQxUDPzCq7xmNS5g4f7sH7XLTKc/W7XI2V4TNYXXxqH0YATMjz7Jyo3fOkQtUN50WPBW5fNj8soW+52q4gQqdfJcEa34HiAEo3axX5Q5LO0giLdBF/zNiM0K0leQEfgEjoGviD9s1+t214FyoKnHBQgrrFf2HxGZnuMfiDVTtUEG5UqN+dRL5VD0ZTMzY/YEJ1Fn1NIy1R7vBfhKfZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA=
`
func main() {
c, err := client.New("10.2.1.246:14001")
if err != nil {
fmt.Println(err)
return
}
start := time.Now()
for i := 0; i < 90; i ++ {
x := make([]string, 999)
for j := 0; j < 999; j++ {
x[j] = data
}
c.RPush("t13", data, x...)
}
fmt.Println(time.Since(start))
}
The amount of data has tripled, which is equivalent to the amount of data multiplied by the number of clusters.
@namreg :(