Giter Club home page Giter Club logo

io_benchmarks's Introduction

Benchmarking file uploading to a web server

For few concurrent users uploading files, it's clear the bottleneck is IO; the server's NIC bandwidth is distributed among the users bandwidth set by their ISPs. For lots of concurrent users, synchronization, context switching and event handling start coming into play, so that IO stops being the bottleneck and the full server bandwidth is no longer available to its users.

This non statistically-correct micro benchmark is an attempt to determine at what concurrency level this starts to happen

The tests consists on concurrently uploading a file through POST requests using Apache Bench. The server-side program being benchmarked pipes the bytes received into a class that progressively computes the file's MD5 in order to verify the upload.

Three minimal server implementations in Java are looked at:

Plain Old Java IO Streams

Each request is processed on a separate thread spawned by Executors.newCachedThreadPool().

NIO through Netty

Using Netty's default async NioServerSocketChannelFactory. In the pipeline I'm using an HttpRequestDecoder and an HttpResponseDecoder.

NIO through Vert.x (using Java and just one event loop)

Vert.x uses Netty behind the hood, adding some nice abstractions.

Requirements

If you're in Mac OS X, note that ab is misbehaving in Lion and Mountain Lion, so you need to patch it. See http://simon.heimlicher.com/articles/2012/07/08/fix-apache-bench-ab-on-os-x-lion

How to compile

Just run "ant".

How to run the tests

  1. Launch the server-side program. Replace oio with netty or vertx to test the other methods.
cd oio
./run
  1. Run the clients script. file denotes the file being posted, n denotes the concurrency level. This will run for 60 seconds:
./clients file n

io_benchmarks's People

Contributors

alpeb avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

alpeb2

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.