延续上一个文章的做接下来的测试,环境是一个proxy和三个storage。

1、性能测试

测试一:五个线程,每个线程上传一个大小差不多一个G的文件

/data/swift/upload> du -sh test*.zip

987M test1.zip

987M test2.zip

987M test3.zip

987M test4.zip

987M test.zip


上传

swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container1 test.zip

swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container2 test1.zip

swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container3 test2.zip

swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container4 test3.zip

swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container5 test4.zip


共用时8:30:45


存储节点查看文件

/srv/node/sdb1> du -sh *

16K accounts

356M async_pending

129M containers

4.9G objects

0 tmp


查看上传的文件

/data/swift/upload> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container1

test.zip

/data/swift/upload> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container2

test1.zip

/data/swift/upload> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container3

test2.zip

/data/swift/upload> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container4

test3.zip

/data/swift/upload> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container5

test4.zip


测试二,十个线程:

/data/swift/upload/test100M> du -sh *

/data/swift/upload/test100M> du -sh *

505M test10.zip

505M test1.zip

505M test2.zip

505M test3.zip

505M test4.zip

505M test5.zip

505M test6.zip

505M test7.zip

505M test8.zip

505M test9.zip


单个线程测试上传2.6M/s,下载5.1M/s


五线程测试:

上传

第一个用时03:20s,2.5M/s

第二个用时04:30s,1.85M/s

第三个用时05:50s,1.31M/s

第四个用时06:55s,1.2M/s

第五个用时07:00s,1.19M/s


下载

第一个用时30.263s,17.461 MB/s

第二个用时49.415s,10.691 MB/s

第三个用时54.724s,9.653 MB/s

第四个用时86.473s,6.108 MB/s

第五个用时97.919s,5.417 MB/s


十线程测试:

/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container1 test1.zip

test1.zip


/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container2 test2.zip


Object PUT Failed: http://192.168.1.211:8090:8090/v1/AUTH_system/container2/test2.zip 404 Not Found [first 60 chars of response] <html><h1>Not Found</h1><p>The resource Could not be found.<


/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container3 test3.zip

test3.zip


/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container4 test4.zip

Object PUT Failed: http://192.168.1.211:8090:8090/v1/AUTH_system/container4/test4.zip 503 Internal Server Error [first 60 chars of response] <html><h1>Service Unavailable</h1><p>The server is currently


/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container5 test5.zip

Object PUT Failed: http://192.168.1.211:8090:8090/v1/AUTH_system/container5/test5.zip 404 Not Found [first 60 chars of response] <html><h1>Not Found</h1><p>The resource Could not be found.<


/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container6 test6.zip

Object PUT Failed: http://192.168.1.211:8090:8090/v1/AUTH_system/container6/test6.zip 404 Not Found [first 60 chars of response] <html><h1>Not Found</h1><p>The resource Could not be found.<



/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container7 test7.zip

Object PUT Failed: http://192.168.1.211:8090:8090/v1/AUTH_system/container7/test7.zip 404 Not Found [first 60 chars of response] <html><h1>Not Found</h1><p>The resource Could not be found.<


/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container8 test8.zip

Object PUT Failed: http://192.168.1.211:8090:8090/v1/AUTH_system/container8/test8.zip 404 Not Found [first 60 chars of response] <html><h1>Not Found</h1><p>The resource Could not be found.<


/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container9 test9.zip

Object PUT Failed: http://192.168.1.211:8090:8090/v1/AUTH_system/container9/test9.zip 404 Not Found [first 60 chars of response] <html><h1>Not Found</h1><p>The resource Could not be found.<


/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container10 test10.zip

Object PUT Failed: http://192.168.1.211:8090:8090/v1/AUTH_system/container10/test10.zip 404 Not Found [first 60 chars of response] <html><h1>Not Found</h1><p>The resource Could not be found.<


但是只有七个上传成功

/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container1

test1.zip

/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container2

/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container3

test3.zip

/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container4

test4.zip

/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container5

/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container6

test6.zip

/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container7

test7.zip

/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container8

/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container9

test9.zip

/data/swift/upload/test100M> swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass list container10

test10.zip



上传

第一个用时00:39s,12M/s

第二个用时01:01s,8.19M/s

第三个用时03:37s,2.3M/s

第四个用时06:16s,1.32M/s

第五个用时06:16s,1.32M/s

第六个用时07:06s,1.17M/s

第七个用时07:06s,1.17M/s


下载

第一个用时73.207s,7.216 MB/s

