# Scaling Python Servers with Worker Processes and Socket Duplication

DevFeed: [Scaling Python Servers with Worker Processes and Socket Duplication](<https://devfeed.tech/articles/scaling-python-servers-with-worker-processes-and-socket-duplication-31819.md>)

Original publisher: [Read original article](<https://www.metachris.dev/2011/01/scaling-python-servers-with-worker-processes-and-socket-duplication/>)

Author: Chris Hager

Published: 2011-01-29T00:00:00Z

Content type: tutorial

Language: en

Sources: [Chris Hager](<https://devfeed.tech/sources/chris-hager.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Server](<https://devfeed.tech/topics/server.md>), [Concurrent Programming](<https://devfeed.tech/topics/concurrent-programming.md>), [Processes](<https://devfeed.tech/topics/processes.md>), [Operating system](<https://devfeed.tech/topics/operating-system.md>), [Serialization protocols](<https://devfeed.tech/topics/serialization-protocols.md>)

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [client](<https://devfeed.tech/tags/client.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [processes](<https://devfeed.tech/tags/processes.md>), [protocol](<https://devfeed.tech/tags/protocol.md>), [python](<https://devfeed.tech/tags/python.md>), [request](<https://devfeed.tech/tags/request.md>), [responses](<https://devfeed.tech/tags/responses.md>), [scale](<https://devfeed.tech/tags/scale.md>), [servers](<https://devfeed.tech/tags/servers.md>), [tcp](<https://devfeed.tech/tags/tcp.md>), [threads](<https://devfeed.tech/tags/threads.md>), [worker](<https://devfeed.tech/tags/worker.md>)

## AI overview

This tutorial explains how Python servers can scale by using worker processes that duplicate client sockets, allowing workers to process requests directly. It also introduces TCP server basics, serialization, the C10K problem, and asynchronous I/O for managing many clients.

## Source excerpt

Developing servers that scale is usually quite tricky, even more so with Python and the absence of worker threads which can run on multiple cpu cores [1]. A possible solution are worker processes that duplicate the client's socket, a technique that allows the workers to processes requests and send responses directly to the client socket. This approach is particularly useful for long lasting connections with more than one request per session.