Welcome!

Linux Containers Authors: Yeshim Deniz, Liz McMillan, PagerDuty Blog, Elizabeth White, Pat Romanski

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
SYS-CON Events announced today that SourceForge has been named “Media Sponsor” of SYS-CON's 21st International Cloud Expo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. SourceForge is the largest, most trusted destination for Open Source Software development, collaboration, discovery and download on the web serving over 32 million viewers, 150 million downloads and over 460,000 active development projects each and every month.
SYS-CON Events announced today that DXWorldExpo has been named “Global Sponsor” of SYS-CON's 21st International Cloud Expo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Digital Transformation is the key issue driving the global enterprise IT business. Digital Transformation is most prominent among Global 2000 enterprises and government institutions.
Elon Musk is among the notable industry figures who worries about the power of AI to destroy rather than help society. Mark Zuckerberg, on the other hand, embraces all that is going on. AI is most powerful when deployed across the vast networks being built for Internets of Things in the manufacturing, transportation and logistics, retail, healthcare, government and other sectors. Is AI transforming IoT for the good or the bad? Do we need to worry about its potential destructive power? Or will we...
SYS-CON Events announced today that SIGMA Corporation will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. uLaser flow inspection device from the Japanese top share to Global Standard! Then, make the best use of data to flip to next page. For more information, visit http://www.sigma-k.co.jp/en/.
SYS-CON Events announced today that Daiya Industry will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Daiya Industry specializes in orthotic support systems and assistive devices with pneumatic artificial muscles in order to contribute to an extended healthy life expectancy. For more information, please visit https://www.daiyak...
SYS-CON Events announced today that B2Cloud will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. B2Cloud specializes in IoT devices for preventive and predictive maintenance in any kind of equipment retrieving data like Energy consumption, working time, temperature, humidity, pressure, etc.
SYS-CON Events announced today that Interface Corporation will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Interface Corporation is a company developing, manufacturing and marketing high quality and wide variety of industrial computers and interface modules such as PCIs and PCI express. For more information, visit http://www.i...
SYS-CON Events announced today that Massive Networks, that helps your business operate seamlessly with fast, reliable, and secure internet and network solutions, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. As a premier telecommunications provider, Massive Networks is headquartered out of Louisville, Colorado. With years of experience under their belt, their team of...
SYS-CON Events announced today that NetApp has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. NetApp is the data authority for hybrid cloud. NetApp provides a full range of hybrid cloud data services that simplify management of applications and data across cloud and on-premises environments to accelerate digital transformation. Together with their partners, NetApp em...
SYS-CON Events announced today that Mobile Create USA will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Mobile Create USA Inc. is an MVNO-based business model that uses portable communication devices and cellular-based infrastructure in the development, sales, operation and mobile communications systems incorporating GPS capabi...
SYS-CON Events announced today that Nihon Micron will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Nihon Micron Co., Ltd. strives for technological innovation to establish high-density, high-precision processing technology for providing printed circuit board and metal mount RFID tags used for communication devices. For more inf...
SYS-CON Events announced today that N3N will exhibit at SYS-CON's @ThingsExpo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. N3N’s solutions increase the effectiveness of operations and control centers, increase the value of IoT investments, and facilitate real-time operational decision making. N3N enables operations teams with a four dimensional digital “big board” that consolidates real-time live video feeds alongside IoT sensor data a...
SYS-CON Events announced today that Suzuki Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Suzuki Inc. is a semiconductor-related business, including sales of consuming parts, parts repair, and maintenance for semiconductor manufacturing machines, etc. It is also a health care business providing experimental research for...
While some developers care passionately about how data centers and clouds are architected, for most, it is only the end result that matters. To the majority of companies, technology exists to solve a business problem, and only delivers value when it is solving that problem. 2017 brings the mainstream adoption of containers for production workloads. In his session at 21st Cloud Expo, Ben McCormack, VP of Operations at Evernote, will discuss how data centers of the future will be managed, how th...
SYS-CON Events announced today that Ryobi Systems will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ryobi Systems Co., Ltd., as an information service company, specialized in business support for local governments and medical industry. We are challenging to achive the precision farming with AI. For more information, visit http:...
SYS-CON Events announced today that MIRAI Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MIRAI Inc. are IT consultants from the public sector whose mission is to solve social issues by technology and innovation and to create a meaningful future for people.
SYS-CON Events announced today that mruby Forum will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. mruby is the lightweight implementation of the Ruby language. We introduce mruby and the mruby IoT framework that enhances development productivity. For more information, visit http://forum.mruby.org/.
SYS-CON Events announced today that Fusic will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Fusic Co. provides mocks as virtual IoT devices. You can customize mocks, and get any amount of data at any time in your test. For more information, visit https://fusic.co.jp/english/.
In his session at @ThingsExpo, Greg Gorman is the Director, IoT Developer Ecosystem, Watson IoT, will provide a short tutorial on Node-RED, a Node.js-based programming tool for wiring together hardware devices, APIs and online services in new and interesting ways. It provides a browser-based editor that makes it easy to wire together flows using a wide range of nodes in the palette that can be deployed to its runtime in a single-click. There is a large library of contributed nodes that help so...
SYS-CON Events announced today that Enroute Lab will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Enroute Lab is an industrial design, research and development company of unmanned robotic vehicle system. For more information, please visit http://elab.co.jp/.