#AsyncIO
Misleading LLM load tests can warp your architecture decisions and cost projections.

Ad hoc LLM load tests often mislead on performance due to single-process limits like Python's GIL. AIPerf and similar tools address this by simulating realistic loads, crucial for accurate…

Read more on Kimbodo:
How to Build Reliable, Cost‑Effective LLM Inference: Hardware, Cloud Services, and Deployment Tooling
What Happened Teams deploying large language models (LLMs) routinely discover that common ad hoc load tests — curl loops, asyncio scripts, or single-process generators — give misleading latency and throughput…
kimbodo.com
September 25, 2026 at 10:10 PM
📦 phasync/phasync 2.0.0-alpha2

phasync asyncio library for PHP, providing seamless and efficient coroutines via PHP fibers

🔗 https://github.com/phasync/phasync
September 25, 2026 at 4:00 PM
🚨 EUVD-2026-83191
📊 7.0/10
🏢 agronholm

📝 AnyIO is a high level asynchronous concurrency and networking framework that works on top of either Trio or asyncio. In 4.14.0, AnyIO accepts the POSIX ...

🔗 https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-83191

#cybersecurity #infosec #cve #euvd
September 24, 2026 at 10:01 PM
just saw some python asyncio for the first time in years and was reminded that the most basic "hello world" is still worse than the evilest tokio code I've ever seen
September 23, 2026 at 6:50 PM
AIPerf: 서버 성능 측정 시, 부하 생성기가 병목이 되지 않도록 NVIDIA가 개발 및 공개한 LLM 추론 벤치마크 도구

AIPerf 소개: 측정 도구가 측정 대상을 가려 버리는 문제

모델을 서버에 올리고 프롬프트를 던지면 응답이 돌아옵니다. 그다음에 반드시 나오는 질문은 "이거 빠른 건가요?" 입니다. 이 질문에 답하려고 개발자들이 가장 먼저 하는 일은 대개 curl을 몇 번 날려 보거나, asyncio 기반의 짧은 부하 스크립트를 직접 짜거나, 일회용 부하 생성기를 하나 더 만드는 것입니다. NVIDIA 기술 블로그가…
AIPerf: 서버 성능 측정 시, 부하 생성기가 병목이 되지 않도록 NVIDIA가 개발 및 공개한 LLM 추론 벤치마크 도구
AIPerf 소개: 측정 도구가 측정 대상을 가려 버리는 문제 모델을 서버에 올리고 프롬프트를 던지면 응답이 돌아옵니다. 그다음에 반드시 나오는 질문은 "이거 빠른 건가요?" 입니다. 이 질문에 답하려고 개발자들이 가장 먼저 하는 일은 대개 curl을 몇 번 날려 보거나, asyncio 기반의 짧은 부하 스크립트를 직접 짜거나, 일회용 부하 생성기를 하나 더 만드는 것입니다. NVIDIA 기술 블로그가 지적하는 문제는 이 세 갈래가 결국 같은 곳에서 무너진다는 점입니다. 단일 프로세스의 성능 한계에 걸리거나, 파이썬의 전역 인터프리터 잠금(Global Interpreter Lock, GIL) 이 동시성을 제한하거나, 애초에 자기가 만든 기준선에 대고 측정한 숫자가 나옵니다. 어느 쪽이든 완전히 신뢰하기 어려운 결과가, 요구사항이 바뀌는 순간 다시 짜야 하는 도구에...
discuss.pytorch.kr
September 22, 2026 at 9:01 AM
python-nats-py
Asyncio NATS client for Python
aur.archlinux.org
September 20, 2026 at 10:34 PM
非同期処理の常識を覆す、Python asyncioとGo goroutineの設計思想をコード例3つで比較するZenn記事を読んだ。エラー処理の伝搬方法や並行数制御の違いが鮮明で、実装時の頭の切り替えが必要になる。休憩時間に3分で概要を掴める構成もありがたい。もう1本、SQLインデックス設計のB-treeとハッシュ比較も実践的だった。川西の猪名川土手を歩きながら、どのパターンで書くか反芻している。
September 20, 2026 at 6:11 AM
Stop writing manual security scripts from scratch. Use `scapy` for packet manipulation and `python-nmap` for automation.

