Welcome!

Linux Containers Authors: Elizabeth White, Pat Romanski, Yeshim Deniz, Liz McMillan, Jyoti Bansal

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
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.
SYS-CON Events announced today that Outscale, a global pure play Infrastructure as a Service provider and strategic partner of Dassault Systèmes, 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 2010, Outscale simplifies infrastructure complexities and boosts the business agility of its customers. Outscale delivers a secure, reliable and industrial strength solution for its customers, which in...
SYS-CON Events announced today that Progress, a global leader in application development, 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. Enterprises today are rapidly adopting the cloud, while continuing to retain business-critical/sensitive data inside the firewall. This is creating two separate data silos – one inside the firewall and the other outside the firewall. Cloud ISVs ofte...
SYS-CON Events announced today that Tintri, Inc, a leading provider of enterprise cloud infrastructure, 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. Tintri offers an enterprise cloud platform built with public cloud-like web services and RESTful APIs. Organizations use Tintri all-flash storage with scale-out and automation as a foundation for their own clouds – to build agile development environments...
SYS-CON Events announced today that DivvyCloud 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. DivvyCloud software enables organizations to achieve their cloud computing goals by simplifying and automating security, compliance and cost optimization of public and private cloud infrastructure. Using DivvyCloud, customers can leverage programmatic Bots to identify and remediate common cloud problems in rea...
In his opening keynote at 20th Cloud Expo, Michael Maximilien, Research Scientist, Architect, and Engineer at IBM, will motivate why realizing the full potential of the cloud and social data requires artificial intelligence. By mixing Cloud Foundry and the rich set of Watson services, IBM's Bluemix is the best cloud operating system for enterprises today, providing rapid development and deployment of applications that can take advantage of the rich catalog of Watson services to help drive insigh...
The 21st International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, Big Data, Internet of Things, DevOps, Digital Transformation, Machine Learning and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding busin...
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
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 ...
Every successful software product evolves from an idea to an enterprise system. Notably, the same way is passed by the product owner's company. In his session at 20th Cloud Expo, Oleg Lola, CEO of MobiDev, will provide a generalized overview of the evolution of a software product, the product owner, the needs that arise at various stages of this process, and the value brought by a software development partner to the product owner as a response to these needs.
SYS-CON Events announced today that Tappest will exhibit MooseFS 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. MooseFS is a breakthrough concept in the storage industry. It allows you to secure stored data with either duplication or erasure coding using any server. The newest – 4.0 version of the software enables users to maintain the redundancy level with even 50% less hard drive space required. The software func...
New competitors, disruptive technologies, and growing expectations are pushing every business to both adopt and deliver new digital services. This ‘Digital Transformation’ demands rapid delivery and continuous iteration of new competitive services via multiple channels, which in turn demands new service delivery techniques – including DevOps. In this power panel at @DevOpsSummit 20th Cloud Expo, moderated by DevOps Conference Co-Chair Andi Mann, panelists will examine how DevOps helps to meet th...
Most technology leaders, contemporary and from the hardware era, are reshaping their businesses to do software in the hope of capturing value in IoT. Although IoT is relatively new in the market, it has already gone through many promotional terms such as IoE, IoX, SDX, Edge/Fog, Mist Compute, etc. Ultimately, irrespective of the name, it is about deriving value from independent software assets participating in an ecosystem as one comprehensive solution.
SYS-CON Events announced today that EARP 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. "We are a software house, so we perfectly understand challenges that other software houses face in their projects. We can augment a team, that will work with the same standards and processes as our partners' internal teams. Our teams will deliver the same quality within the required time and budget just as our partn...
SYS-CON Events announced today that delaPlex 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. delaPlex pioneered Software Development as a Service (SDaaS), which provides scalable resources to build, test, and deploy software. It’s a fast and more reliable way to develop a new product or expand your in-house team.
SYS-CON Events announced today that A&I Solutions 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. Founded in 1999, A&I Solutions is a leading information technology (IT) software and services provider focusing on best-in-class enterprise solutions. By partnering with industry leaders in technology, A&I assures customers high performance levels across all IT environments including: mai...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend @CloudExpo | @ThingsExpo, June 6-8, 2017, at the Javits Center in New York City, NY and October 31 - November 2, 2017, Santa Clara Convention Center, CA. Learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
In his keynote at @ThingsExpo, Chris Matthieu, Director of IoT Engineering at Citrix and co-founder and CTO of Octoblu, focused on building an IoT platform and company. He provided a behind-the-scenes look at Octoblu’s platform, business, and pivots along the way (including the Citrix acquisition of Octoblu).
SYS-CON Events announced today that Systena America 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. Systena Group has been in business for various software development and verification in Japan, US, ASEAN, and China by utilizing the knowledge we gained from all types of device development for various industries including smartphones (Android/iOS), wireless communication, security technology and IoT serv...
SYS-CON Events announced today that Outscale 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. Outscale's technology makes an automated and adaptable Cloud available to businesses, supporting them in the most complex IT projects while controlling their operational aspects. You boost your IT infrastructure's reactivity, with request responses that only take a few seconds.