Tuning Data Transport in python web applications

Vishrut Kohli (~vishrutkohli)


1

Vote

Description:

In today's interconnected world, network latency plays a crucial role in the performance and user experience of web applications. This hands-on workshop is designed to provide participants with a deep understanding of network latency and optimisations in Python frameworks and equip them with practical techniques to mitigate latency, optimise network protocols, leverage caching, connection pooling, and utilise tools for network analysis.

Time : 2.5 hours

The workshop would be focussed on three things

1. What are network Problems

  1. Introduction (15 minutes)
    • About us and what we do
    • Overview of the workshop objectives, agenda, and the importance of addressing network latency in web applications.
    • Talking about different aspects of network issues such as slow connections, low network speeds, Database inefficiencies, web server configurations and connection throttling.
    • Setting up the Python project pushed to GitHub which already contains the above mentioned issues in multiples API’s.
  2. Understanding Network Models(15 min)
    • Overview of the OSI model and TCP/IP protocol suite, highlighting their relevance to network communication and latency issues.
    • Explanation of how network latency manifests in Python web frameworks.

2. How to figure out if there is a network issue

  1. Network Analysis Tools (30 minutes)
    • Introduction to essential tools for network analysis, including developer tools, Wireshark, and Man-in-the-Middle (MITM) techniques .
    • Setup and configuration of network analysis tools such as mitmproxy and Wireshark for Python applications.
    • Hands-on demonstration of using developer tools to diagnose different API’s and showcase network problems such slow connections, slow network speed, identify slow TLS handshakes and DNS resolution , and detect connection throttling and other performance bottlenecks.

3. Optimising Data transport to unlock peak performance

  1. Optimising Network Protocols in Python (30 minutes)
    • In-depth discussion on optimising network protocols, including HTTP, HTTP/2, HTTP/3, and gRPC, for improved performance and reduced latency.
    • implementing these protocols in the project in different Api’s according to use cases and comparing their performances.
    • Identify slow reading backends (TCP zero window)
  2. Asynchronous Programming for Reduced Latency (30 minutes)
    • Introduction to asynchronous programming models in python, with focus on asyncio.
    • Explanation of how asynchronous I/O enables non-blocking operations, reduces waiting time, and enhances network performance.
    • Live coding examples and hands-on exercises to demonstrate the implementation of asynchronous I/O in Python web applications.
    • Discussion of best practices and considerations when using asynchronous programming to minimize network latency.
  3. Connection Pooling and Caching (30 minutes)
    • Exploration of connection pooling techniques in Python using libraries such as psycopg2, SQLAlchemy, or aiopg to efficiently manage network(database and web ) connections and reduce overhead in web applications.
    • Explanation of caching mechanisms and their role in minimizing latency, including in-memory caching with libraries such as Redis or Memcached.
    • Best practices for implementing connection pooling and caching strategies in the project.
    • Code examples and hands-on exercises to implement connection pooling and caching in Python web applications.
  4. Q&A and Wrap-up (15 minutes)
    • Open discussion and Q&A session to address participants' queries and provide further clarification on the workshop topics.
    • Summary of key takeaways and recommendations for participants to apply the learned techniques in their own Python web applications.
    • Closing remarks

Prerequisites:

Prerequisites:

  • Basic knowledge of python and networking concepts such as IP, latency etc.
  • Basic knowledge of web development.
  • Good sense of Humour and love for Gifs.

Video URL:

https://youtu.be/3ocgUD8Un5g

Speaker Info:

This is a multi speaker workshop so adding information for both speakers.

Vishrut Kohli

I am Vishrut, a 26-year-old Senior Software Engineer at MilkBasket (India's largest and most sustainable grocery delivery service), leading consumer applications and platform. Prior to this I led the last mile team at Blinkit(India's largest quick commerce service) . Python has been my primary tech stack since i started coding and this journey started from building a data server hosted on my raspberry pi to building a high performant delivery partner allocation system for our 10 min delivery service which handles more than 100k orders/ min flawlessly. I live to build high performant software in python and love to share my learning along the way.

Nipun Arora

I go by the name Nipun, a Software Engineer aged 26, currently contributing my skills at Google. My journey kicked off as part of the return transportation squad at Amazon. Python has been my trusted companion, driving my technical pursuits. Over time, I've sculpted robust and scalable web applications, harnessing the might of Django's capabilities to produce efficient and sustainable code. My specialization spans crafting RESTful APIs, streamlining database queries, and executing intricate business logic, all aimed at seamlessly fusing frontend and backend systems.

Speaker Links:

  • https://github.com/vishrutkohli
  • https://www.youtube.com/watch?v=rk8RE8HYecg --> pycon 2020 talk
  • https://www.youtube.com/watch?v=-Xgv4ZVWORg ---> conf42 2021 talk
  • https://github.com/icancode23
  • https://medium.com/@aroranipun23
  • https://www.linkedin.com/in/nipun-arora-2527b6135/

Section: Web & App development
Type: Workshops
Target Audience: Intermediate
Last Updated: