Open Startonix opened 4 months ago
multithreading_example.py
import threading
def task(): print("Task running")
threads = [] for i in range(10): t = threading.Thread(target=task) threads.append(t) t.start()
for t in threads: t.join()
NGINX Load Balancer Configuration
nginx_load_balancer.conf
upstream backend { server backend1.example.com; server backend2.example.com; }
server { listen 80; location / { proxy_pass http://backend; } }
multithreading_example.py
import threading
def task(): print("Task running")
threads = [] for i in range(10): t = threading.Thread(target=task) threads.append(t) t.start()
for t in threads: t.join()
NGINX Load Balancer Configuration
nginx_load_balancer.conf
upstream backend { server backend1.example.com; server backend2.example.com; }
server { listen 80; location / { proxy_pass http://backend; } }