5 ms·
It would be pretty nice to see the benchmark with what people is using on the async world (asyncpg + uvloop). Just taking a look on them found it's using aiopog
by jordic 6y ago
It would be pretty nice to see the benchmark with what people is using on the async world (asyncpg + uvloop). Just taking a look on them found it's using aiopog (who is using this?) without uvloop.
- jordic 6y agoAlso on the async use case, it's creating a cursor, when there is no need to use it to just fetch a row from the db (with asyncpg)
- calpaterson 6y agoHi - many of the configurations do use uvloop. For what it's worth, I think people are using aiopg because it works with SQLAlchemy whereas asyncpg does not. I kept the database driver the same because I'm testing sync vs async and not database drivers. I would be interested in testing asyncpg, particularly a performance claim is a big part of that library's documentation but another time.
- jordic 6y agoI don't think people is using aiopg... (at least us). asyncpg also works with sqlalchemy (look at startlette with databases, or our own impl https://github.com/vinissimus/asyncom https://github.com/vinissimus/asyncom ) If I'm not wrong, aiopg it's something not fully async, just because relais on the old driver.
- jordic 6y agothere is also another issue on the benchmarck (not pretty sure how it's handled with aiopg. The pool size. With asyncpg, if you want to handle more req/s you need to increase the pool to at least 15-20 connections, but... this is somehting you need to consider when scaling postgres...
- GamblersFallacy 6y agoHi, a few suggestions. Your benchmarks github repo requirements.txt shows uvloop is not been installed. In addition, the bash script calling uvicorn doesn't have uvloop set for the loop parameter. For example, serve-uvicorn-starlette.sh should be: uvicorn --port 8001 --workers $PWPWORKERS app_starlette:app --loop uvloop The uvicorn docs should point out what a big difference uvloop makes.
- fernandotakai 6y agouvicorn selects uvloop automatically if you have it installed (i just test on my machine, without passing --loop).
- nhumrich 6y agoThe library asyncpgsa allows you to use sa with asyncpg, just like aiopg.
- mastermojo 6y agoAgreed. The blog post even mentions numpy, meinheld and uwsgi as examples of native code performant libraries. The async equivalent is uvloop.