Django???????????????????????
???????????? ???????[ 2014/7/2 14:42:50 ] ??????????????? ???????
?????????????????????3 ?? ?? ??? ????μ? Django ??????????????? Hey!Wall ??????????????罻?????е?“?”??????????罻?????????????????????????????????????????????????
?????????????????????????????????Щ?????????ú?????????????????????????и??????????? httperf ????????????????????????????????????????
????????????????
??????????????? Slicehost ???? Xen VPS ?????? 256MB ??棬???е??? Debian Etch ??????????????????????
???????????????????λ??????? Xtraordinary Hosting ???? Xen VPS?????????????????????? ADSL ??????????磬???????????????????????????????????????????????? VPS ??????????????????????????????????顣
????????????????
??????????е????????????????? VPS ???? 256MB ??棬??????????? VPS ?????????????????? ??? 16GB ???? Quad Core ???????????????????? 256MB ??????????????????????? 64 ? VPS ?????????????????? 2.4GHz??????? 9.6 GHz ?????? 64 ????? 150MHz ?? CPU ??
?????? Xen VPS ??????辺?????????????????? CPU ????????? ???????κο??е? CPU ?????????á??????????????????? VPS ?????????????? VPS ???????????? CPU ?????????ζ??????????????????? CPU ?????Щ??????????????????????? CPU ?????
??????? httperf ????????
???????и?????????????????????????????? ab (???? Apache)?? Flood ?? httperf????????? httperf ??????κ???????ɡ?
????httperf ?????????????????
????httperf --hog --server=example.com --uri=/ --timeout=10 --num-conns=200 --rate=5
??????????У??????? http://example.com/ ?????? 200 ?η??????????? 5 ?Ρ?
??????????
?????Щ???????????????????????????????????????????????“????”??????????????????????????????
???????????????????????????????????ж????????η?????? 200 ???????? 500 ???????????????????????????????????????顣??????????????? 500 ??????????????
???????????????
??????????????????????????????? CPU ??÷?????????????????????????????? top ????????????????????????????? top ?????????????
????top -b -d 3 -U www-data > top.txt
??????????У?????????? www-data ?????????ν???????????????????????????????????????? -p 1?? 2?? 3 ???????? -U username ?????? 1??2 ?? 3 ?? pid???????????????ID????
???????????????????? FastCGI processes ??????е? Python 2.5 ?? Lighttpd ?????????????????????????????????????м???y????PostgreSQL?????????
??????????????????? vmstat??????? swap ????????ж??????????????????????????????????????棬???????????????????????? vmstat ??????????????μ????????????磺
????vmstat 2
??????? httperf ?????????????
????httperf ??????????? URL ???????? GET ?????????? html ??????????????κ?y??????????????/??????public/anonymous????????????????????????????飬?????????????????????????????
????httperf ???????????????????Django ???У?饗 authentication?????? django.contrib.auth ??????????????????????? cookie ???????????? id ???????????????????????д??? cookie ???????????????????ν??е??
???????????? cookies ?????????????и????? sessionid=97d674a05b2614e98411553b28f909de ??????????? httperf ????? cookie????????? --add-header ???????磺
????httperf ... --add-header='Cookie: sessionid=97d674a05b2614e98411553b28f909den'
????С???????????? n ????????????????????????????????????????
??????
![](/images/ad-banner/ad-banner.png)
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11