Pro-tip: Use Python’s `asyncio` to speed up your port scans by 10x. Efficiency is your best defense. 🛡️

#PythonSec #InfoSec #DevSecOps
September 17, 2026 at 5:58 PM
Observability Beyond Logs: Implementing OpenTelemetry in Distributed Python Services
Stop grepping through unorganized log streams. Here is how to implement structured distributed tracing, context propagation, and custom span metrics in FastAPI and Python backend services. ### The Limits of logging.info() When backend services run locally, debugging is simple: throw in a few print() statements or use standard Python logging to follow execution flow. However, once your backend scales into asynchronous tasks (asyncio), concurrent background workers (Celery/ARQ), and distributed microservices, traditional stdout logs hit a wall: * **Interleaved Log Streams:** Concurrent requests interleave log statements across threads, making it impossible to reconstruct a single user’s request path. * **Silent Bottlenecks:** A query takes 2.4 seconds, but standard logs can’t pinpoint whether the delay occurred in DB connection pooling, HTTP serialization, or external API calls. * **Context Loss:** When an HTTP request triggers an async worker, correlation IDs are lost across thread boundaries. To solve this, modern production systems use **OpenTelemetry (OTel)** the vendor-agnostic CNCF standard for collecting traces, metrics, and logs. This hands-on guide walks through implementing production-grade OpenTelemetry tracing in Python and FastAPI, handling asynchronous context propagation, and defining custom spans for silent performance bottlenecks. ### The Core Architecture of OpenTelemetry Before writing code, it is vital to understand how telemetry signals flow from your application to an observability backend (like Jaeger, Grafana Tempo, Datadog, or Honeycomb): * **TracerProvider:** The central factory object that holds resource attributes (e.g., service name, environment) and global configuration. * **Tracer:** The object used within your code to start and end execution units. * **Span:** A single timed block of work (e.g., a database query, an outbound HTTP fetch, or a execution function). A collection of nested spans forms a **Trace**. * **BatchSpanProcessor:** An in-memory queue that batches spans asynchronously before sending them to prevent blocking application execution. ### Setting Up Automatic Instrumentation in FastAPI Let’s start by installing the required OpenTelemetry packages: pip install opentelemetry-api \ opentelemetry-sdk \ opentelemetry-exporter-otlp \ opentelemetry-instrumentation-fastapi \ opentelemetry-instrumentation-httpx ### Initializing the OpenTelemetry SDK Here is how to construct a robust initialization module (telemetry.py) that handles tracer configuration and configures automatic span batching: # telemetry.py import os from opentelemetry import trace from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter from opentelemetry.sdk.resources import Resource def setup_telemetry(service_name: str = "order-processing-service") -> trace.Tracer: # 1. Define Resource Metadata (Metadata attached to every trace) resource = Resource.create( attributes={ "service.name": service_name, "deployment.environment": os.getenv("ENV", "production"), } ) # 2. Instantiate global TracerProvider provider = TracerProvider(resource=resource) # 3. Configure OTLP gRPC Exporter (pointing to collector or Jaeger) otlp_exporter = OTLPSpanExporter( endpoint=os.getenv("OTEL_EXPORTER_OTLP_ENDPOINT", "http://localhost:4317"), insecure=True, ) # 4. Wrap with BatchSpanProcessor to avoid blocking the main event loop processor = BatchSpanProcessor(otlp_exporter) provider.add_span_processor(processor) # 5. Register global tracer provider trace.set_tracer_provider(provider) return trace.get_tracer(service_name) ### Instrumenting FastAPI Endpoints & Asynchronous Operations Once the provider is registered, instrument your FastAPI application and add custom manual instrumentation for deep internal functions using context managers. # main.py import asyncio import httpx from fastapi import FastAPI, HTTPException from opentelemetry import trace from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor from telemetry import setup_telemetry # Initialize global telemetry setup tracer = setup_telemetry("payment-api") app = FastAPI(title="Order API") # Automatically instrument incoming FastAPI HTTP routes FastAPIInstrumentor.instrument_app(app) # Automatically propagate context over outgoing HTTPX client calls HTTPXClientInstrumentor().instrument() async def query_fraud_detection_service(user_id: str) -> bool: """Simulates an internal asynchronous database or microservice call.""" # Create a explicit custom child span with tracer.start_as_current_span("fraud_check_db_query") as span: # Attach high-value metadata attributes to the span span.set_attribute("user.id", user_id) span.set_attribute("db.system", "postgresql") await asyncio.sleep(0.15) # Simulate DB latency # Record events for specific milestones within a span span.add_event("fraud_score_evaluated", {"risk_score": 0.02}) return True @app.post("/checkout/{order_id}") async def process_checkout(order_id: str, user_id: str): # Obtain current active span created automatically by FastAPIInstrumentor current_span = trace.get_current_span() current_span.set_attribute("order.id", order_id) # Execute custom child function is_safe = await query_fraud_detection_service(user_id) if not is_safe: current_span.set_status(trace.Status(trace.StatusCode.ERROR, "Fraud detected")) raise HTTPException(status_code=400, detail="Transaction flagged") # Outbound HTTP calls will automatically propagate w3c traceparent headers async with httpx.AsyncClient() as client: with tracer.start_as_current_span("external_payment_gateway_call"): # The HTTPX instrumentor automatically attaches trace headers here response = await client.get("https://httpbin.org/delay/1") return {"status": "success", "order_id": order_id} ### Context Propagation Across Async Boundaries One of the most common pitfalls in Python backend observability occurs when passing context to background workers (such as ARQ, Celery, or bare asyncio.create_task). Without explicit context propagation, the trace context breaks, and the background execution appears in your observability UI as an unattached, rootless trace. ### Injecting & Extracting Context Manually When enqueuing a background job, inject the W3C traceparent headers into the task payload: from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator # 1. INJECT CONTEXT (Before enqueuing background task) def enqueue_background_job(payload: dict): carrier = {} # Extract current active context into carrier dict TraceContextTextMapPropagator().inject(carrier) # Store carrier trace headers alongside worker payload payload["_trace_context"] = carrier background_worker_queue.send(payload) # 2. EXTRACT CONTEXT (Inside Worker Process) def process_background_job(payload: dict): carrier = payload.get("_trace_context", {}) # Extract parent context from dictionary extracted_context = TraceContextTextMapPropagator().extract(carrier) # Start worker span attached directly to the original parent trace context with tracer.start_as_current_span("worker_process_task", context=extracted_context): print(f"Processing background task for order: {payload.get('order_id')}") ### Best Practices Checklist Shifting from passive logging to active OpenTelemetry tracing changes how production bottlenecks are identified and solved. ### Observability Best Practices for Python Developers: 1. **Never Block the Event Loop:** Always wrap your OTLP exporters in a BatchSpanProcessor to avoid adding network overhead to application threads. 2. **Instrument System Boundaries:** Ensure outbound HTTP clients (httpx, requests) and database drivers (SQLAlchemy, psycopg3) are instrumented so trace boundaries cross network hops cleanly. 3. **Control Attribute Cardinality:** Do not attach raw passwords, personally identifiable information (PII), or high-cardinality unique IDs (e.g., thousands of raw raw UUID strings) as span names. Store high-cardinality variables inside span attributes. 4. **Leverage Status Codes & Exceptions:** Call span.record_exception(e) inside try...except blocks to surface full exception stack traces directly inside flamegraph UI visualizations. ### Need High-Impact Technical Content for Your Team? I help engineering-focused companies, developer-tooling startups, and SaaS platforms explain complex infrastructure, backend architecture, and developer tooling through publication-grade articles. Whether you need deep-dive technical essays, developer guides, or architecture counter-narratives, feel free to reach out: * 📩 **Email:** abhishekninja2018@gmail.com * 💼 **LinkedIn:** linkedin.com/in/abhishekninja * 🛠️ **Capabilities:** Long-form Technical Essays | Hands-On Developer Tutorials | System Architecture Breakdowns | Benchmarks & Product Comparisons
dev.to
September 17, 2026 at 9:39 AM
Next speaker announced 🎉

