#!/usr/bin/env python
#-*- coding:utf-8 -*-
import redis
import threading
import multiprocessing
rs = redis.Redis(host='192.168.4.70', port=19000, db=0)
def insert_to_redis(n):
for i in range(100000):
name = 'xxxxxxxxyzabcdefg1gxx' + str(n) + str(i)
rs.set(name, 'asdfwetrfetgsdfgdfhgyrdthfdhfdhnfdghfdhrdtyhtwertwertewrtgesrgdsfgsdfgdsfg')
threading_list = []
for i in range(30):
p = multiprocessing.Process(target=insert_to_redis,args=(i,))
p.start()
threading_list.append(p)
for i in threading_list:
i.join()
#-*- coding:utf-8 -*-
import redis
import threading
import multiprocessing
rs = redis.Redis(host='192.168.4.70', port=19000, db=0)
def insert_to_redis(n):
for i in range(100000):
name = 'xxxxxxxxyzabcdefg1gxx' + str(n) + str(i)
rs.set(name, 'asdfwetrfetgsdfgdfhgyrdthfdhfdhnfdghfdhrdtyhtwertwertewrtgesrgdsfgsdfgdsfg')
threading_list = []
for i in range(30):
p = multiprocessing.Process(target=insert_to_redis,args=(i,))
p.start()
threading_list.append(p)
for i in threading_list:
i.join()