GithubHelp home page GithubHelp logo

hsnsq's Introduction

hsnsq

Haskell NSQ protocol parser

hsnsq's People

Contributors

pharaun avatar piotrjustyna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hsnsq's Issues

Benchmark hsnsq and nsq performance

We want to identify what the performance curves are for nsq so that we can decide if we should use it as a way to stream assets to the client or not.

The basic idea here is to have the standard two dimension benchmark in which:

  1. X axis is the send-rate (ie 1msg/sec, 10msg/sec, etc...)
  2. Y axis is the message-size (ie 1kb, 10kb, etc...)

Then in each message upon sending we will record the following 3 items:

  1. Sequal id (to identify dropped/lost messages)
  2. Timestamp of send-time
  3. Gibbish for the rest of the message (from a block of memory for dma/mmap speed)

Then upon reception we will record the time the message was received, and record the send-time and sequal id to a csv/logfile for further analysis.

Should be able to make a binary that provides us with a few options such as send rate, message size, and so on for the initial benchmark effort. Binary provided options:

  1. hostname/ip to connect to for nsq
  2. port to connect to for nsq
  3. count of messages to send
  4. send-rate in msg/sec
  5. message size in kilobytes (min of 1-4kb)
  6. RDY size (we are doing 1 for now but should be able to bump this up)

Implement a test suite.

We currently don't have anything beyond the example program included.

Should probably implement:

  1. Quickcheck for parsing
  2. HUnit for some of the more specific stuff
  3. Probably start looking at how to cleanly test the I/O portion, maybe free monad/type classes for this.

Primitive protocol is done. Need to finish the clientlib part.

Basically opening this ticket to track the feature/approach for the client.

Not sure if we need two threads, may need for concurrent PUB/MPUB support but for now most of the send ops can probably be done immediately. But anyway should have one thread that recieves messages and deals with heartbeat and all of that configuration stuff, then it pumps it into a queue in which it can monitor the high-water mark and adjust the RDY level for the client.

Then this should allow the library user to decide how they want to deal with the messages while letting the client deal with rdy, heartbeats, and all background stuff.

references:
http://www.yesodweb.com/blog/2014/03/network-conduit-async
https://github.com/informatikr/hedis
http://chimera.labs.oreilly.com/books/1230000000929/pt01.html

Fix up the subscription stage of the clientlib.

Currently the clientlib pre-auth for a hardcoded subscription.

Need to fix it up so that its optional to subscript if you want to listen otherwise don't.

  1. Make subscription optional
  2. Pass more messages to the client (errors/okays) so that it can manually manage subscription for now.

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.