Questions tagged [uvloop]

uvloop is a fast, drop-in replacement of the built-in asyncio event loop. uvloop is implemented in Cython and uses libuv under the hood.

uvloop is a fast, drop-in replacement of the built-in asyncio event loop. uvloop is released under the MIT license.

uvloop and asyncio, combined with the power of async/await in Python 3.5, makes it easier than ever to write high-performance networking code in Python.

uvloop makes asyncio fast. In fact, it is at least 2x faster than nodejs, gevent, as well as any other Python asynchronous framework. The performance of uvloop-based asyncio is close to that of Go programs.

You can read more about uvloop in this blog post.

32 questions
1
vote
1 answer

Docker build fail on one of two systems

I'm trying to build an image based on the official python:3.8-alpine and include the python uvloop package. When I build, it works on my machine(tm), but trying to build the same Dockerfile on our build system fails. Both systems are running Linux,…
1
vote
1 answer

Permission denied with os.setuid() in uvloop

I need to run a subprocess in my main process as "nobody" user, code like this: # os.setuid(65534) # out the set_id work fine!! logging.warning(f"outside user: {getpass.getuser()}") # output: outside user: root def set_id() -> None: …
DustyPosa
  • 463
  • 2
  • 8
1
vote
1 answer

python Unable to get return values from async function using HTTP requests

I'm trying to rewrite my flask application to FastAPI which uses uvloop as the base. When I execute code without the routes, I see no issue and executes as expected. But throws me error after I add the routes and hit a request using Postman. > INFO:…
1
vote
1 answer

Properly respond to await condition from another context

If am using uvloop or asyncio, one of the features i am trying to explore is if i do some actions and then "await on a condition." Let's look at the following example: do_something() zmq.send(stuff,coroutine_context) rr = await (condition) return…
Sam
  • 321
  • 5
  • 13
1
vote
1 answer

Asyncio performance with synchronous code

I create the following test to check performance with running synchronous code in async function. In return_random function can be something like write log, dump or load json, validate in-out date, which call other functions... etc. count_sync and…
1
vote
1 answer

asyncio event loop equivalent with uvloop

I have an event loop with coroutine method using asyncio. I enthusiast to looking for an equivalent of the following example using uvloop instead. Here's a simple asyncio event loop example: import asyncio async def read(**kwargs): oid =…
Benyamin Jafari
  • 27,880
  • 26
  • 135
  • 150
1
vote
3 answers

aiohttp + uvloop parallel HTTP requests are slower than without uvloop

I'm writing a script to make millions of API calls in parallel. I'm using Python 3.6 with aiohttp for this purpose. I was expecting that uvloop would make it faster, but it seems to have made it slower. Am I doing something wrong? with uvloop: 22…
skunkwerk
  • 2,920
  • 2
  • 37
  • 55
0
votes
0 answers

RuntimeError: uvloop does not support Windows at the moment

Following this:https://github.com/levalencia/langchainLuisValencia/blob/master/.github/CONTRIBUTING.md#-common-tasks On Windows. Forked the repo, cloned it locally, created a conda environment, (Poetry was already installed), then installed all…
Luis Valencia
  • 32,619
  • 93
  • 286
  • 506
0
votes
1 answer

aioredis under uvicorn with uvloop question

I have a question. If I use aioredis together with FastAPI using uvicorn and set uvloop in the --loop argument, will aioredis use uvloop or pure asyncio? from fastapi import FastAPI app = FastAPI() @app.get('/get/{key}') async def…
AndrePer
  • 45
  • 3
0
votes
0 answers

method to install uvloop for windows for Rasa

Is there a Windows supported version of uvloop that I could install? I need it for Rasa installation. I have tried installing the uvloop through the tar as well. I am trying to use the tar file but that doesn't seem to work either. I want to…
Prakhar Rathi
  • 905
  • 1
  • 11
  • 25
0
votes
0 answers

Understanding behavior of asyncio set_result as it relates to slow_callback_duration

I'm attempting to debug performance of a running production python web service, built on top of tornado using uvloop as the asyncio event loop. In trying to improve the concurrency, I'm looking to find places where synchronous code is being executed…
0
votes
1 answer

How to access uvloop version of asyncio.Server from the StreamReader?

Python 3.6 and 3.8. I was using the following lines to start a server: class MyServer: async def main(self, handler, host, port): self._server = await asyncio.start_server(handler, host=host, port=port) # Next line does not…
Ytsen de Boer
  • 2,797
  • 2
  • 25
  • 36
0
votes
1 answer

Running into uvloop issues with Database queries from Rasa-X?

I'm trying to make a simple query to my amazon neptune database, from Rasa-x. Here is the code from my actions.py: class ActionQueryDietary(Action): def name(self) -> Text: return "action_query_dietary" def run(self, dispatcher:…
0
votes
0 answers

Can we write Cython 'cdef' functions and use them outside of cython?

It is known for a while that Cython is a great way to improve pythons' speed. In addition, few efficient libraries use Cython to do so. One of them is called 'uvloop'. However, when I looked at their source code, I saw that most of it uses the…
user12418527
0
votes
2 answers

'uvloop' has no attribute 'EventLoopPolicy'

I am testing python code performance with uvloop. I am getting 'uvloop' has no attribute 'EventLoopPolicy' error. I am using python 3.7 and uvloop 0.13.0 pycharm I tried changing interpreter reinstalling uvloop but none of them did not work. Can…
Eranga Perera
  • 908
  • 1
  • 11
  • 21