Taras Kozlov opens up the asyncio event loop. call_soon, transports, protocols, streams, reactor vs proactor. All the machinery under your await ⚙️

15 October, Utrecht 🐍

#PyConNL #Python
September 17, 2026 at 7:00 AM
Advanced asyncio, Practically Python: Reliable concurrency in modern Python — structured concurrency, cancellation, backpressure and graceful shutdown by Nix is a new release on Leanpub!

A tutorial teaches you async, await, and an event loop. … leanpub.com/advanced-asy...
September 16, 2026 at 10:45 PM
I think I have an interesting mitigation to the function coloring problem for single-threaded async/await-style languages... I'm curious if anyone's tried this.

It's like Python's asyncio .run() but supports nesting and scoped microtask queues...
September 16, 2026 at 6:43 PM
266 lines of Python to make FastAPI return instantly. Background queue with asyncio, no Celery, no Redis. Advanced level, for devs tired of requests timing out on long jobs. https://www.valtersit.com/python/fastapi-background-task-queue-with-asyncio/ #FastAPI #Python #asyncio
September 16, 2026 at 1:00 PM
If you use a service like Modal (which uses asyncio-style cancellation), expect to write a little adapter function whose behavior is like this:

- Create a task in the global task group (see above) which lives in an AnyIO cancel scope.
- Wait on it.
- Respond to CancelledError by killing the scope.
September 16, 2026 at 3:00 AM
You can hold a reference to that task group and pass it around to other parts of your program if you want to fire and forget tasks in the way that you would in asyncio.
September 16, 2026 at 3:00 AM
This is not to downplay the many other gotchas in asyncio. (wait_for and gather are truly awful)

