??????????
?????????????????????????(???????????????????????????????ip??)??
????????????1???2048M??棬40G????
??????????nginx??helloworld???????????abtest??
???????abtest??????????????????????????????????????????????Ч???治???rps??100??????????2700??
????helloworld
??????????nodejs??helloworld:
????varhttp =require('http');
????vari =0;
????http.createServer(function(req?? res){
????console.log(i++);
????res.writeHead(200?? {'Content-Type':'text/plain'});
????res.end('Hello World ');
????}).listen(1337??"0.0.0.0");
????console.log('Server running at http://0.0.0.0:1337/');
????url-mapping
????????urlmappingд?????python???:
????importhashlib
????m2 = hashlib.md5()
????current = "hello world"
????f = open('./url.map'??'w')
????foriinrange(100):
????m2.update(current)
????current = m2.hexdigest()
????f.write('~^/hello/world/'+ current +'\b(?[^/]*)*/?$ /; ')
????f.close()
????nginx?????
????server {
????listen 80;
????server_name 120.26.138.197;
????location ^~ /{
????if ($new) {
????proxy_pass http://120.26.138.197:1337$new;
????break;
????}
????return 404;
????}
????}
????abtest
????rps????(request per second)
??????????????100000??????????100?????????:
????# ????nginx
????ab -n100000 -c100 120.26.138.197:1337/
????# ??nginx
????ab -n100000 -c100 120.26.138.197/hello/world/5eb63bbbe01eeed093cb22bb8f5acdc3/

???????????????mapping??????????????Ч????????????????????????????????????????????????????????????????mapping???????????????????????????????????100????????
????tpr????(time per request)
????????????????????????????????????????????????????1????
????# ????nginx
????ab -n1000 -c1 120.26.138.197:1337/
????# ??nginx
????ab -n1000 -c1 120.26.138.197/hello/world/5eb63bbbe01eeed093cb22bb8f5acdc3/

???????????????????mapping????????????100000??????????????????????15ms????????????????????150ms??????????????????????????????????????£?mapping???????100w???????????