1,151 questions
-2
votes
0
answers
39
views
Django gunicorn gevent with Statsig - run code in forked process
I am running Django app with gunicorn gevent workers. I'm using Statsig for Feature Flagging.
It appears to be struggling, I assume due to gevents monkey patching. I was hoping I could get around this ...
1
vote
0
answers
46
views
WebSocket transcripts not received until connection is closed during Locust load test
I’m performing a WebSocket load test using Locust with websocket-client and a Flask webhook that receives transcripts.
The WebSocket connection works, audio chunks are sent correctly, and my backend ...
0
votes
1
answer
40
views
How do I turn on logs when using Gevent with Gunicorn?
I used to use eventlet to run a flask app on Render.com. It would show detailed logs on render every time an HTTP request was made like GET /socket.io/?EIO=4&transport=polling&t=PcGtd0M HTTP/1....
0
votes
0
answers
38
views
Is there a way to reduce polling woth django dramtiq
I have a webapp using django hosted on render cloud platform which allows users to make api call to deepseek.
These api calls sometimes take 5 minutes to respond, and doing so with async may cause ...
0
votes
0
answers
113
views
gunicorn gevent CERTIFICATE_VERIFY_FAILED error
I have a Django website running in a Docker container (Debian), which I deploy with the following command:
gunicorn core.wsgi:application --bind 0.0.0.0:8000 --workers 33 --worker-class gevent --...
0
votes
0
answers
200
views
Gunicorn + Gevent + Opentelemetry
Anyone using Django + Gunicorn + Gevent + Opentelemetry in production? Would love to know how you got it to work.
Seems like I can't seem to use BatchSpanProcessor or BatchLogRecordProcessor. I'm ...
0
votes
1
answer
57
views
Gevent monitoring: printing stacktrace on blocked greenlets
I'm trying to set up the monitoring thread in gevent to detect a blocked Celery worker and to print the stacktrace of the blocked worker. We set up the monitoring thread like this:
def ...
0
votes
0
answers
37
views
What gevent can't do that asyncio can?
When making asynchronous code, what limitations does gevent with third-party synchronous libraries have that asyncio with third-party asynchronous libraries with async/await syntax doesn't?
What are ...
0
votes
0
answers
91
views
Failed to deliver acknowledgement to Rabbit MQ (flask socket io + gevent +celery)
We are facing an issue with while running the flask application using flask-socketio and a background process using celery, where celery is unable to pick tasks from queue after successfully executing ...
0
votes
0
answers
79
views
Flask Python Server Sent Event (gunicorn)
I am new in developing flask app. The purpose of this flask app is to insert matching time entry into home_table from admin_table and display the table and recently inserted row on index.html in ...
1
vote
0
answers
218
views
gevent AssertionError when using pymongo in flask-socketio app
gevent version: 24.2.1 (pip install gevent)
Python version: Python 3.12.3 (python --version)
Operating System:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
...
0
votes
0
answers
100
views
APScheduler in a Python flask app to execute recurring tasks isn't working with Gunicorn
I'm a newbie with Python and flask in general and I'm trying to create (I think) a kind of basic project: I have a flask web app that makes requests every 12 hours to a certain API endpoint and stores ...
0
votes
1
answer
58
views
Requests webdriver loop
My code looks like this:
def download_article_picture(self):
""" Downloads the article picture if available based on an input url
"""
for i in ...
1
vote
1
answer
98
views
Locust Gevent friendly socket
I have the following client listed below to send request to my server using a custom protobuf message. How do I make this gevent friendly so I can make connection in parallel. Right now it seems the ...
1
vote
0
answers
251
views
ERR_SSL_CLIENT_AUTH_CERT_NEEDED when sending custom client certificate from Electron
I have been trying to send a certificate (in the form of a .pem file) from Electron to my backend (using gevent) and encountering the following error
(node:18946) electron: Failed to load URL: https://...
0
votes
1
answer
130
views
Celery executes tasks sequentially, one after another
I have a Django application that has large I/O-bound tasks.
I use Celery to run these tasks in threads and manage the progress in the UI with a progress bar.
Here's my configuration :
Django version : ...
1
vote
1
answer
46
views
list of users who are online - Flask Gunicorn Gevent
I have a Flask application (for user authentication I use flask-login, flask-session). I use gunicorn with gevent and flask_socketio to run it.
I have a task to display a list of users who are online ...
0
votes
0
answers
102
views
How do I make google pubsub work with Locust?
I'm trying to implement a GCloudSubUser for the Python library Locust. I'm implementing this custom User because I need the user to:
send a message to a topic of Google Pub/sub
The issues seems to be ...
1
vote
1
answer
175
views
Why does gevent affect the asyncio usage of child thread?
gevent version: 20.10.2
Python version: cPython 3.9
Operating System: macOS 14.3.1(M3)
Description:
I use gevent patch for my program, but in the program, I need to execute asyncio related code in ...
2
votes
4
answers
1k
views
How to suppress "Invalid HTTP method" error message on gevent flask/wsgi server running HTTP when it gets an HTTPS request
If a confused user of my application accidentally makes an HTTPS call against my "plain" flask server (expecting an HTTP request) running gevent, I get a log message that I dont know how to ...
0
votes
1
answer
347
views
Recursion Error when s3 client is initialized within Inference script for my SageMaker Endpoint
I need help with this recursion error maximum recursion depth exceeded from boto3. This happens when I initialize an s3 client in my inference script to allow me read s3 objects. Your insights will be ...
0
votes
1
answer
858
views
Flask Socket IO with gunicorn + gevent
I am trying to run a flask app that includes web-sockets and it uses flask_socketio.
My Python code is as follows
from flask import jsonify, request, Flask
from flask_cors import CORS
from ...
1
vote
0
answers
139
views
Celery worker does not start running when using the geventpool and starting from within Python
I have a Celery system running, with 4 queues, using RabbitMQ as the broker.
Currently this system is running using the gevent workerpool, and it is working fine when starting the worker from the ...
1
vote
1
answer
180
views
what is difference from parallel option and no-wait option in pyinfra
I wonder what is difference from parallel option and no-wait option in pyinfra.
I understand parallel option controls the number of host at once and no-wait option controls if the host operations work ...
1
vote
0
answers
765
views
Flask | Socketio | Gevent or Eventlet | Windows IIS.....do these things work together?
I have a flask application that I implemented socketio on. In the local debugger it works. Through IIS the connections are not stable. Here is a snip of the console:
console_image
The logs show my ...
1
vote
1
answer
1k
views
Combining Celery Gevent Pool with asyncio (asgiref)
I have lots of async code which is used for websocket connectons. Idea is simple: fetch data from websocket, calculate some math and do lots of io.
data = await websocket.recv()
# Do some math
...
0
votes
0
answers
487
views
ssl.SSLError: [SSL: BAD_LENGTH] bad length (_ssl.c:2483) from gevent when mqtt payload size is more than 100kb
I have a Python Flask app that publishes messages to the MQTT topic and subscribes from the MQTT topic. It is deployed on Kubernetes and runs on gunicorn with the gevent worker class.
The app creates ...
0
votes
1
answer
626
views
Async Flask endpoint does not work concurrently due to "You cannot use AsyncToSync in the same thread as an async event loop" error
Here is a minimal blueprint to reproduce the issue:
@my_blueprint.route('/my_route', methods=['POST'])
async def my_route() -> Response:
await asyncio.sleep(5)
return format_json_response(...
1
vote
1
answer
1k
views
Using Auto-py-to-exe with MULTIPROCESSING lib: UndefinedEnvironmentName: 'extra' does not exist in evaluation environment
I am trying to create an .exe of my python application that I run from the server.py script. I am using Auto-py-to-exe in one directory mode which gives me the following command:
pyinstaller --...
1
vote
0
answers
93
views
Conflict between grequests / gevent and sshtunnel
I'm working on a web scraper that makes use of grequests, and then sshtunnel to store the data in a database.
However importing grequests and sshtunnel causes Error reading SSH protocol banner cannot ...
0
votes
0
answers
332
views
HTTP requests not working when using Gunicorn geventwebsocket.gunicorn.workers.GeventWebSocketWorker but socketio web sockets are
I am trying to deploy my flask app on a headless pi. My flask app uses Socketio to create websockets to push sensor data to my routes. I also also use flask WTForms in my flask app. The flask app ...
0
votes
1
answer
1k
views
Celery throwing error when started with --pool gevent but works fine otherwise
I have a celery task like so:
from celery import Celery
from asgiref.sync import async_to_sync
from celery_app.celery_commands import some_async_command
import os
redis_connection_string = os.environ....
2
votes
0
answers
681
views
python3.11 + Celery + Gevent -> "returned NULL without setting an exception"
When running celery worker on a container using python3.11 with redis as a broker - I am getting the following exception.
Downgrading to python 3.10 solves the problem, but is there another solution?
...
1
vote
2
answers
856
views
Call trio from inside a greenlet
I've tried this:
import trio
from gevent import monkey, spawn
monkey.patch_all()
async def async_double(x):
return 2 * x
def run():
return trio.run(async_double, 3)
g = spawn(run)
g.join()
...
0
votes
1
answer
200
views
Use gevent library instead of greenlet library
I have a discrete event simulation that (optionally) works with greenlets from the greenlet module.
The event loop is entirely controlled by me.
However, I think the gevent module is better maintained ...
0
votes
1
answer
116
views
TypeError: cannot pickle 'LockType' object
I am trying to create a flask application with rq redis which stores tasks that returns the data scraped by playwright library.
What I am trying to do is to create a global browser instance of ...
2
votes
0
answers
901
views
Unexplained high CPU usage of Celery worker and beat when started with Nginx and Gunicorn
I have two applications in Digital Ocean with the following commands at startup:
app1
sh run.sh # It starts celery worker, beat, nginx, gunicorn
app2
sh run-worker.sh # It starts celery worker, ...
1
vote
1
answer
388
views
Use gevent with parameter in working routine and return result-value?
i have the following working code:
from gevent import monkey; monkey.patch_all()
from gevent.pool import Pool
import time
def work(x):
time.sleep(1) # Or use requests.get() or something else IO-...
1
vote
0
answers
233
views
Gevent worker is blocked by SQLAlchemy's query
I am running a Flask app using gunicorn with only 1 gevent worker and using MySQL database via SQLAlchemy with mysql-connector and executing a long-time query.
When issuing two API calls ...
0
votes
2
answers
953
views
gevent 20.6.2 failure, exit code: 1, while installing bigchaindb on ubuntu 22.04
I am attempting to install BigchainDB Version 2.2.2 on my Ubuntu 22.04 machine.
I entered the code
sudo pip3 install bigchaindb==2.2.2
The installation went part of the way before exiting and ...
0
votes
0
answers
370
views
How to use Gevent/ asyncio if I already use ThreadPoolExecutor() in my code
I've developed a Flask app where I use ThreadPoolExecutor(max_workers=4) in my code.
I use this pool of threads when I send API requests to 3rd parties, in order to work in an asynchronous fashion.
I ...
0
votes
2
answers
1k
views
How to setup gevent monitor thread with gunicorn
I am using gevent workers with gunicorn for my flask application. I am facing issues where my greenlets are getting blocked for long periods. gevent provides monitoring
via monitor threads. Is it ...
1
vote
0
answers
867
views
Using requests with gunicorn gevent worker creating high latency
I am using gevent workers with gunicorn for my flask application that exposes some http endpoint. Within this http endpoint execution flow I make a request to another http endpoint to fetch some data. ...
2
votes
1
answer
506
views
Workload Identity stops working when using gevent monkey patching
I have an application which includes a Flask API server and a worker to process messages from PubSub. These run as separate containers on separate pods in Kubernetes.
I've migrated to using Workload ...
0
votes
0
answers
621
views
ImportError: DLL load failed while importing _greenlet: The specified module could not be found
I tried running the command "python -m auto_py_to_exe" on Visual Studio Code/Command Prompt on a Windows 10 Virtual Machine using Python 3.9.0, Python 3.10.0/3.10.11 as well as Python 3.11.
...
1
vote
1
answer
1k
views
How to make Celery I/O bound tasks execute concurrently?
The only thing my Celery task is doing is making an API request and sending the response back to Redis queue. What I'd like to achieve is to utilize as many resources as possible by executing tasks in ...
1
vote
0
answers
242
views
Cannot install gevent on Mac M1
Cannot install gevent inside venv: on Mac M1 (OS Ventura 13.3.1 (22E261)), python 3.9
Running '(cd "/private/var/folders/6j/khw733_d6w52dc93lqy5d0lc0000gq/T/pip-install-bhh121m3/...
3
votes
0
answers
470
views
BrokenPipeError inside gevent library when it is used with Celery. How to overcome the issue?
We use Celery with gevent worker in our application. Workers are run as separated docker containers.
How we run Celery:
celery -A app.worker worker --pool=gevent --loglevel=info --concurrency=50 -E -n ...
2
votes
0
answers
223
views
Running locust in docker produces OSError: [Errno 97] Address family not supported by protocol
I am running locust in Docker (version 23.0.3). I keep getting the following error:
[2023-04-08 02:12:15,725] 044913c8d54a/INFO/locust.main: Starting web interface at http://0.0.0.0:8089 (accepting ...
0
votes
0
answers
2k
views
Can't install gevent
I apologize for the wall of code, however, I no longer understand how to solve this problem
I'm a newbie, but I've already followed all the basic recommendations, to no avail, maybe someone can point ...