<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ranch.git/test, branch 0.9.0</title>
<subtitle>Socket acceptor pool for TCP protocols.
</subtitle>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/ranch.git/'/>
<entry>
<title>Add Transport:sendfile/4,/5</title>
<updated>2013-08-16T17:44:24+00:00</updated>
<author>
<name>James Fish</name>
<email>james@fishcakez.com</email>
</author>
<published>2013-04-01T23:49:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/ranch.git/commit/?id=ca6817880ee5592cf890fb5a71da41f52818d29a'/>
<id>ca6817880ee5592cf890fb5a71da41f52818d29a</id>
<content type='text'>
Adds offset based sendfile to transports. Same behaviour as
file:sendfile/4,/5 except socket and file arguments are reversed and
either a raw file or a filename can be used.

sendfile/2,/4,/5 now compulsory callbacks in ranch_transport.

ranch_tcp:sendfile/2 now defaults to a chunk_size of 8191 - the default
for ranch_ssl:sendfile/2. The same default is used for both
ranch_tcp:sendfile/4,5 and ranch_ssl:sendfile/4,5.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds offset based sendfile to transports. Same behaviour as
file:sendfile/4,/5 except socket and file arguments are reversed and
either a raw file or a filename can be used.

sendfile/2,/4,/5 now compulsory callbacks in ranch_transport.

ranch_tcp:sendfile/2 now defaults to a chunk_size of 8191 - the default
for ranch_ssl:sendfile/2. The same default is used for both
ranch_tcp:sendfile/4,5 and ranch_ssl:sendfile/4,5.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add asn1 to the list of applications that need to be started for SSL</title>
<updated>2013-06-20T13:15:14+00:00</updated>
<author>
<name>Loïc Hoguin</name>
<email>essen@ninenines.eu</email>
</author>
<published>2013-06-20T13:15:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/ranch.git/commit/?id=c74d53af61639b478032d0955c829b103fba294c'/>
<id>c74d53af61639b478032d0955c829b103fba294c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use ct_helper to generate SSL certificates for testing</title>
<updated>2013-05-01T15:20:05+00:00</updated>
<author>
<name>Loïc Hoguin</name>
<email>essen@ninenines.eu</email>
</author>
<published>2013-05-01T15:20:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/ranch.git/commit/?id=e6e5c73194a1e85308a6f872f32c977076d94cf9'/>
<id>e6e5c73194a1e85308a6f872f32c977076d94cf9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow ranch_ssl to use DER cert/key/ca options.</title>
<updated>2013-04-28T08:15:45+00:00</updated>
<author>
<name>Geoff Cant</name>
<email>nem@erlang.geek.nz</email>
</author>
<published>2013-04-28T08:15:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/ranch.git/commit/?id=3cc134ef693e6c8184d82635faa195d1010603c7'/>
<id>3cc134ef693e6c8184d82635faa195d1010603c7</id>
<content type='text'>
The Erlang SSL library allows keys, certs and cacerts to be passed either as DER encoded binaries or in PEM encoded files. This patch allows ranch_ssl to be configured in either manner.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Erlang SSL library allows keys, certs and cacerts to be passed either as DER encoded binaries or in PEM encoded files. This patch allows ranch_ssl to be configured in either manner.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix ranch_server:set_connections_sup/2 race conditions</title>
<updated>2013-04-02T16:51:07+00:00</updated>
<author>
<name>James Fish</name>
<email>james@fishcakez.com</email>
</author>
<published>2013-04-01T22:15:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/ranch.git/commit/?id=a700368b2cb021bb1cd007697db4a3bae0099f2d'/>
<id>a700368b2cb021bb1cd007697db4a3bae0099f2d</id>
<content type='text'>
A ranch_conns_sup could be (re)started and call
ranch_server:set_connections_sup/2 before ranch_server has handled the
predecessor's exit. This would cause the ranch_server to crash because
ets:insert_new/2 would return false.

This change allows ranch_server to handle this case by crashing the
calling process instead of itself.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A ranch_conns_sup could be (re)started and call
ranch_server:set_connections_sup/2 before ranch_server has handled the
predecessor's exit. This would cause the ranch_server to crash because
ets:insert_new/2 would return false.

This change allows ranch_server to handle this case by crashing the
calling process instead of itself.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'server-state-recover' of git://github.com/fishcakez/ranch</title>
<updated>2013-04-02T15:10:15+00:00</updated>
<author>
<name>Loïc Hoguin</name>
<email>essen@ninenines.eu</email>
</author>
<published>2013-04-02T15:10:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/ranch.git/commit/?id=8203188155aa9243a4cdcec4962d9b190d2acb5b'/>
<id>8203188155aa9243a4cdcec4962d9b190d2acb5b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add ranch_server state recovery</title>
<updated>2013-04-02T15:08:08+00:00</updated>
<author>
<name>James Fish</name>
<email>james@fishcakez.com</email>
</author>
<published>2013-04-01T22:47:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/ranch.git/commit/?id=bb9f91b8658ab304a7038bcbca80dd518f53e026'/>
<id>bb9f91b8658ab304a7038bcbca80dd518f53e026</id>
<content type='text'>
When ranch_server crashes it will now remonitor previously registered
ranch_conns_sup processes so they can be removed from the registry when
they die.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When ranch_server crashes it will now remonitor previously registered
ranch_conns_sup processes so they can be removed from the registry when
they die.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add test to check setting max conenctions does not crash any processes</title>
<updated>2013-04-01T23:09:23+00:00</updated>
<author>
<name>James Fish</name>
<email>james@fishcakez.com</email>
</author>
<published>2013-04-01T23:09:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/ranch.git/commit/?id=773ce4fdf3f3765f25a91f9bcc61f86be228270a'/>
<id>773ce4fdf3f3765f25a91f9bcc61f86be228270a</id>
<content type='text'>
This is a regression test to prevent a previous bug.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a regression test to prevent a previous bug.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove ranch_listener and replace ListenerPid by Ref</title>
<updated>2013-04-01T15:04:21+00:00</updated>
<author>
<name>Loïc Hoguin</name>
<email>essen@ninenines.eu</email>
</author>
<published>2013-04-01T15:04:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/ranch.git/commit/?id=109c63d0e76ca6248863932c7a9957f8093cfaf2'/>
<id>109c63d0e76ca6248863932c7a9957f8093cfaf2</id>
<content type='text'>
We just don't need this process anymore. Less, simpler code!

API changes:

 *  Protocols start_link first argument is now Ref instead of ListenerPid
 *  ranch:accept_ack/1 argument is now Ref instead of ListenerPid
 *  ranch_listener:remove_connection/1 becomes ranch:remove_connection/1
    and its argument is now Ref instead of ListenerPid

Ref is the name of the listener given as first argument to start_listener/6.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We just don't need this process anymore. Less, simpler code!

API changes:

 *  Protocols start_link first argument is now Ref instead of ListenerPid
 *  ranch:accept_ack/1 argument is now Ref instead of ListenerPid
 *  ranch_listener:remove_connection/1 becomes ranch:remove_connection/1
    and its argument is now Ref instead of ListenerPid

Ref is the name of the listener given as first argument to start_listener/6.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use a custom supervisor for ranch_conns_sup</title>
<updated>2013-03-31T21:08:02+00:00</updated>
<author>
<name>Loïc Hoguin</name>
<email>essen@ninenines.eu</email>
</author>
<published>2013-03-30T12:04:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/ranch.git/commit/?id=33db3b0d1aafcfbc9aadbad622a4014c021ef10c'/>
<id>33db3b0d1aafcfbc9aadbad622a4014c021ef10c</id>
<content type='text'>
This change was designed so that we don't have this supervisor
and ranch_listener performing the same job, namely monitoring
connection processes, the first through links and the second
through monitors.

This change also makes possible various optimizations:

 *  Acceptors don't need to know about options, maximum number
    of connections, or anything else. They can just accept,
    pass the socket to the supervisor, and when the supervisor
    replies continue accepting connections.

 *  The supervisor holds most of the information that will be
    passed to created processes. This reduces copying.

 *  The supervisor temporarily takes ownership of the socket,
    then creates the connection process and gives it ownership,
    streamlining the creation.

 *  The supervisor can hold acceptors in their receive loop if
    max_connections is reached. When this number gets below the
    limit it can then send a message to a sleeping acceptor to
    make it resume its operations.

 *  Because we know that all connection process creations are made
    from the local Erlang node, we can greatly reduce the number
    operations to be made when calling the supervisor.

 *  Because all acceptors die if this supervisor dies, we can
    remove even more operations from the calling code. We do not
    need to monitor or wait for a timeout. This reduces the call
    code to two statements: send and receive. (Thanks James Fish
    for helping with that.)

 *  The supervisor only needs to keep track of a list of pids.
    There is no children specification to be maintained, we do
    not need to handle restart strategy (no process can be
    restarted because the socket dies with it). We are using
    the process dictionary for storing the pids as it proved
    to be the simplest and fastest solution.

 *  The supervisor maintains a count of current connections,
    but also of processes (including the ones that removed
    themselves from the pool), making any query of these values
    very fast.

The supervisor should still be compatible with OTP principles.
It responds to calls from the supervisor module as expected,
although some of them are disabled and an error will be returned,
for example supervisor:start_child/2. It is also started with
proc_lib and handles system messages. sys:get_status/1 can thus
be used as expected.

We can see a great increase in the number of requests/s, a great
improvement in the latency of requests, and we can simply accept
requests faster than before. It will probably have a bigger increase
under virtualized environments, although that's only a guess.

As a result of this, we don't write much anymore in the ranch_server
ets table, so the write_concurrency option was removed. Tests were
also slightly improved to prevent race conditions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change was designed so that we don't have this supervisor
and ranch_listener performing the same job, namely monitoring
connection processes, the first through links and the second
through monitors.

This change also makes possible various optimizations:

 *  Acceptors don't need to know about options, maximum number
    of connections, or anything else. They can just accept,
    pass the socket to the supervisor, and when the supervisor
    replies continue accepting connections.

 *  The supervisor holds most of the information that will be
    passed to created processes. This reduces copying.

 *  The supervisor temporarily takes ownership of the socket,
    then creates the connection process and gives it ownership,
    streamlining the creation.

 *  The supervisor can hold acceptors in their receive loop if
    max_connections is reached. When this number gets below the
    limit it can then send a message to a sleeping acceptor to
    make it resume its operations.

 *  Because we know that all connection process creations are made
    from the local Erlang node, we can greatly reduce the number
    operations to be made when calling the supervisor.

 *  Because all acceptors die if this supervisor dies, we can
    remove even more operations from the calling code. We do not
    need to monitor or wait for a timeout. This reduces the call
    code to two statements: send and receive. (Thanks James Fish
    for helping with that.)

 *  The supervisor only needs to keep track of a list of pids.
    There is no children specification to be maintained, we do
    not need to handle restart strategy (no process can be
    restarted because the socket dies with it). We are using
    the process dictionary for storing the pids as it proved
    to be the simplest and fastest solution.

 *  The supervisor maintains a count of current connections,
    but also of processes (including the ones that removed
    themselves from the pool), making any query of these values
    very fast.

The supervisor should still be compatible with OTP principles.
It responds to calls from the supervisor module as expected,
although some of them are disabled and an error will be returned,
for example supervisor:start_child/2. It is also started with
proc_lib and handles system messages. sys:get_status/1 can thus
be used as expected.

We can see a great increase in the number of requests/s, a great
improvement in the latency of requests, and we can simply accept
requests faster than before. It will probably have a bigger increase
under virtualized environments, although that's only a guess.

As a result of this, we don't write much anymore in the ranch_server
ets table, so the write_concurrency option was removed. Tests were
also slightly improved to prevent race conditions.
</pre>
</div>
</content>
</entry>
</feed>
