Skip to main content

Serving with asyncio, multiprocessing, and batching

Project description

mpservice

Utilities for Python concurrency, including

  • Serving with multiprocessing to make full use of multiple cores, and batching to take advantage of vectorized computation if some components of the service have that capability.

    One use case is machine learning model serving, although the code is generic and not restricted to this particular use case.

  • Stream processing, i.e. processing a long, possibly infinite stream of input data, with multiple operators in the pipeline. A main use case is that one or more of the operators is I/O bound (think: calling an external service), hence can benefit from concurrency.

The serving and streaming utilities can be combined because a mpservice.mpserver.MPServer instance, while doing heavy-lifting in other processes, acts as an I/O bound operator in the main process. Indeed, mpservice.mpserver.MPServer provides method stream for using the server to process data streams.

A MPServer object could be used either in "embedded" mode or to back a service. Utilities are provided in mpservice.http and mpservice.socket for the latter use case.

The package also contains some other related utilities.

To install, do pip install mpservice.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpservice-0.10.7.tar.gz (37.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpservice-0.10.7-py3-none-any.whl (41.8 kB view details)

Uploaded Python 3

File details

Details for the file mpservice-0.10.7.tar.gz.

File metadata

  • Download URL: mpservice-0.10.7.tar.gz
  • Upload date:
  • Size: 37.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for mpservice-0.10.7.tar.gz
Algorithm Hash digest
SHA256 5f0ec181e2e7e5e8f2184b150654127b008ea64700df5ec2a35943ccd548d6d4
MD5 de3f277ca8da28116ad15b9f9ffab1d1
BLAKE2b-256 19f5ec835adcdc43b4a84da16e68c4c979b42ee96733e719eda3d21ba94ce41e

See more details on using hashes here.

File details

Details for the file mpservice-0.10.7-py3-none-any.whl.

File metadata

  • Download URL: mpservice-0.10.7-py3-none-any.whl
  • Upload date:
  • Size: 41.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for mpservice-0.10.7-py3-none-any.whl
Algorithm Hash digest
SHA256 64a7fd2c8b74012ec902c8524caf7fcbd27e2eb2ec014c4d9faf90ab80b84e67
MD5 204d7d0520fbe83b41a55be58375f1d9
BLAKE2b-256 a65bea14be6eb9f92cbc1730344a3d19899aa1372ed9f3dbc3262f308589400b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page