Welcome!

Linux Containers Authors: Olivier Huynh Van, Derek Weeks, Stackify Blog, Automic Blog, Elizabeth White

Related Topics: Linux Containers, Microservices Expo, Containers Expo Blog, Agile Computing, @DevOpsSummit

Linux Containers: Article

WebSocket Technology | @DevOpsSummit #DevOps #APM #Microservices

Considerations and best practices

Providing a full-duplex communication channel over a single TCP connection, WebSocket is the most efficient protocol for real-time responses over the web. If you're utilizing WebSocket technology, performance testing will boil down to simulating the bi-directional nature of your application.

Introduced with HTML5, the WebSocket protocol allows for more interaction between a browser and website, facilitating real-time applications and live content. WebSocket technology creates a persistent connection between the client and server, circumventing the requirement for a client-initiated HTTP request to trigger a server response. Providing a full-duplex communication channel over a single TCP connection, WebSocket is the most efficient protocol for real-time responses over the web.

If you're utilizing WebSocket technology, performance testing will boil down to simulating the bi-directional nature of your application.

Synchronous vs. Asynchronous Calls
First, you'll need to understand the kind of WebSocket communication your application is using: synchronous and asynchronous calls.

In addition to facilitating real-time applications, WebSockets are also used by web developers as a way of maintaining a faster, longer connection between client and server, even for traditional request-response purposes. This traditional request-response communication via WebSockets results in synchronous calls.

Asynchronous calls, on the other hand, do not require a client request to initiate a server response. The server automatically pushes information and updates over a single TCP connection (which remains open), allowing for an ongoing, bi-directional conversation.

Testers must be aware of the differences between the two in order to properly measure response times and validate the performance of their applications.

Considerations
Asynchronous Calls
Things can get a bit tricky when it comes to measuring the response times of asynchronous calls. Traditionally, testers would measure the time it takes from when a client sends a request and receives a response. With asynchronous calls, the end user's actions will determine server interactions and as such, it can be difficult to measure the time it takes to transport the message to the client, or latency.

Because messages are generated by external events and the server decides when to send messages to all connected clients, it's in testers' best interest to measure the time it takes for a client to receive a message after the triggering of an external event.

Synchronous Calls
Compared to asynchronous calls, measuring response times for synchronous calls is much easier and more straightforward. It's related to the Q&A approach where testers merely send a request and wait for the response.

Designing Tests
Designing test cases for synchronous calls is simple as testers will only need to understand each request/response as it relates to user interaction. The real challenge lies in designing tests for asynchronous calls.

The nature of asynchronous calls will change the logic required in designed load testing scenarios and testers will face many of the issues also associated with testing streaming media and long polling.

Limitations
Testers may face hardware and browser compatibility limitations when dealing with WebSockets. An open WebSocket channel facilitates a direct, open connection between the client and server. If there are thousands of customers or connections accessing data via your server, testers will need to adjust the backend  accordingly based on the number of sockets a single server can handle.

There are also a few browsers that don't support WebSocket communication. When this is the case, the application will replace the WebSocket communication with long polling. For performance engineers, this means creating two user paths for each use case (one using WebSockets, the other using long polling). To ensure realistic load testing, testers must take into account the ratio of browsers that are WebSocket compatible and ones that are not.

Tips for Load & Performance Testing WebSockets
Asynchronous Calls
The way you measure latency for asynchronous calls directly relates to the application framework. For example, when using Socket.IO, the inclusion of a timestamp within the WebSocket message should be a requirement. Testers can immediately send a message and then after receiving a response at the client level, calculate the time between the timestamps. There isn't a standard framework for WebSockets and out of the frameworks that do support WebSocket communication, few automatically include the timestamp. Testers may need to work with developers on including this information in messages. It may be a pain, but it's necessary to test the performance of WebSockets.

Synchronous Calls
To measure response times for synchronous calls, you'll need to make sure that your load testing solution first supports WebSocket technology. It should also be able to link the WebSocket request with the proper WebSocket response. It's important to note that the capability to test this asynchronous communication is a rarity among software testing products - choose your tool wisely.

Designing Tests
For newer testers and testers used to designing normal web scenarios, designing tests to handle calls via WebSocket can be confusing. It's going to come down to understanding your application and the nature of the request-response communication. When designing your tests, make sure you're reproducing the behavior of your application communicating with a real browser.

