func main() { rp = utee.CreateRedisPool(30, "106.75.27.144:6379", "baulk3?speed") con, err := mgo.Dial("mpush:[email protected]/mpush?maxPoolSize=50") utee.Chk(err) se = &MgoSe{ referSession: con, } knameA := "figo_test" initSeq(knameA) nextSeq(knameA) initSeq(knameA) nextSeq(knameA) initSeq(knameA) nextSeq(knameA) nextSeq(knameA) nextSeq(knameA) knameB := "figo_testB" initSeq(knameB) nextSeq(knameB) initSeq(knameB) nextSeq(knameB) initSeq(knameB) nextSeq(knameB) nextSeq(knameB) nextSeq(knameB) nextSeq(knameB) }
func main() { rp = utee.CreateRedisPool(30, "106.75.27.144:6379", "baulk3?speed") addr := flag.String("p", ":6666", "address where the server listen on") flag.Parse() log.Printf("start server http 1 on %s \n", *addr) guards := NewHealthGuards(*addr) for _, v := range guards.m { healthApi := v.(*HealthApi) if v.key == guards.keyMe { continue } uri := fmt.Sprint(healthApi.api, "/cache/clear/:id") utee.HttpPost(uri, &url.Values{}) } http.HandleFunc("/api/health", guards.healthCheckHandler) log.Fatal(http.ListenAndServe(*addr, nil)) }
func main() { rp = utee.CreateRedisPool(30, "127.0.0.1:6379", "") v := 1 for i := 0; i < 32; i++ { v *= 2 } c := rp.Get() defer c.Close() // c.Do("set" ,"figo","xu") log.Println(v) for i := 0; i < v; i++ { if i%100000 == 0 { c.Flush() log.Println(i) } c.Send("SETBIT", "BIT", i, 1) } c.Flush() log.Println("over") }