My point is -- the library just comprehensively does not fucking work.
September 16, 2026 at 2:52 AM
The interaction of these features makes the vast majority of asyncio APIs nearly unusable.

For instance, "shield" is intended to protect a task from cancellation -- but cannot protect it from the garbage collector.
September 16, 2026 at 2:52 AM
In short:

- If you exit a program early in asyncio you will create incomplete work items.
- Most will be discarded, even if you used Python's "finally" feature to mark them as non-discardable.
- Others will be executed in totally random order without access to any of their expected context.
September 16, 2026 at 2:52 AM
That is -- when work is discarded, asyncio will execute any `finally` block that existed in an async generator and no `finally` blocks from outside async generators.

In any order, including interleaved. With no access to their contextvars. (analogous to thread locals)
September 16, 2026 at 2:52 AM
That steward holds some kind of reference to the object. It's usually a strong reference. AsyncIO itself will hold a weak reference.
September 16, 2026 at 2:52 AM
The basic mechanism of asyncio: your work can be scheduled and must be scheduled in order to run.

The default way to do this is to await it from a running task. (which suspends the caller to wait for its result)
September 16, 2026 at 2:52 AM
However bad you think asyncio is, it's worse.
September 16, 2026 at 2:36 AM
This week, we will discuss Django, asyncio, multithreading in Python, the Antigravity CLI, PyQt, Anthropic drama & how AI might be a risk for humanity, React Native vs. alternatives for mobile development, A Rust note-taking app in the terminal, TanStack charts
lewoudar.substack.com/p/whats-up-i...
What's up in the python and tech environment? - Issue #228
Welcome to issue #228 of What’s up in the Python and tech environment?
lewoudar.substack.com
September 14, 2026 at 9:30 AM
Async/Await 的設計空間探索 https://cel.cs.brown.edu/blog/design-space-async-await/

非同步等待(async/await)原本的目標,是讓並行程式寫起來像循序程式,免於大量事件迴圈或回呼函式;但 Brown 大學認知工程實驗室的研究指出,不同語言的實際語意差異遠比表面語法大。研究比較 Asyncio、C#、JavaScript、Tokio、Smol、Trio 與 Swift 等七種非同步執行環境,發現一段僅在背景寫入日誌的簡單程式,竟可能產生四種不同輸出;針對三個變體,七種環境甚至沒有任何兩者得到完全相同的結果。 […]
Original post on mistyreverie.org
mistyreverie.org
September 14, 2026 at 2:21 AM
python-aiospamc
Asyncio-based client for SpamAssassin's SPAMD service
aur.archlinux.org
September 12, 2026 at 10:21 PM