第二个用时107.437s,4.916 MB/s

第三个用时107.581s,4.910 MB/s

第四个用时108.457s,4.870 MB/s

第五个用时117.852s,4.482 MB/s

第六个用时121.565s,4.345 MB/s

第七个用时122.600s,4.308 MB/s

第八个用时122.413s,4.315 MB/s

第九个用时145.383s,3.633 MB/s

第十个用时174.677s,3.024 MB/s


2、破坏性测试


测试一:测试关闭一个存储节点的服务之后上传文件会不会在开启该存储服务后同步


查看一个存储节点的服务

/srv/node/sdb1> ps -ef | grep swift

swift 5651 10735 5 17:16 ? 00:01:10 /usr/bin/python /usr/bin/swift-object-updater /etc/swift/object-server.conf

swift 8409 10727 3 17:38 ? 00:00:01 /usr/bin/python /usr/bin/swift-object-auditor /etc/swift/object-server.conf

was_wcm 8477 12319 0 17:38 pts/0 00:00:00 grep swift

swift 10723 1 0 Mar28 ? 00:00:50 /usr/bin/python /usr/bin/swift-container-updater /etc/swift/container-server.conf

swift 10724 1 0 Mar28 ? 00:00:05 /usr/bin/python /usr/bin/swift-account-auditor /etc/swift/account-server.conf

swift 10725 1 0 Mar28 ? 03:18:56 /usr/bin/python /usr/bin/swift-object-replicator /etc/swift/object-server.conf

swift 10726 1 1 Mar28 ? 04:23:53 /usr/bin/python /usr/bin/swift-container-replicator /etc/swift/container-server.conf

swift 10727 1 0 Mar28 ? 00:08:35 /usr/bin/python /usr/bin/swift-object-auditor /etc/swift/object-server.conf

swift 10728 1 0 Mar28 ? 00:01:47 /usr/bin/python /usr/bin/swift-object-expirer /etc/swift/object-expirer.conf

swift 10729 1 0 Mar28 ? 00:00:04 /usr/bin/python /usr/bin/swift-container-auditor /etc/swift/container-server.conf

swift 10730 1 0 Mar28 ? 00:00:00 /usr/bin/python /usr/bin/swift-container-server /etc/swift/container-server.conf

swift 10731 1 0 Mar28 ? 00:00:00 /usr/bin/python /usr/bin/swift-account-server /etc/swift/account-server.conf

swift 10732 1 0 Mar28 ? 00:00:02 /usr/bin/python /usr/bin/swift-account-reaper /etc/swift/account-server.conf

swift 10733 1 0 Mar28 ? 00:00:24 /usr/bin/python /usr/bin/swift-container-sync /etc/swift/container-server.conf

swift 10734 1 0 Mar28 ? 00:06:13 /usr/bin/python /usr/bin/swift-account-replicator /etc/swift/account-server.conf

swift 10735 1 0 Mar28 ? 00:00:06 /usr/bin/python /usr/bin/swift-object-updater /etc/swift/object-server.conf

swift 10736 1 0 Mar28 ? 00:00:00 /usr/bin/python /usr/bin/swift-object-server /etc/swift/object-server.conf

swift 10795 10730 0 Mar28 ? 00:18:29 /usr/bin/python /usr/bin/swift-container-server /etc/swift/container-server.conf

swift 10796 10730 0 Mar28 ? 00:17:56 /usr/bin/python /usr/bin/swift-container-server /etc/swift/container-server.conf

swift 10797 10736 0 Mar28 ? 02:58:11 /usr/bin/python /usr/bin/swift-object-server /etc/swift/object-server.conf

swift 10798 10736 0 Mar28 ? 03:16:19 /usr/bin/python /usr/bin/swift-object-server /etc/swift/object-server.conf

swift 10799 10731 0 Mar28 ? 00:04:15 /usr/bin/python /usr/bin/swift-account-server /etc/swift/account-server.conf

swift 10800 10731 0 Mar28 ? 00:04:30 /usr/bin/python /usr/bin/swift-account-server /etc/swift/account-server.conf


杀死服务

# kill -9 `ps -ef | grep -v grep | grep object-server | awk '{print $2}'`


上传文件

swift -Ahttp://192.168.1.211:8090/auth/v1.0 -U system:root -K testpass upload container1 apache_install


启动服务之前的三个存储文件对比

swift@server2:/srv/node/sdb1/objects> ll | wc -l

21


swift@server3:/srv/node/sdb1/objects> ll | wc -l

