TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #425 · 20 апр.

Недавно делал быстрый прототип асинхронного приложения в котором требовалось вызывать много синхронного кода. Да, я знаю, что это не лучший дизайн, но нужно было быстрое решение на один процесс и без очередей. Поэтому я выполнял код в потоках. Выглядело это примерно так: from fastapi.concurrency import run_in_threadpool async def execute(data: DataRequest) -> DataResponse: try: result = await run_in_threadpool(sync_function, data) return DataResponse(data=result) except Exception as e: return DataResponse( error=str(e), success=False, ) В общем работает нормально. Для всех вызовов под капотом используется общий тредпул, всё работает предсказуемо. Но потребовалось изменить количество запускаемых в пуле потоков (по умолчанию создается 40 воркеров). Так как дело происходит с FastAPI, делается это через lifespan используя настройки anyio: import anyio @asynccontextmanager async def lifespan(app: FastAPI): limiter = anyio.to_thread.current_default_thread_limiter() limiter.total_tokens = 100 yield # если вдруг нужно вернуть обратно limiter.total_tokens = 40 Зачем менять количество воркеров? - уменьшить, если оперативки мало (один тред занимает ~8мб) - увеличить чтобы выдержать нагрузку Если есть предложения получше при тех же вводных - предлагайте😉 #async

Hashtags

Резултати

Пронајдени 18 слични објави

Пребарај: #wireguard

当前筛选 #wireguard清除筛选
机场鉴赏 _(:з)∠)_

@AirportAnalysis · Post #349 · 24.08.2022 г., 03:36

#Glados 机场协议: #Trojan#Vmess#Wireguard 有无审计: 有,屏蔽轮子等大部分具有政治色彩的网站。 机场套餐: https://t.me/AirportRoster/16 描述: 一个很神奇的机场,经常送30天Basic套餐的抵扣码,提供edu优惠,免费使用一年。pro套餐提供 #Wireguard 类型节点

Libreware

@libreware · Post #1429 · 06.03.2025 г., 22:42

A post from the developer of #WireGuard on the severe #security flaws and lack of trustworthiness of #FDroid: https://bsky.app/profile/grapheneos.org/post/3lgq7wqwzpk26 The Bluesky link has GrapheneOS posts explaining https://gitlab.com/fdroid/fdroiddata/-/issues/3110#note_1613430404 Stuff here but not to the point like the Bluesky link https://discuss.grapheneos.org/d/18731-f-droid-vulnerability-allows-bypassing-certificate-pinning/

GitHub Trends

@githubtrending · Post #14902 · 03.07.2025 г., 00:00

#go#tailscale#tailscale_control_server#tailscale_server#wireguard Headscale is an open-source, self-hosted alternative to the Tailscale control server, letting you create your own private VPN network using Wireguard technology. It supports key Tailscale features like node registration, DNS, file sharing (Taildrop), access control lists (ACLs), and more, making it ideal for personal or small group use. By running Headscale yourself, you gain full control over your network without relying on Tailscale’s servers, enhancing privacy and customization. You can manage access precisely with ACLs, tag devices for group policies, and use modern VPN benefits like NAT traversal and secure connections between your devices[1][3][5]. This helps you securely connect and control your devices in a private network tailored to your needs. https://github.com/juanfont/headscale

Cool Scripts

@cool_scripts · Post #843 · 08.06.2025 г., 01:52

🔗Sub-Store 中各种 WireGuard 输入/输出格式的说明 🆕 更新了部分格式的示例 但是具体实操还是以相关的规范为准 ⚠ 不要使用 Shadowrocket 来导出 URI 然后作为输入导入。这样导出的 WireGuard URI 不是标准的 URI 😭原消息 🤭Sub-Store 合集 🥰#Sub-Store #SubStore#节点#订阅#本地节点#本地订阅#示例#WireGuard

GitHub Trends

@githubtrending · Post #14789 · 05.06.2025 г., 11:30

#go#golang#mesh#mesh_networks#nat_traversal#netbird#vpn#wireguard#wireguard_vpn#wiretrustee#zero_trust_network_access NetBird lets you quickly set up a secure private network for your organization or home without needing to configure complex firewall rules, open ports, or manage VPN gateways. It uses direct peer-to-peer connections based on WireGuard, so your devices connect to each other securely and efficiently, bypassing the need for a central server. You get strong security with features like access control, activity logging, and support for single sign-on, all managed from a simple web interface. This means you can connect and protect your devices anywhere, with minimal setup and maintenance, making remote access and network management much easier[2][1][5]. https://github.com/netbirdio/netbird

12
ПретходнаСтраница 1 од 2Следна