V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  dongruixuan  ›  全部回复第 1 页 / 共 1 页
回复总数  14
145 天前
回复了 hard2reg 创建的主题 问与答 如何提升 FastAPI 的 RPS 上限
简单测了下 rust ,用的 actix-web 。CPU i5-13600K, 在 WSL 下运行。RPS 1.38M
```shell
wrk -t8 -c750 -d10s http://127.0.0.1:8000/api/ping.gif
Running 10s test @ http://127.0.0.1:8000/api/ping.gif
8 threads and 750 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 535.49us 767.36us 14.77ms 90.42%
Req/Sec 175.31k 19.72k 209.16k 76.43%
13988354 requests in 10.10s, 2.11GB read
Requests/sec: 1384945.09
Transfer/sec: 213.97MB
```
如果 wrk 用 2 线程 750 连接只能打到
```
wrk -t2 -c750 -d10s http://127.0.0.1:8000/api/ping.gif
Running 10s test @ http://127.0.0.1:8000/api/ping.gif
2 threads and 750 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.05ms 0.98ms 10.72ms 59.25%
Req/Sec 92.84k 3.88k 98.45k 85.86%
1851767 requests in 10.10s, 286.09MB read
Requests/sec: 183347.71
Transfer/sec: 28.33MB
```
代码如下
```rust
use actix_web;
use actix_web::{get, App, HttpResponse, HttpServer, Responder};

const TRANSPARENT_GIF: &'static [u8] =
b"\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00
\xff\xff\xff\x21\xf9\x04\x01\x00\x00\x00\x00\x2c\x00\x00\x00\x00
\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3b";

#[get("/api/ping.gif")]
async fn transparent_image() -> impl Responder {
HttpResponse::Ok()
.append_header(("Content-Type", "image/gif"))
.body(TRANSPARENT_GIF)
}

#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.service(transparent_image)
})
.bind(("127.0.0.1", 8000))?
.run()
.await
}
```
324 天前
回复了 evilStart 创建的主题 Cursor 服了,天天都有 cursor 的帖子
只知道有个同事用 cursor 的 pylance + type checking 的时候会报莫名其妙的类型错误,换到 vscode+同版本的 pylance 就好了
这个关联性确定有吗,会不会是开了 swap 什么的
339 天前
回复了 bluebird007 创建的主题 程序员 在工作中遇到了很恶心的需求该怎么办
"只能在 prod 来验证" 这个能录制下 prod 的流量,在测试环境回放吗?
2024-12-04 03:40:11 +08:00
回复了 pzict 创建的主题 算法 nvida jetson 替代品
稍微多点能上 mac mini?
2024-11-14 06:50:25 +08:00
回复了 pol 创建的主题 问与答 有没有这样的 sql 分析工具, mysql 举例
postgres 的话,这种 visualizer 感觉就很够用了 https://pev2.pages.dev/ 。是不是不太需要把数据集显示出来
2024-10-03 05:15:48 +08:00
回复了 CNM47589 创建的主题 Android 为啥 vivo iqoo 的 Origin os 把以太网网络共享这个功能删掉了
@nyxsonsleep 意思应该是和热点一样,自己可以作为到互联网的网关,手机接个网线到路由器 wan 口,整个路由器下的设备就都能通过这个手机上网?
2024-10-03 05:05:47 +08:00
回复了 googlefans 创建的主题 问与答 国内网站接入 Cloudflare 服务,为什么网站打不开了
301 permanent redirect 应该是给你重定向到 https ? curl 的时候指定 https 了吗
因为不用 serialize?MPI 应该得把数据 serialize 后才能发到其他进程吧,相比之下多线程可以直接用 threadsafe 的 queue 之类的就行
2024-04-03 00:05:01 +08:00
回复了 gtese 创建的主题 Local LLM 离线大模型有支持文档翻译的吗
34b 8bit 量化理论两个 4090 也能跑吧
2024-02-15 11:30:05 +08:00
回复了 whlweb 创建的主题 iOS iOS app 如何识别设备
应该是用 keychain 实现的。https://www.v2ex.com/t/916353
2024-01-13 00:21:09 +08:00
回复了 tmtstudio 创建的主题 程序员 抓包遇到奇怪问题一则,求大佬指点
那肯定是抓包方式不对了,是不是 http 代理方式抓的包,应用可以不走代理
2023-05-10 14:26:16 +08:00
回复了 Chandleric 创建的主题 Apple FaceTime 共享屏幕卡顿
可以搭一个 jellyfin ,自带 syncplay 功能。建好群组以后双方都可以控制播放进度,然后自动同步给对方。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   3029 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 29ms · UTC 12:50 · PVG 20:50 · LAX 04:50 · JFK 07:50
♥ Do have faith in what you're doing.