预制redis数据
Posted ivon168
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了预制redis数据相关的知识,希望对你有一定的参考价值。
dir = "D://05性能测试//para//"
file_name = "redis_data_script"
fo = open(dir + file_name, "a",encoding=‘utf-8‘)
start_time = datetime.now()
for i in range(1000000,5000000):
fo.write("*4" + "
" + "$5" + "
" + "setex" + "
" + "$46" + "
" + "LOGIN_SERVICE_2cb1ba580bef4577ac0ed91aa" + str(i) + "
" + "$5" + "
" + "86400" + "
" + "$80" + "
" + "{"endPoint":"Applet","companyId":523144769413586666,"userId":530854902100926666}" + "
")
fo.close()
end_time = datetime.now()
print(("总运行耗时: {}".format((end_time - start_time).seconds)))
以上是关于预制redis数据的主要内容,如果未能解决你的问题,请参考以下文章
普洛斯探索新型算力基础设施“智”冷之道,发布制冷系统预制集成技术白皮书