python多进程插入redis
来源:互联网 发布:917发卡源码 编辑:程序博客网 时间:2024/06/14 19:32
#!/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()
阅读全文
0 0
- python多进程插入redis
- Python redis 列表的取出,插入操作
- python多进程、多线程、协程向mysql插入10000条数据
- PYTHON 多进程
- Python多进程
- python多进程编程
- Python 多进程
- python多进程编程
- {python多进程}
- python中的多进程
- Python多进程编程
- Python 多进程交互
- Python 多进程实例
- python 多进程实例
- python fork()多进程
- python多进程处理
- python 多进程
- Python 多进程
- Codeforces Round #433 (Div. 2) D. Jury Meeting
- Linux下通过终端安装mysql
- swiper+图片自动+无限轮播
- 关于获取Gridcontrol中repositoryItemLookUpEdit的使用
- 选择排序
- python多进程插入redis
- python提示错误TypeError: write() argument must be str, not bytes
- ubuntu部署flask
- 机器学习-特征提取
- 基于Dragonboard410c的智能音箱(三)
- 解决combox在火狐下不支持中文检索问题
- angularjs过滤器
- eclise 部署web工程报 There are no resources that can be added or removed from the server.
- html中table表格内容水平垂直居中显示