ppigazzini
ppigazzini
```python import threading import time class Test: def __init__(self): self.task_lock = threading.Lock() self.task_semaphore = threading.Semaphore(4) def access_resource(self, thread_id): if self.task_semaphore.acquire(False): try: with self.task_lock: print(f"Thread {thread_id} is accessing the resource.") time.sleep(0.001)...
```yaml May 13 21:23:56 tests.stockfishchess.org pserve[26408]: request_task too busy May 13 21:23:56 tests.stockfishchess.org pserve[26408]: request_task too busy May 13 21:23:56 tests.stockfishchess.org pserve[26408]: request_task too busy May 13 21:23:56 tests.stockfishchess.org pserve[26408]:...
It's the first proof that waitress threads are for real :)
For years we ran the server with 500 connection_limit and 16 threads, I didn't measure any improvement with 2000 machines 17000 cores in PROD, so I restored the waitress default...
We set 30 second in nginx ```nginx location / { rewrite ^/$ /tests permanent; rewrite ^/tests/$ /tests permanent; proxy_set_header Connection ""; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host:$server_port;...
It's really the job of nginx. We can set connection limit and rate for host, uri, binary_remote_addr, globally or even for any single path. ```nginx limit_conn_zone $host zone=perhost:10m; limit_conn perhost...
set 10 connections in nginx (like the waitress threads), tested opening 50 connections concurrently. ```yaml 2024/05/14 00:52:57 [error] 13428#13428: *790 limiting connections by zone "per_host_conn", client: ***.***.***.***, server: tests.stockfishchess.org, request:...
set 30 connections in nginx and 10 connections in waitress (like the 10 threads). IMO the web works with queue to deal with spikes, and we don't want the worker...
Commented out the nginx limit. 
I need some time to review the whole userdb logic, but reading the code on the fly the error should require that the `user_cache` contains an user not present in...