Designing test cases for synchronous calls, again, is fairly simple as these calls employ traditional request/response communication. To measure their performance, you'll need to equip your testing team with a load testing solution that enables testing of synchronous calls over WebSockets.

Designing test cases for asynchronous calls is a bit more challenging. In this case, users connected via WebSockets will take a specific action from the moment information is displayed on the screen. For example, a user might decide to purchase stock when the price reaches a certain level. Otherwise, the user may take no action at all. Keep in mind, the user action included in your use case depends on the information that does or does not arrive via the WebSocket channel.

Limitations
To address hardware issues, you'll need to ensure that you have several servers to balance the load accessing your WebSocket connections. Unlike HTTP communication where the connection is closed after a successful request-response interaction, WebSocket connections remain open. These connections will close if your servers are unable to handle the load, resulting in poor application performance for end users.

To combat browser incompatibility, you can introduce a WebSocket framework as a workaround. Otherwise, you'll need to design and execute polling scenarios during your load and performance testing.

The nature of WebSockets also poses challenges - it's a transport layer, so your project could be exchanging text data, binary data, etc. Performance engineers will need to decode or deserialize the WebSocket messages in order to correlate testing scenarios.

Conclusion
WebSockets simply provide a way to exchange data, so this technology isn't going to drastically change the way organizations deal with tests. Testing teams just have to understand the challenges they'll face when handling WebSockets-like browser incompatibility and collecting response times of asynchronous calls.

Ultimately, equipping your testing team with a load testing solution that not only provides the ability to test request-response apps that leverage WebSockets, but that can also manage the uninitiated responses sent by the server, will result in the most effective, realistic performance testing.

In terms of ensuring a seamless user experience, measuring the latency isn't enough. To truly validate the performance of an application utilizing WebSockets, you should combine your WebSocket load testing scenarios with scenarios on a browser-based tool like Selenium, but that is a topic for another post.

More Stories By Tim Hinds

Tim Hinds is the Product Marketing Manager for NeoLoad at Neotys. He has a background in Agile software development, Scrum, Kanban, Continuous Integration, Continuous Delivery, and Continuous Testing practices.

Previously, Tim was Product Marketing Manager at AccuRev, a company acquired by Micro Focus, where he worked with software configuration management, issue tracking, Agile project management, continuous integration, workflow automation, and distributed version control systems.

