Coder Social home page Coder Social logo

[discussion] Asyncio speedups about devpi HOT 7 OPEN

Agalin avatar Agalin commented on June 16, 2024
[discussion] Asyncio speedups

from devpi.

Comments (7)

fschulze avatar fschulze commented on June 16, 2024

Thanks for bringing this up as a discussion first.

Before adding any complexity like this, is there some real performance benefit for actual use cases?

from devpi.

Agalin avatar Agalin commented on June 16, 2024

It's hard to provide performance increase values without some kind of a benchmark.

Uvloop is faster than the built-in implementation - that's a fact confirmed by multiple sources over the web, it's even the recommended by modern ASGI servers (e.g. uvicorn). It reaches performance similar to Go, faster than NodeJS.

But how large of an impact it may have on Devpi is hard to say. It heavily depends on load distribution. The more mirrored packages accessed the bigger the speedup should be. Definitely would be higher if the main API was ASGI but with pyramid it's impossible AFAIK.

I strongly believe using those options is way less complicated than implementing replicas or requests-only workers. In my case mirror syncs were the main source of bottleneck from what I can tell - simple local package downloads were handled by nginx directly.

from devpi.

Agalin avatar Agalin commented on June 16, 2024

Oh. Didn't mention. Obviously, both uvloop and aiohttp speedups onlly help with parts of the stack. Bottleneck may be in other sections but hard to say without benchmarks.

from devpi.

fschulze avatar fschulze commented on June 16, 2024

I'm fairly certain that the other parts of devpi-server are the bottleneck for mirror speed. The async stuff only happens every 30 min per project, when the cache expires. So first step would be profiling actual load.

from devpi.

Agalin avatar Agalin commented on June 16, 2024

In my case it was a bursty load - at some point you got a CI pipeline or two making 5+ concurrent requests for various packages - many of them requiring a refresh.

Unfortunately I'm no longer able to profile it due to a migration to a different deployment structure.

from devpi.

gaborbernat avatar gaborbernat commented on June 16, 2024

I'd make uvloop an opt-in option not the default. Because as #998 uvloop is also written in C and would slow down support for new Python versions.

from devpi.

Agalin avatar Agalin commented on June 16, 2024

I like the approach used by both aiohttp and uvicorn - "use if installed, provide a single extra which installs them".

from devpi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.