GithubHelp home page GithubHelp logo

apigee / apib Goto Github PK

View Code? Open in Web Editor NEW
285.0 285.0 36.0 978 KB

A simple, fast HTTP and API benchmarking tool

License: Apache License 2.0

Shell 1.67% Python 1.08% C++ 91.94% Dockerfile 0.21% Makefile 0.26% Starlark 2.85% CMake 1.99%

apib's People

Contributors

gbrail avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apib's Issues

Changes required to build on Debian 11 "Bullseye"

FWIW, to avoid errors (missing libs) at the linker stage, I had to replace -lcrypto.1.1 with -lcrypto and -lssl.1.1 with -lssl. This fixes the following errors:

/usr/bin/ld: cannot find -lssl.1.1
/usr/bin/ld: cannot find -lcrypto.1.1

After that, there was another error:

/usr/bin/ld: CMakeFiles/io.dir/apib_iothread.cc.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line

This was fixed by adding the -pthread flag in the linker stage.

Missing -lpthread on many platforms

CentOS on the standard EC2 instances and Ubuntu need -lpthread to be added in the Makefile but the configure script doesn't appear to be adding them.

Validate response via CRC-32

Add as input a file name and calculate a CRC-32. Calculate the number of responses that match the original file name.

With a little research, though, it looks like doing CRC-32 at a high rate may result in way too much CPU consumption.

The Configure.ac file does not find my apr and apr-util

Disclaimer: I don't know autoconf

but it seems to me the Configure.ac file assumes the apr is in /usr/include/apr-1 and the apr-util likewise. Is this a standard location?

I retrieved and built apr and apr-util for MACOSX but did not install them there. Instead they were in /usr/local/apr/include/apr-1 and /usr/local/apr-util/include/apr-1 . I couldn't figure out how to tell configure these locations . So this is possibly a doc update, and possibly a change to configure.ac.

I was able to get the build to succeed only by manually modifying the Makefile, to insert the -I/usr/local/apr/include/apr-1 etc.

error

In file included from /home/pirate/optool/apib-master/apib/apib_io_basic.cc:29:0:
/home/pirate/optool/apib-master/apib/apib_iothread.h:36:16: fatal error: ev.h: No such file or directory
#include "ev.h"
^
compilation terminated.
make[3]: *** [apib/CMakeFiles/io.dir/apib_io_basic.cc.o] Error 1
make[2]: *** [apib/CMakeFiles/io.dir/all] Error 2
make[1]: *** [apib/CMakeFiles/apib.dir/rule] Error 2
make: *** [apib] Error 2

Median + latency percentile calculations are invalid due to int arithmetic

If I make less than 100 requests, the 50%, 90%, 98%, and 99% latency values will be the same as the minimum latency value. For example:

Minimum latency:      4013.502 milliseconds
50% latency:          4013.502 milliseconds
90% latency:          4013.502 milliseconds
98% latency:          4013.502 milliseconds
99% latency:          4013.502 milliseconds

This is due to a bug in how the latency percentages are calculated. apib is doing int arithmetic, which rounds down the index of the percentile:
#getLatencyPercent method in apib/src/apib_reporting.c

static unsigned long getLatencyPercent(int percent)
{
  if (latenciesCount == 0) {
    return 0;
  }
  if (percent == 100) {
    return latencies[latenciesCount - 1];
  }
  unsigned int index = 
    (latenciesCount / 100) * percent;
  return latencies[index];
}

As you can see in (latenciesCount / 100) * percent;, (latenciesCount / 100) will always be 0 if the count is less than 100. This should be changed to float arithmetic. I was interested in using this script purely to measure median/90% latency figures, so unless this is corrected, I cannot use this script.

columns don't match header output

I build from current master HEAD and I'm getting:

Name,Throughput,Avg. Latency,Threads,Connections,Duration,Completed,Successful,Errors,Sockets,Min. latency,Max. latency,50%% Latency,90%% Latency,98%% Latency,99%% Latency,Latency Std Dev,Avg Client CPU,Avg Server CPU,Avg Server 2 CPU,Client Mem Usage,Server Mem,Server 2 Mem,Avg. Send Bandwidth,Avg. Recv. Bandwidth
test,71.991,13.6991,1,1.000,72,72,0,73,11.751,52.649,13.035,14.236,19.313,52.649,4.791-nan,-nan,-nan,4.89,0.00,0.00,0.66,0.11

There are two missing fields in the output. Obviously a missing comma before the first -nan accounts for one. It appears based on reasonable numbers is that Duration is missing.

Also, the -nan is likely expected as I'm running this from a Docker container.

Document building on MACOSX

Building apib is not documented for MACOSX.

It relies on apr and apr-util; the builder needs to retrieve these from http://www.apache.org/dist/apr/ , and then build them.

The location of the includes for these things needs to be referenced somehow, in the configure.ac file or somehting.

The build also (maybe, not sure) relies on autoconf, which is not included in this distribution. Autoconf can be retrieved and built, using http://mirror.team-cymru.org/gnu/autoconf .

"-nan" in json output

When compiled from master, I receive the following:

pivotal@astandke-scaling:~/apib$ ./apib -S -d 5 -N nantest https://astandke.com
nantest,25.799,38.5591,1,5.000,129,129,0,2,36.238,164.864,36.500,36.650,47.397,163.614,15.811-nan,-nan,-nan,4.18,0.00,0.00,0.01,0.56

(scroll to the right, note the -nans)

I checked out an arbitrarily old commit (2a603ea) and saw the output I expect:

pivotal@astandke-scaling:~/apib$ ./apib -S -d 5 -N nantest https://astandke.com
nantest,25.599,38.929,1,1,5.000,128,128,0,2,36.185,180.611,36.622,36.844,56.925,164.646,16.998,0,0,0,4,0,0,0.01,0.56

The version in homebrew seems to be correct though, so it's just something since then.

Validate response length

Support the length as either a command-line parameter, or as a filename to check. Report the number of responses with a non-matching length. Or, take the length of the very first response.

Requires apib to validate content-length, and also to count length when using chunked encoding.

Refresh DNS lookups periodically to account for load balancers that change DNS

apib today (like ab) does a single DNS lookup at the start of processing, regardless of the number of connections.

This is fine for most servers but for DNS-based load balancing services such as Amazon ELB, performance is not as good as it should be.

Instead, we should experiment with doing a DNS lookup for each concurrent connection, or even with doing a DNS lookup periodically when opening a new connection. This will better help us test the highly variable throughput produced by ELB.

New switch to specify ciphersuite

I have been using apib to test the performance of an embedded web server.

This is a small device, so the overhead of some ciphers can be significant. I added an option to apib to specify the suite or suites to be offered to the server, using the OpenSSL names:
./apib -C AES128-SHA:ECDHE-RSA-AES256-SHA384 https://10.28.22.4/index.html

Diff attached
apib.txt

With this option, apib has been of great help in testing and tweaking our device. Thanks!

FreeBSD support (for gathering CPU and memory statistics)

Hi, thanks for the nice tool! While porting it to FreeBSD, I've discovered that it lacks CPU and memory statistics collection code for this OS and patched it. If you like the patch, it would be nice to see it included upstream, i.e., pushed to master. :-)

P.S. Speaking of versions: existing APIB_1_0 release tag is very old. Perhaps it is time for the new version? (Given that not too many changes had occurred during the time frame, it could probably be tagged as 1.1 or v1.1.)

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.