yahns Ruby server user/dev discussion
 help / color / Atom feed
2cd0e921d1d25b1bfab486a6efd96fa8288bd40e blob 6038 bytes (raw)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
 
yahns - sleepy, multi-threaded, non-blocking application server for Ruby
------------------------------------------------------------------------

A Free Software, multi-threaded, non-blocking network application server
designed for low _idle_ power consumption.  It is primarily optimized
for applications with occasional users which see little or no traffic.
yahns currently hosts Rack/HTTP applications, but may eventually support
other application types.  Unlike some existing servers, yahns is
extremely sensitive to fatal bugs in the applications it hosts.

Features
--------

* _zero_ wakeups when all clients are idle
* idle client connections may live forever if there is no FD pressure
* suitable for slow clients, fast clients, or a mixture of both
* HTTP/0.9 support
* HTTP/1.1 persistent connections and pipelining
* HTTPS for HTTP/1.1 support
* decodes HTTP chunked encoding for requests
* parses HTTP/1.1 trailers in requests
* supports streaming responses with lazy buffering for slow clients
* optional streaming input for fast clients
* able to host multiple applications with different settings
* uses epoll/kqueue to scale to many idle connections
* abuses epoll/kqueue as a load balancer between threads within a process
* optional multi-process support (in addition to threads)
* fairly balances new clients between multiple processes (on Linux)

Disclaimer
----------

yahns is extremely sensitive to fatal bugs in the apps it hosts.  There
is no (and never will be) any built-in "watchdog"-type feature to kill
stuck processes/threads.  Each yahns process may be handling thousands
of clients; unexpectedly killing the process will abort _all_ of those
connections.  Lives may be lost!

yahns hackers are not responsible for your application/library bugs.
Use an application server which is tolerant of buggy applications
if you cannot be bothered to fix all your fatal bugs.

Supported Platforms
-------------------

yahns is developed primarily for modern GNU/Linux systems.

We support kqueue on FreeBSD (and possibly OpenBSD and NetBSD).
Non-Free systems/dependencies will never be supported.

Supported Ruby implementations:
* (Matz) Ruby 2.0.0 and later (we develop (and host our website) on trunk)

Contact
-------

We are happy to see feedback of all types via plain-text email.
Please send comments, user/dev discussion, patches, bug reports,
and pull requests to our public inbox at:

	yahns-public@yhbt.net

Please use reply-to-all as we do not require any sort of subscription.
We archive all of our mail publically at:

	https://yhbt.net/yahns-public/
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.yahns

Atom feed: https://yhbt.net/yahns-public/new.atom

This README is our homepage, we would rather be working on HTTP servers
all day than worrying about the next browser vulnerability because
HTML/CSS/JS is too complicated for us.

* https://yhbt.net/yahns.git/about/

Hacking
-------

We use git and follow the same development model as git itself
(email-oriented, benevolent dictator).

	git clone https://yhbt.net/yahns.git

Please use git-format-patch(1) and git-send-email(1) distributed with
the git(7) suite for generating and sending patches.  Please format
pull requests with the git-request-pull(1) script (also distributed
with git(7)) and send them via email.

See https://www.git-scm.com/ for more information on git.

Design
------

yahns is designed to optimally use multiple threads with non-blocking I/O.
The event loop is not a traditional single-threaded design with a mutex
slapped on as an afterthought, but designed from the beginning to utilize
multiple threads.

* two classes of long-lived, persistent threads
  1. blocking acceptors
  2. non-blocking event loop workers
* epoll (or kqueue) acts as a queue (by using one-shot notifications)
* acceptors accept new clients and put them in the queue
* workers pull clients off the queue, rearming them to epoll on EAGAIN

The end result is clients transition freely and fairly between threads
and will always be able to find the next idle thread to run on.

The design inspiration from the name "kqueue" when working on another
project.

In addition to multiple threads, yahns optionally supports multiple
processes to work around low FD limits as well as contention in the:

* kernel (socket (de)allocation from accept/close, mmap/sbrk locks)
* standard C library (malloc/free)
* Ruby VM (GVL, GC)
* application it hosts

Copyright
---------

Copyright 2013-2016, all contributors (see git repo).
License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>

yahns is copyrighted Free Software by all contributors, see logs in
revision control for names and email addresses of all of them.  yahns
contains code from Mongrel, unicorn, and Rainbows! which may also be
licensed under the GPLv2 or later.

yahns is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.

yahns is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, see https://www.gnu.org/licenses/gpl-3.0.txt

Additional permission under GNU GPL version 3 section 7:

    If you modify this program, or any covered work, by linking or
    combining it with the OpenSSL project's OpenSSL library (or a
    modified version of that library), containing parts covered by the
    terms of the OpenSSL or SSLeay licenses, the copyright holder(s)
    grants you additional permission to convey the resulting work.
    Corresponding Source for a non-source form of such a combination
    shall include the source code for the parts of OpenSSL used as well
    as that of the covered work.

lrg nabgure ubeevoyl-anzrq freire :>
debug log:

solving 2cd0e92 ...
found 2cd0e92 in https://yhbt.net/yahns.git

yahns Ruby server user/dev discussion

Archives are clonable:
	git clone --mirror https://yhbt.net/yahns-public
	git clone --mirror http://ou63pmih66umazou.onion/yahns-public

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.yahns
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.yahns

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox