Giter Club home page Giter Club logo

pc12306c's Introduction

pc12306c

Author: Wei Dong [email protected]

This is a stress test client of https://github.com/weiqj/pc12306.

Building

The code depends on a C++11 compiler and the Boost library.

MPI Version

The program pc12306c-mpi.cpp is almost the same as pc12306c.cpp except for MPI support. A MPI_Barrier is used so that all clients start firing at the server at the same time. Use "make mpi" to compile.

Command line parameters

  -h [ --help ]                    produce help message.
  -s [ --server ] arg (=localhost)
  -p [ --port ] arg (=12306)
  --trains arg (=5000)
  --segments arg (=10)
  --seats arg (=3000)
  --max-length arg (=5)
  -N arg (=10000000)               queries per client
  -C arg (=4)                      number parallel clients
  -B arg (=20)                     request batch size
  -Q arg (=1000)                   maximal outstanding request per client
  -S arg (=100)                    if queue is fall, sleep this # us
  --cycle arg (=1)                 print counters every cycle seconds

Explanation of some parameters:

  • C: each client runs two threads, one for reading and one for writing, so total thread number is 2C.
  • B: fit multiple requests into a single send request might increase throughput. (With 1GB ethernet, it seems B doesn't help much in improving throughput.)
  • Q: this is to preventing sending out too many requests before they can be processed by server. If outstanding query + B >= Q, the writing thread will sleep S us and try again. Larger Q helps improve throughput.
  • N: this program pre-allocate memory for all requests and responses. For N=10000000 and C=4 (default), the maximal resident set size of the program is about 4GB. The memory consumption is proportional to NxC.

Performance Measures

  • ooo.time.max: ooo == out of order. Usually smaller respID should arrive before bigger respID. This value is the maximal time a bigger respID has arrived before a smaller respID.
  • fill.rate: the server keeps the state across multiple invocation of the client. This value is meaningful only on the first invocation of client after server restart, because subsequent invocations of client have no means to track how many seats were sold before. This value of the first N invocation of client can be added up for the total rate of seats sold.

Known Issues

There's some Heisenbug causing the program to crash when evaluation conflict1 and/or conflict2.

pc12306c's People

Contributors

aaalgo avatar

Watchers

 avatar  avatar

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.