性能

  • 性能,  技术,  网络

    How to debug slowness of remote calls?

    This is a good article: https://blog.cloudflare.com/a-question-of-timing/ This is my .curlrc file: --write-out "dnslookup: %{time_namelookup} | connect: %{time_connect} | appconnect: %{time_appconnect} | pretransfer: %{time_pretransfer} | starttransfer: %{time_starttransfer} | total: %{time_total} | size: %{size_download}\n" Run this curl Return:

  • AWS,  性能,  技术

    AWS back-of-envelope latency measure

    Network Roundtrip latency between two instances in the same AZ: sub-millisecond Roundtrip latency between two instances in a different AZ in the same Region: single-digit millisecond Data Transformation costs money. DynamoDB is cross-region replication by default so I assume normally it won’t cost money Data in/out ALB may not cost money if they are in same VPC (not sure) Service DynamoDB: Single-digit millisecond RDS: Single-digit millisecond Redis: sub-millisecond E2E The following data come from real traffic; and since our ECS is multi-region so the data includes traffic between different AZs. EC2 to Salesforce: p95 1s p50 0.6s (upsert) EC2 to DynamoDB: p95 around 20ms p50 20ms (read&write) EC2 to RDS:…

  • 性能,  技术

    Log对于程序运行速度的影响

    这个其实是老话题。但是在生产环境下真的对性能的影响还是很大的。下面是今天实际遇到的一个例子。 14:20的时候turn off log,以前的log是35k/min,减少到10k。 下面是处理速度的提高(除去无用log以外,反应traffic的log数量) 将近10倍的速度提升。 所以,如果看log过多,在我这个case里面一个单线程的程序每分钟produce30k的log,就直接把log level提高看一下性能区别。其实这样做反倒是最简单的。 但是其实真的产品环境下的各种metrics很重要。一个系统慢,应该能立刻看到哪里引起的慢。不过不知道怎么把log的时间单独剥离出来,显示log的运行时间。可能有library可以做这个事情?有人知道么? 顺便: 产品的各种security,不能做这个不能做那个,但是所有的engineer都可以ssh到所有的产品的instance,然后sudo -i. 这个合理么?😂