44


swift@server4:/srv/node/sdb1/objects> ll | wc -l

44


启动服务

swift@server2:/srv/node/sdb1/objects> sudo swift-init all restart


swift@server2:/srv/node/sdb1/objects> ll | wc -l

44


可以看到文件已经同步


测试二:测试删除一个存储节点物理服务器上的文件会不会在之后同步其他存储节点上的文件


删除一个存储节点的文件

swift@server2:/srv/node/sdb1/objects> rm -rf *


查看文件的同步变化

swift@server2:/srv/node/sdb1> du -sh *

16K accounts

356M async_pending

129M containers

0 objects

0 tmp


swift@server2:/srv/node/sdb1> du -sh *

16K accounts

356M async_pending

129M containers

260K objects

0 tmp


swift@server2:/srv/node/sdb1> du -sh *

16K accounts

356M async_pending

129M containers

33M objects

0 tmp

swift@server2:/srv/node/sdb1> du -sh *

16K accounts

356M async_pending

129M containers

129M objects

0 tmp

swift@server2:/srv/node/sdb1> du -sh *

16K accounts

356M async_pending

129M containers

5.0G objects

0 tmp


可以看到文件渐渐同步完成

swift分布式存储性能测试以及破坏性测试的更多相关文章

  1. ios – 如何使用Objective C类中的多个参数调用Swift函数?

    本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请发送邮件至dio@foxmail.com举报,一经查实,本站将立刻删除。

  2. ios – Swift 4添加手势:覆盖vs @objc

    我想在我的视图中添加一个手势,如下所示:但是,在Swift4中,我的编译器给出了以下错误:建议添加@objc以将此实例方法公开给Objective-C.实现此目的的另一个选项将覆盖touchesBegan()函数并使用它来处理点击.我试图以“Swift”的方式做到这一点,而不必带入Obj-C.有没有纯粹的Swift方式来添加这个轻击手势而不使用@objc?

  3. ios – 将视频分享到Facebook

    我正在编写一个简单的测试应用程序,用于将视频从iOS上传到Facebook.由于FacebookSDK的所有文档都在Objective-C中,因此我发现很难在线找到有关如何使用Swift执行此操作的示例/教程.到目前为止我有这个在我的UI上放置一个共享按钮,但它看起来已禁用,从我读到的这是因为没有内容设置,但我看不出这是怎么可能的.我的getVideoURL()函数返回一个NSURL,它肯定包含视

  4. ios – 以编程方式在Swift中添加联系人

    我想在Swift中以编程方式添加联系人.我发现了一些Objective-C示例,但我没有让它们工作,甚至在Objective-C中也没有.我不希望这涉及到AddressBookUI,因为我想从我自己的UI中获取值.解决方法这是在Swift中添加联系人的快速方法.我在我的iPhone5iOS7.1上验证了它,因为我发现模拟器并不总是与我的手机对AB的东西相同.您可以添加一个按钮并指向此方法:顺便说一下–它假设你已经分配了一个地址簿var,你可以通过覆盖viewDidAppear来打开视图.它也会执行安全提示

  5. ios – 为目标c中的方法传递未知类型的参数,可能吗?

    是否可以将未知类型的参数传递给objective-C方法?在C#中你可以写实现这一点,但我知道Objective-C没有泛型,所以有没有其他方法可以在Objective-C中实现这一点?我需要这个,因为我想创建一个方法来改变不同对象的文本颜色,如UITextField和UIButton的占位符文本.所以我的计划是创建一个名为textWhite的方法,然后在此方法中检查对象的类型,然后运行匹配的代码以使文本颜色变为白色.解决方法是的,可以传递未知类型的参数.见下面的例子.请参考使用id对象的链接作为参数Us

  6. ios – Swift指针算术和解除引用;将一些类似C的地图代码转换为Swift

    我有一点似乎没有工作的Swift代码……解决方法您正在指定locationPointer指向新位置,但仍在下一行中使用ptr,并且ptr的值尚未更改.将您的最后一行更改为:或者你可以改变指向var的指针并推进它:

  7. ios – “禁用模块时使用’@import’”错误 – 启用模块和链接框架= YES

    我有一个使用CocoaPods并使用’SCLAlertView-Objective-C’窗格的项目.该pod使用@importUIKit;模块样式导入.我在目标和项目设置中将“启用模块(C&Objective-C)”和“自动链接框架”设置为YES.当模块被禁用时,我仍然得到“使用’@import’错误.有没有什么可以阻止Xcode能够启用模块,如使用.pch文件,任何链接器标志,或者我没有提到的任

  8. XCode 6.3立即在抛出的Objective-C异常上引发SIGABRT

    考虑以下目标-C代码在XCode6.2中,它按预期工作(记录“错误消息”).但是,由于我们升级到6.3,抛出行(throwstd::logic_error…)引发SIGABRT(堆栈跟踪仅包含_cxa_throw和_pthread_kill,超出applicationdidFinishLaunchingWithOptions)并导致应用程序崩溃.这只发生在我们的应用程序中–当我将完全相同的代码复制

  9. ios – 在swift框架中使用Bridging Headers时失败

    我正在做一个快速的框架,我想使用旧的目标c类.为此,我使用桥接头方法但是当我尝试构建时出现此错误:我将我的{PROJECT}-Bridging-Header.h添加到Swift编译器中的Objective-C桥接头–代码生成我怎么解决它?

  10. XCode 3.2 Ruby和Python模板

    在xcode3.2下,我的ObjectiveCPython/Ruby项目仍然可以打开更新和编译,但是你无法创建新项目.鉴于xcode3.2中缺少ruby和python的所有痕迹(即创建项目并添加新的ruby/python文件),是否有一种简单的方法可以再次安装模板?我发现了一些关于将它们复制到某个文件夹的信息,但我似乎无法让它工作,我怀疑文件夹的位置已经改变为3.2.解决方法3.2中的应用程序模板

