Skip to main content

No project description provided

Project description

correcthorsebatterystaple

this: http://xkcd.com/936/

You can try it out at https://correcthorsebatterystaple.waynewerner.com

I don't log which passwords I generate, but if you're paranoid about security you probably should just generate the passwords locally.


This project started off using Flask. Then I realized that was overkill. I decdied to make this server be able to run with pure Python, because there's literally no reason not to.

You can just run this as:

python3 server.py

And then connect to it:

$ curl localhost:8000
correct horse battery staple$

Yeah. It won't return an ending newline. That's intentional.


I also decided that for funsies I should make this into a test. What is the difference between just:

  • Single threaded server.
  • A server using select.
  • A server using epoll.
  • A multithreaded server.
  • A server using asyncio.
  • A server using an aiohttp server.

My theory is that a single threaded server should be about as good as it gets. Or possibly using epoll or select? Given the size of the data that we're returning, I don't think that I'll get a lot of difference between any of these servers. We shall see.

The first server that I will produce will be just a single threaded server using raw sockets and listen(20). That seems like a reasonably large queue? To be honest, I'm not entirely certain how that works - in the past I've used huge numbers or smaller numbers and didn't really see a difference.


Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for chbs, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size chbs-0.1.0-py3-none-any.whl (2.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page