惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Forbes - Security
Forbes - Security
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
Recent Commits to openclaw:main
Recent Commits to openclaw:main
WordPress大学
WordPress大学
Webroot Blog
Webroot Blog
Jina AI
Jina AI
H
Hacker News: Front Page
Attack and Defense Labs
Attack and Defense Labs
T
Troy Hunt's Blog
TaoSecurity Blog
TaoSecurity Blog
AI
AI
Hacker News - Newest:
Hacker News - Newest: "LLM"
Google Online Security Blog
Google Online Security Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Help Net Security
Help Net Security
美团技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 叶小钗
P
Privacy International News Feed
A
Arctic Wolf
IT之家
IT之家
云风的 BLOG
云风的 BLOG
S
Security Affairs
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
博客园 - 司徒正美
Vercel News
Vercel News
C
Cyber Attacks, Cyber Crime and Cyber Security
SecWiki News
SecWiki News
K
Kaspersky official blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
N
News and Events Feed by Topic
S
Schneier on Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
有赞技术团队
有赞技术团队
PCI Perspectives
PCI Perspectives
F
Fortinet All Blogs
T
Tenable Blog
Spread Privacy
Spread Privacy
T
The Blog of Author Tim Ferriss
S
Securelist
L
LangChain Blog
Latest news
Latest news
Cloudbric
Cloudbric
博客园 - 三生石上(FineUI控件)

isaced

使用 TypeScript 构建的 appstore-connect-sdk 归档 我用 SwiftUI 写了一个 V2ex 客户端 Docker 容器化多应用部署 Swift Server-side SDWebImage 为什么无法读取 webpmux 生成的 WebP 动图? [译] 探索 Swift 4 中新的 String API fir-mac 开发笔记 iOS10 Safari 引导用户信任企业签名 Swift Web 开发之 Vapor - 模版 Leaf(三) Swift Web 开发之 Vapor - 路由(二) HoloLens 初体验 Swift Web 开发之 Vapor - 入门(一) Jenkins for iOS 搭建日记 iOS HOOK 注入与重签名 Xcode 使用 Configuration 来配置不同的项目环境 图床从SAE迁移到七牛 给 UIProgressView 脱掉那层微弱的渐变 初用 CocoaAsyncSocket 记一次 SQLite 性能优化 有多色 - 开发小记 海岛风情 - 泰国普吉岛六日游 EGOCache 源码解析 日语五十音假名临摹校验算法 [iOS] UITextView 追加文字自动跳到顶部解决方法 Cocoa 新的依赖管理工具:Carthage 新年快乐! 博客主机换到搬瓦工 写了个iOS小游戏:有多色 iOS 后台任务之 Long-running background task 悄悄的就必须用 XCode 5.1.1 上传了! HTTP Content-type 与 AFNetworking Objective-Cloud 初体验(1) 掌中站上架小记 NSLoger 上线了 Python Markdown 做语法限制 Nginx + Gunicorn + Django 部署小记 用Shell脚本批量裁剪App Icon各个尺寸 LaunchRocket使用小记 用宏提速NSCoding 2014新年伊始:近期读过的好文推荐 [iOS] stringWithFormat 和 initWithFormat 有何不同? Apache + Flask + mod_wsgi + Koding 部署小记 收集几个Objective-C的HTML解析库 NSMapTable: 不只是一个能放weak指针的 NSDictionary 2013,再见! Emlog到Typecho的迁移工具:emlog2typecho [iOS]给上拉下拉刷新PullToRefresh做本地化 [iOS]代码推荐:大图缩放视图 - Vertigo iOS:hidesBottomBarWhenPushed的正确用法 Xcode 5新的Interface Builder,你准备好了吗? [翻译]如何使用Django创建简单的博客 我的Mac音乐播放器 初识 NSDataDetector Objective-C 计算代码运行时间 WordPress上传文件自动重命名 iOS:仿jing.fm的音乐播放视图 我的啃黑苹果之路 关于 搜索 项目
对一个 Django 站点做 ab 压力测试
2017-06-05 · via isaced

今天想起来测测一个小 Django 站点的性能和压力,寻找一下看有没有内存泄漏,先介绍下服务器的信息,站点部署在 Google Cloud Platform,实例尺寸是微型(1 共享 vcpu, 0.6GB 内存),价格大致是($4.28/月 估算值),地区是 asia-east1-c,速度还是挺快,由于之前送的 300 刀还没用完,所以不用担心钱钱问题。

部署方式主要参照的这篇文章 《How To Set Up Django with Postgres, Nginx, and Gunicorn on CentOS 7》,大致内容如下:

  • CentOS 7
  • Python 3.6.1
  • Nginx 1.10.2
  • Gunicorn 19.7.1
  • Virtualenv 15.1.0
  • Django 1.11.1

测试命令:

ab -c 5 -n 1000 http://www.cocoaz.com/

结果:

This is ApacheBench, Version 2.3 <$Revision: 1757674 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.cocoaz.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        nginx/1.10.2
Server Hostname:        www.cocoaz.com
Server Port:            80

Document Path:          /
Document Length:        15823 bytes

Concurrency Level:      5
Time taken for tests:   277.324 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      16049000 bytes
HTML transferred:       15823000 bytes
Requests per second:    3.61 [#/sec] (mean)
Time per request:       1386.619 [ms] (mean)
Time per request:       277.324 [ms] (mean, across all concurrent requests)
Transfer rate:          56.51 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       21  208 425.4     24    3162
Processing:   100 1170 1442.9    801   20850
Waiting:       76  702 661.3    488    4786
Total:        124 1378 1561.5   1034   20883

Percentage of the requests served within a certain time (ms)
  50%   1034
  66%   1501
  75%   1807
  80%   2000
  90%   3014
  95%   3816
  98%   5270
  99%   6200
 100%  20883 (longest request)

StackDriver 监控状态:

监控状态

通过监控能看到 CPU 使用率最高飙到了 90%,内存一直稳定在 50% 左右倒是没怎么变化,所有请求都成功返回。