Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use autocannon on a UNIX socket #119

Merged
merged 4 commits into from
Jan 29, 2018
Merged

Conversation

watson
Copy link
Contributor

@watson watson commented Jan 29, 2018

With this you can tell autocannon to send requests to a UNIX socket instead of a TCP socket, e.g:

autocannon /tmp/my-server.sock

For use with test HTTP server:

const http = require('http')
http.createServer(function (req, res) {
  res.end('Hello World')
}).listen('/tmp/my-server.sock')

With this you can tell autocannon to send requests to a UNIX socket instead of a TCP socket, e.g:

autocannon /tmp/my-server.sock
@watson
Copy link
Contributor Author

watson commented Jan 29, 2018

@mcollina before I dive deeper into this rabbit hole, I just wanted to hear your opinion on this - if this is even something you'd like to add to autocannon.

My use-case is that I'm benchmarking the difference between letting an HTTP server listen on a TCP socket vs a UNIX socket to see how much more throughput I can get this way for use with interprocess communication.

Copy link
Owner

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a unit test for this?

@watson
Copy link
Contributor Author

watson commented Jan 29, 2018

@mcollina updated

@watson watson changed the title [WIP] Use autocannon on a UNIX socket Use autocannon on a UNIX socket Jan 29, 2018
Copy link
Collaborator

@GlenTiki GlenTiki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I'll merge when I'm back at my laptop. Thanks 😄

@GlenTiki GlenTiki merged commit 72102ff into mcollina:master Jan 29, 2018
@watson watson deleted the unix-socket branch January 29, 2018 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants