V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
hooopo
V2EX  ›  问与答

处理 20k rps 需要什么服务器配置?

  •  
  •   hooopo · 2021-03-26 14:23:49 +08:00 · 1092 次点击
    这是一个创建于 1098 天前的主题,其中的信息可能已经有所发展或是发生改变。

    最近压测了一下Hypercable Analytics,使用一台 8c32g 的 vultr 云服务,所有服务( redis 、sidekiq 、rails 、openresty 、timescaledb )在这台机器上,测试了一下从请求到入库的性能:

    大概的处理结果是:

    • 队列到插入数据库性能:2648 records/sec
    • http 请求性能:6388 request/sec

    如果把 sidekiq 关掉,单独测试 http 请求性能,大概可以处理 25k/s,就是说把每个服务单独部署的话,25k/s 算是 hypercable analytics 在 8c32g 单机处理的极限了。

    siege -R <(echo connection = keep-alive) -c50 -b -t 50S  'http://10.40.96.5:8000/c7f4edce-58c3-4917-8f18-a2ea6c1b93dc/g/collect?en=page_view&v=2&tid=G-JEX4JP2G1E&gtm=2oe161&_p=1322479532&sr=1440x900&ul=zh-cn&cid=1162070685.1609784219&dl=https%3A%2F%2Fhypercable.github.io%2Fsite%2F%3Fto%3Dget-start&dr=https%3A%2F%2Fhypercable.github.io%2Fsite%2F%3Fto%3Dlearn-more&dt=ga%20test&sid=1611145231&sct=34&seg=1&_s=1'   -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36'   -H 'content-type: text/plain;charset=UTF-8'   -H 'accept: */*'   -H 'origin: https://hypercable.github.io'   -H 'referer: https://hypercable.github.io/'   -H 'accept-language: zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7'   -A 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36'a
    ** SIEGE 4.0.4
    ** Preparing 50 concurrent users for battle.
    The server is now under siege...
    Lifting the server siege...
    Transactions:		     1236030 hits
    Availability:		      100.00 %
    Elapsed time:		       49.41 secs
    Data transferred:	        0.00 MB
    Response time:		        0.00 secs
    Transaction rate:	    25015.79 trans/sec
    Throughput:		        0.00 MB/sec
    Concurrency:		       49.40
    Successful transactions:     1236030
    Failed transactions:	           0
    Longest transaction:	        0.04
    Shortest transaction:	        0.00
    

    所有服务都在容器内,可能直接放主机上的话,会稍微有些提升?

    3 条回复    2021-03-26 15:20:02 +08:00
    msg7086
        1
    msg7086  
       2021-03-26 14:54:23 +08:00
    GCP 性能测试,8c 的 EPYC 性能和我 4c8t 的 i7-3770 基本相当。
    你这个 vultr 8c 我估摸着也就是个差不多的水平?
    可以弄一台新一点的比如说 i3-10300 或者 R5-3600 这个水平的独服来跑一下分。
    whileFalse
        2
    whileFalse  
       2021-03-26 15:06:30 +08:00
    @msg7086 云里面 x86 架构的 8c 就是 4c8t,如果这个云没超卖的话。
    arm 架构的 8c 就是 8c,因为 arm 的 cpu 没有超线程。
    captain2011
        3
    captain2011  
       2021-03-26 15:20:02 +08:00
    这种最终还得检测业务压力在哪,然后调整配置吧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1383 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 23:40 · PVG 07:40 · LAX 16:40 · JFK 19:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.