GithubHelp home page GithubHelp logo

Comments (4)

codesenberg avatar codesenberg commented on May 28, 2024

Well, I'm not all that familiar with python and requests library, but it seems like when you perform a single request, time to establish TCP connection, do a DNS lookup, etc. is much larger than the time to perform a single request (this is what you do with python). While with bombardier, by default, you establish something like 125 TCP connections, which are reused, and perform as many requests as you can in 10 seconds — 63013 in your case. With this setup, time to establish TCP connections (etc.) becomes negligible compared to the total time spent performing requests and therefore you get the results that you are seeing.
You should probably get something close to your python's results if you use bombardier -n 1 <url>.

from bombardier.

likezjuisee avatar likezjuisee commented on May 28, 2024

bom 1.8ms
requests 286ms

root@ubuntu-HP-ProDesk-680-G2-MT:~/software# ./bombardier-linux-amd64 -n 1 http://10.209.5.34:8013/hotrizon/get-score?m2=0000090ecb899d858576495c70f27a29&qid=123
[1] 15519
root@ubuntu-HP-ProDesk-680-G2-MT:~/software# Bombarding http://10.209.5.34:8013/hotrizon/get-score?m2=0000090ecb899d858576495c70f27a29 with 1 requests using 125 connections
 1 / 1 [========================================================================================================================================================] 100.00% 0s
Done!
Statistics        Avg      Stdev        Max
  Reqs/sec       135.49      95.80     270.97
  Latency        1.80ms     1.27ms     3.60ms
  HTTP codes:
    1xx - 0, 2xx - 1, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:    88.94KB/s

[1]+  Done                    ./bombardier-linux-amd64 -n 1 http://10.209.5.34:8013/hotrizon/get-score?m2=0000090ecb899d858576495c70f27a29
root@ubuntu-HP-ProDesk-680-G2-MT:~/software# 
root@ubuntu-HP-ProDesk-680-G2-MT:~/software# 
root@ubuntu-HP-ProDesk-680-G2-MT:~/software# python
Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> def func():
...     import time
...     t= time.time()
...     requests.get("http://10.209.5.34:8013/hotrizon/get-score?m2=0000090ecb899d858576495c70f27a29&qid=123")
...     print time.time() -t
... 
>>> func()
0.286794900894
>>> 

from bombardier.

codesenberg avatar codesenberg commented on May 28, 2024

I just noticed that you forgot to double-quote URL for bombardier, i.e. you type:

./bombardier-linux-amd64 -n 1 http://10.209.5.34:8013/hotrizon/get-score?m2=0000090ecb899d858576495c70f27a29&qid=123

, but it should be:

./bombardier-linux-amd64 -n 1 "http://10.209.5.34:8013/hotrizon/get-score?m2=0000090ecb899d858576495c70f27a29&qid=123"

Might not be the reason for the different results, but you test two different URLs.

from bombardier.

likezjuisee avatar likezjuisee commented on May 28, 2024

Finally, I found this problem. Thanks!

from bombardier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.