Hello World – AWS

Finally decided to explore AWS after spent some time on Azure. It’s better to know both worlds.

Created a free-tier account, and used AWS Elastic Beanstalk  to deploy my version of Hello World at http://jianaws-env.3r6uscvnmf.us-east-2.elasticbeanstalk.com/

 

 

Advertisements

Chaos Monkey and Beyond

Chaos Monkey is a tool invented in 2011 by Netflix to test the resilience of its IT infrastructure. It works by intentionally disabling computers in Netflix’s production network to test how remaining systems respond to the outage [1].

Its purpose is to ensure a server failure did not noticeably impact end-users and that built-in resilience in high available systems was an obligation rather than an option.

After read the sentence, I vaguely remembered something important and similar, and it took me awhile to recall. It’s TCP/IP, which is the backbone of everything now. This protocol is so mature that it will guarantee your packages will be delivered to the destinations without noticeably impacting end users even if we throw a few Chaos monkey down the path and some servers are down.

It’s interesting to see that this concept of Chaos Monkey exists long time ago, and was given a formal name Chaos Monkey by Netflix around 2011. It’s also interesting to see the power of communication of meaning through a term, Chaos Monkey. Chaos Monkey is not only nouns but also give us a visual imagination. Nice chosen term!

References:

  1. Chaos Monkey

How Do We Get The Best From Cloud?

In my previous post, I talked about IaaS, PaaS, and SaaS.

However, I did not answer this question, how do we get the best from cloud?

As an individual, I think we get the best already. We use those free cloud services such as Gmail, Sky Drive, etc.

As a corporate, I think IaaS is not an optimized situation.

The real benefit comes from if a corporate can use PaaS or SaaS.

In the case of PaaS, we deploy our customize core business applications. The dynamic horizontal or vertical scaling is done through configurations. We only pay for what we use, and that is the real savings.

In the case of SaaS, we can use, for example, HR or accounting offering through SaaS. This will dramatically reduce the cost.

DevOps Tip – Limiting WIP

There is a concept in DevOps – Limiting the number of Work-in-Progress tasks. This concept is extremely simple. A scientific study shows that we can only work on three to seven tasks at the same period of time.

This concept applies to application development as well. For example, we can take on three to seven tasks per sprint.

For another example, we can see how long an average task might really take if we can size the scope of a task correctly.

Another interesting use case is that if a complex task takes too much time to finish, we can limit the number of WIP task to one, and have nothing else to do except to focus on the only task on hand and find out what the real reasons are that prevent us to finish this only task.

Execute Powershell on Remote Machine

Tags

Sometimes, we need to execute Powershell on remote machine.

First, we need to test whether the remote machine is ready.

Test-WsMan COMPUTER

Then we issue the command.

Invoke-Command -ComputerName COMPUTER -ScriptBlock { COMMAND } -credential USERNAME

For how to set up WinRM / remote Powershell Service and other details, please refer to references.

 

References:

https://docs.microsoft.com/en-us/vsts/pipelines/apps/cd/deploy-webdeploy-iis-winrm?view=vsts

https://stackoverflow.com/questions/37427715/unable-to-run-powershell-script-remotely-leading-to-test-agent-deployment-failur

https://www.howtogeek.com/117192/how-to-run-powershell-commands-on-remote-computers/

http://blogs.recneps.net/post/TFS-Release-Manager-Remote-PowerShell-errorcode-0x80090322

TFS: Multiple Versions of DLLs in One Solution

In TFS, if there are multiple versions of 3-rd DLLs in one build solution, we got a problem because TFS dumps all DLLs in one work folder by default. In the end, only one version of the same DLLs remains in that work folder, and that one version of DLL will be copied to all destinations.

We can solve this problem by passing this parameter to msbuild.

/p:GenerateProjectSpecificOutputFolder=true

 

References:

https://stackoverflow.com/questions/23481581/tfs-build-issues-with-multiple-versions-of-the-same-assembly-in-different-projec