@ThingsExpo Stories
Things are changing so quickly in IoT that it would take a wizard to predict which ecosystem will gain the most traction. In order for IoT to reach its potential, smart devices must be able to work together. Today, there are a slew of interoperability standards being promoted by big names to make this happen: HomeKit, Brillo and Alljoyn. In his session at @ThingsExpo, Adam Justice, vice president and general manager of Grid Connect, will review what happens when smart devices don’t work togethe...
SYS-CON Events announced today that SoftLayer, an IBM Company, has been named “Gold Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York, New York. SoftLayer, an IBM Company, provides cloud infrastructure as a service from a growing number of data centers and network points of presence around the world. SoftLayer’s customers range from Web startups to global enterprises.
SYS-CON Events announced today that Technologic Systems Inc., an embedded systems solutions company, will exhibit at SYS-CON's @ThingsExpo, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Technologic Systems is an embedded systems company with headquarters in Fountain Hills, Arizona. They have been in business for 32 years, helping more than 8,000 OEM customers and building over a hundred COTS products that have never been discontinued. Technologic Systems’ pr...
SYS-CON Events announced today that Auditwerx will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Auditwerx specializes in SOC 1, SOC 2, and SOC 3 attestation services throughout the U.S. and Canada. As a division of Carr, Riggs & Ingram (CRI), one of the top 20 largest CPA firms nationally, you can expect the resources, skills, and experience of a much larger firm combined with the accessibility and attent...
SYS-CON Events announced today that CA Technologies has been named “Platinum Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY, and the 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CA Technologies helps customers succeed in a future where every business – from apparel to energy – is being rewritten by software. From ...
SYS-CON Events announced today that HTBase will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. HTBase (Gartner 2016 Cool Vendor) delivers a Composable IT infrastructure solution architected for agility and increased efficiency. It turns compute, storage, and fabric into fluid pools of resources that are easily composed and re-composed to meet each application’s needs. With HTBase, companies can quickly prov...
SYS-CON Events announced today that Loom Systems will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Founded in 2015, Loom Systems delivers an advanced AI solution to predict and prevent problems in the digital business. Loom stands alone in the industry as an AI analysis platform requiring no prior math knowledge from operators, leveraging the existing staff to succeed in the digital era. With offices in S...
Buzzword alert: Microservices and IoT at a DevOps conference? What could possibly go wrong? In this Power Panel at DevOps Summit, moderated by Jason Bloomberg, the leading expert on architecting agility for the enterprise and president of Intellyx, panelists peeled away the buzz and discuss the important architectural principles behind implementing IoT solutions for the enterprise. As remote IoT devices and sensors become increasingly intelligent, they become part of our distributed cloud enviro...
SYS-CON Events announced today that T-Mobile will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on ...
SYS-CON Events announced today that Infranics will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Since 2000, Infranics has developed SysMaster Suite, which is required for the stable and efficient management of ICT infrastructure. The ICT management solution developed and provided by Infranics continues to add intelligence to the ICT infrastructure through the IMC (Infra Management Cycle) based on mathemat...
SYS-CON Events announced today that Interoute, owner-operator of one of Europe's largest networks and a global cloud services platform, has been named “Bronze Sponsor” of SYS-CON's 20th Cloud Expo, which will take place on June 6-8, 2017 at the Javits Center in New York, New York. Interoute is the owner-operator of one of Europe's largest networks and a global cloud services platform which encompasses 12 data centers, 14 virtual data centers and 31 colocation centers, with connections to 195 add...
SYS-CON Events announced today that Cloudistics, an on-premises cloud computing company, has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Cloudistics delivers a complete public cloud experience with composable on-premises infrastructures to medium and large enterprises. Its software-defined technology natively converges network, storage, compute, virtualization, and management into a ...
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), will provide an overview of various initiatives to certifiy the security of connected devices and future trends in ensuring public trust of IoT. Eric Lachapelle is the Chief Executive Officer of the Professional Evaluation and Certification Board (PECB), an international certification body. His role is to help companies and individuals to achieve professional, accredited and worldw...
In his General Session at 16th Cloud Expo, David Shacochis, host of The Hybrid IT Files podcast and Vice President at CenturyLink, investigated three key trends of the “gigabit economy" though the story of a Fortune 500 communications company in transformation. Narrating how multi-modal hybrid IT, service automation, and agile delivery all intersect, he will cover the role of storytelling and empathy in achieving strategic alignment between the enterprise and its information technology.
Microservices are a very exciting architectural approach that many organizations are looking to as a way to accelerate innovation. Microservices promise to allow teams to move away from monolithic "ball of mud" systems, but the reality is that, in the vast majority of organizations, different projects and technologies will continue to be developed at different speeds. How to handle the dependencies between these disparate systems with different iteration cycles? Consider the "canoncial problem" ...
The Internet of Things is clearly many things: data collection and analytics, wearables, Smart Grids and Smart Cities, the Industrial Internet, and more. Cool platforms like Arduino, Raspberry Pi, Intel's Galileo and Edison, and a diverse world of sensors are making the IoT a great toy box for developers in all these areas. In this Power Panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists discussed what things are the most important, which will have the most profound e...
Keeping pace with advancements in software delivery processes and tooling is taxing even for the most proficient organizations. Point tools, platforms, open source and the increasing adoption of private and public cloud services requires strong engineering rigor - all in the face of developer demands to use the tools of choice. As Agile has settled in as a mainstream practice, now DevOps has emerged as the next wave to improve software delivery speed and output. To make DevOps work, organization...
My team embarked on building a data lake for our sales and marketing data to better understand customer journeys. This required building a hybrid data pipeline to connect our cloud CRM with the new Hadoop Data Lake. One challenge is that IT was not in a position to provide support until we proved value and marketing did not have the experience, so we embarked on the journey ourselves within the product marketing team for our line of business within Progress. In his session at @BigDataExpo, Sum...
Web Real-Time Communication APIs have quickly revolutionized what browsers are capable of. In addition to video and audio streams, we can now bi-directionally send arbitrary data over WebRTC's PeerConnection Data Channels. With the advent of Progressive Web Apps and new hardware APIs such as WebBluetooh and WebUSB, we can finally enable users to stitch together the Internet of Things directly from their browsers while communicating privately and securely in a decentralized way.
DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm.