{"id":4018,"date":"2023-12-20T16:11:31","date_gmt":"2023-12-20T16:11:31","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=4018"},"modified":"2023-12-20T16:12:52","modified_gmt":"2023-12-20T16:12:52","slug":"testing-s3-access-and-performance-with-s3cmd-for-dell-ecs","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=4018","title":{"rendered":"Testing S3 Access (and Performance) with s3cmd (for Dell ECS)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">There are graphical tools to test and use the Dell ECS S3 interface, but everyone wants a CLI right? The below should also work for AWS S3 (with some modification) but this documentation is intended for specific use with the Dell ECS S3 endpoint to verify behaviour and perform some performance testing. The below assumes you already have an Object User created on the Dell ECS along with an S3 Bucket in a Namespace.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Say for example your Dell ECS endpoint is called&nbsp;<strong>&#8220;ecs1.domain.com&#8221;<\/strong>, and your&nbsp;<em>namespace&nbsp;<\/em>(where your bucket lives) is called&nbsp;<strong>&#8220;testing&#8221;<\/strong>, then you&#8217;d have a&nbsp;<em>host_base<\/em>&nbsp;of: &#8220;<strong>testing.ecs1.domain.com&#8221;<\/strong>, you&#8217;d thjen need to specify the&nbsp;<em>bucket_location<\/em>&nbsp;in this case let&#8217;s say its called&nbsp;<strong>&#8220;testbucket&#8221;<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Beyond that all you then need is the&nbsp;<em>access_key<\/em>&nbsp;which is actually the&nbsp;<em>Object User&nbsp;<\/em>in Dell ECS parlance, let&#8217;s call that&nbsp;<strong>&#8220;test-user&#8221;<\/strong>&nbsp;in this example. Then finally the&nbsp;<em>secret_key<\/em>&nbsp;which you set when you create the Object User in this example:&nbsp;<strong>&#8220;secretkeyhere1234&#8221;<\/strong><\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"TestingS3Access(andPerformance)withs3cmd(forDellECS)-Installs3cmd\">Install s3cmd<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Install s3cmd using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>sudo apt install s3cmd<\/code><\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"TestingS3Access(andPerformance)withs3cmd(forDellECS)-Configures3cmd.cfg\">Configure s3cmd.cfg<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">You can configure using the &#8220;s3cmd &#8211;configure&#8221; command, but in our case we just need a simple configuration file so create on as follows in your home directory, s3cmd will by default use the path:&nbsp;<strong>~\/.s3cfg<\/strong>&nbsp;unless you specify otherwise.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>touch .s3cfg\r\nchmod 600 .s3cfg<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the file and add the following details, obviously replace the relevant properties as required.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>.s3cfg<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;default]\r\n# Object Storage Region\r\nhost_base = testing.ecs1.domain.com\r\nhost_bucket = %(bucket).testing.ecs1.domain.com\r\nbucket_location = testbucket\r\nuse_https = True\r\n# Login credentials\r\naccess_key = test-user\r\nsecret_key = secretkeyhere1234\r\ncheck_ssl_certificate = False<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Tip: You can also use environment variables for the access_key and secret_key if you don&#8217;t want these hard coded into a configuration file.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"TestingS3Access(andPerformance)withs3cmd(forDellECS)-ListContentsofS3Bucket\">List Contents of S3 Bucket<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">To query the contents of an S3 Bucket you can run the below, if you wish to see within a sub-directory, just append the sub-directory name onto the end.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>s3cmd ls s3:\/\/testbucket<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll see the contents of the directory for example, excuse all the ISO images and rubbish!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"261\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/12\/image.png\" alt=\"\" class=\"wp-image-4019\" style=\"width:839px;height:auto\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/12\/image.png 1000w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/12\/image-300x78.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/12\/image-768x200.png 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can also specify on any s3cmd command a specific .s3cmd configuration file. By default it will use .s3cfg (if present). If you need a number of different S3 configuration files, you can create another called .s3cfg-number2 with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>touch .s3cfg\r\nchmod 600 .s3cfg<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the relevant configuration file contents, then to use it use the &#8220;-c&#8221; argument.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>s3cmd ls -c ~\/.s3cfg-number2 s3:\/\/testbucket2<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The above &#8220;-c&#8221; switch can be used on s3cmd for List, Get, Put etc. for brevity only the &#8220;default&#8221; is shown in the rest of this document.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"TestingS3Access(andPerformance)withs3cmd(forDellECS)-PutaFileintoS3Bucket\">Put a File into S3 Bucket<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Put a file called\u00a0<strong>myfile.txt<\/strong>\u00a0into the bucket as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>s3cmd put myfile.txt s3:\/\/testbucket<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"TestingS3Access(andPerformance)withs3cmd(forDellECS)-GetaFilefromS3Bucket\">Get a File from S3 Bucket<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Get a file called\u00a0<strong>myfile.txt<\/strong>\u00a0from the bucket as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>s3cmd get s3:\/\/testbucket\/myfile.txt<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"TestingS3Access(andPerformance)withs3cmd(forDellECS)-SimplePerformanceTest\">Simple Performance Test<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">To determine the performance you can use some simple tests for &#8220;get&#8221; and &#8220;put&#8221; requests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The speed you&#8217;ll get will be dependent on the speed of the network, the Dell ECS infrastructure and also your network speed from your testing machine. In this example we have 21 Dell ECS nodes spread over 3 sites with a pair of Kemp ECS Connection Managers at each site, with 10Gbit edge port connectivity and a 40Gbit backhaul. Test test machine is also connected at 10Gbit and is using flash storage for the storage of the file for upload or download from the Dell ECS.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Firstly we&#8217;ll generate a 10GB file full of random stuff to ensure nothing can de-dupe or compress (very well) during transit.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dd if=\/dev\/urandom of=random10GB.bin bs=64M count=160 iflag=fullblock<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"TestingS3Access(andPerformance)withs3cmd(forDellECS)-PutPerformanceTest\">Put Performance Test<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following can give you an idea of the performance of your Dell ECS environment during a single threaded upload (put), notice the &#8220;time&#8221; command on the front which will monitor the duration of the upload, knowing the time, the size of the file allows you to calculate the upload speed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>time s3cmd put random10GB.bin s3:\/\/testbucket<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And we get a result such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>upload: 'random10GB.bin' -> 's3:\/\/testbucket\/random10GB.bin'  &#91;part 680 of 683, 15MB] &#91;1 of 1]\r\n 15728640 of 15728640   100% in    0s    39.89 MB\/s  done\r\nupload: 'random10GB.bin' -> 's3:\/\/testbucket\/random10GB.bin'  &#91;part 681 of 683, 15MB] &#91;1 of 1]\r\n 15728640 of 15728640   100% in    0s    42.17 MB\/s  done\r\nupload: 'random10GB.bin' -> 's3:\/\/testbucket\/random10GB.bin'  &#91;part 682 of 683, 15MB] &#91;1 of 1]\r\n 15728640 of 15728640   100% in    0s    38.04 MB\/s  done\r\nupload: 'random10GB.bin' -> 's3:\/\/testbucket\/random10GB.bin'  &#91;part 683 of 683, 10MB] &#91;1 of 1]\r\n 10485760 of 10485760   100% in    0s    34.09 MB\/s  done\r\n \r\nreal    5m2.594s\r\nuser    1m22.670s\r\nsys     0m22.797s<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To calculate:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>5 Minutes 2.5 Seconds = 302.5 Seconds\r\n\r\n10240MB \/ 302.5 = 33.8MB\/s (Megabytes per second) i.e. 270Mbit\/s (Megabits per second) upload speed<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"TestingS3Access(andPerformance)withs3cmd(forDellECS)-GetPerformanceTest\">Get Performance Test<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following can give you an idea of the performance of your Dell ECS environment during a single threaded download (get). You can wrap this in a &#8220;time&#8221; if you wish, but the information provided by the s3cmd may be enough for you.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ s3cmd get s3:\/\/testbucket\/random10GB.bin<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can get a result like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>download: 's3:\/\/testbucket\/random10GB.bin' -> '.\/random10GB.bin'  &#91;1 of 1]\r\n 10737418240 of 10737418240   100% in   94s   108.85 MB\/s  done<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Thus giving:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>94 Seconds\r\n\r\n10240MB \/ 94 = 108.9MB\/s (Megabytes per second) i.e. 871Mbit\/s (Megabits per second) download speed.<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"TestingS3Access(andPerformance)withs3cmd(forDellECS)-AdditionalInformation\">Additional Information<\/h1>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/support.morrodata.com\/support\/solutions\/articles\/14000133197-how-can-i-test-aws-s3-file-upload-speed-\">https:\/\/support.morrodata.com\/support\/solutions\/articles\/14000133197-how-can-i-test-aws-s3-file-upload-speed-<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docs.safespring.com\/storage\/s3cmd\/\">https:\/\/docs.safespring.com\/storage\/s3cmd\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.scaleway.com\/en\/docs\/tutorials\/s3cmd\/\">https:\/\/www.scaleway.com\/en\/docs\/tutorials\/s3cmd\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.dell.com\/support\/kbdoc\/en-uk\/000021492\/ecs-how-to-access-buckets-when-using-the-aws-cli\">https:\/\/www.dell.com\/support\/kbdoc\/en-uk\/000021492\/ecs-how-to-access-buckets-when-using-the-aws-cli<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/unsplash.com\/@ruchindra\" data-type=\"link\" data-id=\"https:\/\/unsplash.com\/@ruchindra\">Image Attribution<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are graphical tools to test and use the Dell ECS S3 interface, but everyone wants a CLI right? The below should also work for AWS S3 (with some modification) but this documentation is intended for specific use with the Dell ECS S3 endpoint to verify behaviour and perform some performance testing. The below assumes &#8230; <a title=\"Testing S3 Access (and Performance) with s3cmd (for Dell ECS)\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=4018\" aria-label=\"Read more about Testing S3 Access (and Performance) with s3cmd (for Dell ECS)\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":4023,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50],"tags":[],"class_list":["post-4018","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dell-ecs"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4018","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4018"}],"version-history":[{"count":2,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4018\/revisions"}],"predecessor-version":[{"id":4022,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4018\/revisions\/4022"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/media\/4023"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}