O'Reilly logo

Python Unlocked by Arun Tigeraniya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Scaling Python

In this chapter, we will try to understand how we can make our program work for more inputs by making the program scalable. We will do this by both optimizing and adding computing power to the system. We will cover the following topics:

  • Going multithreaded
  • Using multiple processes
  • Going asynchronous
  • Scaling horizontally

The major reason a system is not able to scale is state. Events can change the state of a system permanently for both that request or further requests from that endpoint.

Normally state is stored in the database, and reactions to events are worked on sequentially, and changes to state due to events are then stored in DB.

Task can be computation intensive (CPU load) or IO bound in which system needs answers from ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required