随机推荐

  1. Swift UITextField,UITextView,UISegmentedControl,UISwitch

    下面我们通过一个demo来简单的实现下这些控件的功能.首先,我们拖将这几个控件拖到storyboard,并关联上相应的属性和动作.如图:关联上属性和动作后,看看实现的代码:

  2. swift UISlider,UIStepper

    我们用两个label来显示slider和stepper的值.再用张图片来显示改变stepper值的效果.首先,这三个控件需要全局变量声明如下然后,我们对所有的控件做个简单的布局:最后,当slider的值改变时,我们用一个label来显示值的变化,同样,用另一个label来显示stepper值的变化,并改变图片的大小:实现效果如下:

  3. preferredFontForTextStyle字体设置之更改

    即:

  4. Swift没有异常处理,遇到功能性错误怎么办?

    本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请发送邮件至dio@foxmail.com举报,一经查实,本站将立刻删除。

  5. 字典实战和UIKit初探

    ios中数组和字典的应用Applicationschedule类别子项类别名称优先级数据包contactsentertainment接触UIKit学习用Swift调用CocoaTouchimportUIKitletcolors=[]varbackView=UIView(frame:CGRectMake(0.0,0.0,320.0,CGFloat(colors.count*50)))backView

  6. swift语言IOS8开发战记21 Core Data2

    上一话中我们简单地介绍了一些coredata的基本知识,这一话我们通过编程来实现coredata的使用。还记得我们在coredata中定义的那个Model么,上面这段代码会加载这个Model。定义完方法之后,我们对coredata的准备都已经完成了。最后强调一点,coredata并不是数据库,它只是一个框架,协助我们进行数据库操作,它并不关心我们把数据存到哪里。

  7. swift语言IOS8开发战记22 Core Data3

    上一话我们定义了与coredata有关的变量和方法,做足了准备工作,这一话我们来试试能不能成功。首先打开上一话中生成的Info类,在其中引用头文件的地方添加一个@objc,不然后面会报错,我也不知道为什么。

  8. swift实战小程序1天气预报

    在有一定swift基础的情况下,让我们来做一些小程序练练手,今天来试试做一个简单地天气预报。然后在btnpressed方法中依旧增加loadWeather方法.在loadWeather方法中加上信息的显示语句:运行一下看看效果,如图:虽然显示出来了,但是我们的text是可编辑状态的,在storyboard中勾选Editable,再次运行:大功告成,而且现在每次单击按钮,就会重新请求天气情况,大家也来试试吧。

  9. 【iOS学习01】swift ? and !  的学习

    如果不初始化就会报错。

  10. swift语言IOS8开发战记23 Core Data4

    接着我们需要把我们的Rest类变成一个被coredata管理的类,点开Rest类,作如下修改:关键字@NSManaged的作用是与实体中对应的属性通信,BinaryData对应的类型是NSData,CoreData没有布尔属性,只能用0和1来区分。进行如下操作,输入类名:建立好之后因为我们之前写的代码有些地方并不适用于coredata,所以编译器会报错,现在来一一解决。

返回
顶部