Neo4j+py2neo性能测试(CMDB二)
2013-12-24 18:00
197 查看
性能测试:本地笔记本,CPU: i5, 内存: 8G, win7_x64, python 2.7, neo4j comunity 2.0.创建60000个CI, 耗时1分51秒, 平均1秒创建540个CI, 每个CI包含属性3-7个属性
In [11]: py2neo_initialzation.create_ci(10000)
10000X6CIs
Tue Dec 24 17:04:43 2013
Tue Dec 24 17:06:34 2013
创建50000个关联关系,耗时4分27秒,平均1秒创建187个relationship.
In [12]: py2neo_initialzation.create_relationship(10000)
Tue Dec 24 17:07:23 2013
Tue Dec 24 17:11:50 2013
测试代码:
本文出自 “运维螃蟹” 博客,请务必保留此出处http://leontam.blog.51cto.com/8150854/1344482
In [11]: py2neo_initialzation.create_ci(10000)
10000X6CIs
Tue Dec 24 17:04:43 2013
Tue Dec 24 17:06:34 2013
创建50000个关联关系,耗时4分27秒,平均1秒创建187个relationship.
In [12]: py2neo_initialzation.create_relationship(10000)
Tue Dec 24 17:07:23 2013
Tue Dec 24 17:11:50 2013
测试代码:
from py2neo import node,rel from py2neo import neo4j import time import datetime g=neo4j.GraphDatabaseService('http://localhost:7474/db/data') import cmdb.py2neo_function as neofunction # data initialize #storage def create_ci(total_ci): print '%dX6CIs' % total_ci print time.ctime() for i in range(total_ci): storage_name='storage_%d' % i small_server_name='aix_%d' % i lpar_name='lpar_%d' % i db_name='db_%d' % i was_name='was_%d' % i app_name='app_%d' % i g.create(node(ci_class='storage',city='Shanghai',district='PuDong',name=storage_name,rack=1,capacity=300), node(ci_class='small_server',city='Shanghai',district='PuDong',name=small_server_name,cpu_count=16,mem_GB=64), node(ci_class='lpar',city='Shanghai',district='PuDong',name=lpar_name,cpu_count=1,mem_GB=2), node(ci_class='db_instance',name=db_name,type='db2',version='9.1'), node(ci_class='was_node',name=was_name,version='6.1'), node(ci_class='application',name=app_name) ) print time.ctime() def create_relationship(total_ci): #get the nodes #get all storeage nodes print 'get all storage nodes, count number about %d' % total_ci print datetime.datetime.now() storage_list=neofunction.SearchNodes(g,'ci_class','storage') print datetime.datetime.now() #get all small_server nodes small_server_list=neofunction.SearchNodes(g,'ci_class','small_server') g.create((small_server_list[0],'depend_on',storage_list[0])) #get all lpar nodes lpar_list=neofunction.SearchNodes(g,'ci_class','small_server') #get all was nodes was_list=neofunction.SearchNodes(g,'ci_class','was_node') #get all db_instance nodes dbi_list=neofunction.SearchNodes(g,'ci_class','db_instance') #get all app nodes app_list=neofunction.SearchNodes(g,'ci_class','application') print time.ctime() for i in range(total_ci): g.create((lpar_list[i],'depend_on',small_server_list[i])) g.create((dbi_list[i],'running_on',lpar_list[i])) g.create((was_list[i],'running_on',lpar_list[i])) g.create((app_list[i],'depend_on',dbi_list[i])) g.create((app_list[i],'depend_on',was_list[i])) print time.ctime()
本文出自 “运维螃蟹” 博客,请务必保留此出处http://leontam.blog.51cto.com/8150854/1344482
相关文章推荐
- Neo4j+py2neo性能测试(CMDB二)
- (英)[性能测试]工具介绍
- javascript数组去重方法性能测试比较
- apache kafka性能测试命令使用和构建kafka-perf
- Emmagee性能测试简单的使用
- 使用fio测试磁盘I/O性能
- 翻页性能测试对比
- jmeter 性能测试 JDBC Request (查询数据库获取数据库数据) 的使用
- .Net Core内存回收模式及性能测试对比分析
- 高性能WEB开发 web性能测试工具推荐
- SQL Server 2005性能测试实践 - CPU篇(1) 编译与重编译
- Raid5 Raid10性能测试
- 转自虫师:性能测试的 Check List
- WebService性能测试
- 性能测试,负载测试,压力测试有什么区别
- 高性能WEB开发 - web性能测试工具推荐
- JavaScript字符串数组拼接的性能测试及优化方法
- 同步处理的ArrayList和Vector性能小测试(多线程写法)
- 性能测试Jmeter的使用
- 性能测试并发数的计算