https://stackoverflow.com/questions/698855/whats-the-best-way-to-get-tfs-to-output-each-project-to-its-own-directory

http://blogs.objectsharp.com/post/2014/08/22/Separate-TFS-Build-Server-Output-into-Different-Folders.aspx

A Review of Murach’s HTML5 and CSS3, 4th Edition

Today all modern browsers support the features of both HTML 5.0 and CSS3 (to some extent) according to w3school, quora, and many other online resources. HTML5 is the latest evolution of the standard that defines HTML, and has a larger feature set that allows the building of more diverse and powerful web sites and applications. CSS 3.0 is widely accepted as the right way to format web pages.

This book is just like any Murach’s book. The concepts are introduced from easy then to professional level. You can follow step-by-step by using its paired page layout. The authors begins with essential concepts and skills to design web pages. HTML5 semantic elements such as header, main, aside, section, article, footer, and nav are introduced. The authors explain how to create 2-tier and 3-tier navigation menu without using 3rd party libraries such as twitter bootstrap.

Responsive web design and its three major parts (fluid layouts, media queries, and scalable images) are well presented. The authors also introduces latest CSS3 layouts, Flexible Box Layout and Grid Layout, which are the latest approaches of laying out modern web pages. Other elements such as images, icons, tables, forms, audio, video, and fonts are included in this book.

To complete the course, there is a how-to-deploy website chapter.

I highly recommend this book. From reading this book, I feel that the advanced features of HTML5 and CSS3 can replace my current skills, especially twitter bootstrap, in a very easy and native way, and, therefore, I have to upgrade my skill set as well. To get the best of this book, please do:

  1. Download and install the free text editor, Brackets, which is tightly integrated with Chrome (click ‘Live Preview’ to use Chrome Developer Tool).
  2. Browse to the website, https://html5test.com/, and found out your browser’s HTML5 score. Remember that 555 is the perfect. score. I would recommend Chrome for the exercises.
  3. Download all the course materials, and do the exercises.

 

The review was first posted to Amazon.

 

 

 

 

More Threads Do More Work?

Did an experiment on multi-thread processing. The number of items to be processed was 988. I used this simple method of measurement.

  1. Round one. One thread to process one item
  2. Round two. One thread to process 2 items
  3. Round three. One thread to process 4 items
  4. Round N. One thread to process …

The raw result of the experiment:

Max Number of Items

in one Thread

Number of Threads Seconds
1 988 41
2 494 41
4 247 42
8 124 43
16 62 41
32 31 41
64 16 43
128 8 44
256 4 42
512 2 74
1024 1 135

 

NumOfThreadsVsSeconds

Observations:

  1. When one thread processed all 988 items, it took 135 seconds
  2. When two threads processed all 988 items, it took 74 seconds.
  3. When four threads processed all 988 items, it took 42 seconds.
  4. When number of threads were equal or greater than four threads, the processing time was around 42 seconds.

Conclusions:

  1. It can save a lot of time using multi-thread processing
  2. It is almost a linear correlation between the time saved and the number of threads increased during early stage.
  3. Depending upon the context, the plateau is reached sooner or later. After that, it doesn’t matter how many threads you added, the time for processing is constant.

 

SQL Profiler Trace Skipped Records

If you insert a large amount of data, for example more than 1 MB, into SQL database in one single operation [1], the chance are that SQL Profiler is going to skip this operation, leave all fields blank, and mark as “Trace Skipped Records”. Don’t worry. The operation is still inserted into database, and only SQL Profiler skips the operation.

You might ask how to solve this problem. The easiest way to see records inserted is to decrease the size of data inserted. There are other ways, of course[2, 3, 4].

 

References:

  1. SQL Insertion of Thousands Records Too Slow?
  2. https://msrviking.wordpress.com/2009/10/28/trace-skipped-records-sql-server-profiler/
  3. http://blog.consultdba.com/2010/09/trace-skipped-records-what-is-this-and.html
  4. https://scarydba.wordpress.com/2009/10/28/snags-with-profiler-gui/