https://github.com/cloudhead/golem
pre-forking HTTP server for node (old)
https://github.com/cloudhead/golem
Last synced: 5 months ago
JSON representation
pre-forking HTTP server for node (old)
- Host: GitHub
- URL: https://github.com/cloudhead/golem
- Owner: cloudhead
- License: agpl-3.0
- Created: 2011-04-11T02:43:13.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2011-04-20T00:44:28.000Z (almost 15 years ago)
- Last Synced: 2025-10-09T19:08:24.168Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 132 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
golem
=====
> pre-forking HTTP server for node.
introduction
------------
**golem** was directly inspired by [unicorn](http://raa.ruby-lang.org/project/unicorn/) and [nginx](http://nginx.org),
in its pre-forking model, UNIX-oriented design and signal handling. Unlike unicorn, it is capable of handling slow clients,
and doesn't need to run behind a load-balancer. This is due to [node](http://nodejs.org) being inherently designed for
slow clients.
overview
--------
**golem** is started with the `golem` command, which takes a number of options, and a path to the application file:
$ golem -p 8888 -n 2 server/index.js
*See the `examples/` folder for examples. For information on all the options, see the `golem(1)` man page.*
One may choose to start **golem** in *daemonized* mode, this is simply achieved by passing the `-D` flag. **golem**
will then fork itself twice, start a new session and detach itself from the terminal. If the child process hasn't
encountered any errors, it will signal its grand-parent (which will exit promptly), and start listening for connections.
Once it's started accepting connections, **golem** distributes the load amongst its worker processes. If a worker dies,
it is respawned immediately. The running instance can be controlled via standard POSIX signals, such as `SIGHUP` and `SIGQUIT`:
$ kill -s SIGQUIT `cat /var/run/golem.pid`
This performs a graceful shutdown of the master and all workers.
logging
-------
**golem** has several ways of logging:
### stdout/stderr #
This is the default, when in *development* mode. Output is to current terminal.
### log file #
This is the default, when in *production* mode. Output is to a file of your choosing.
It defaults to `/var/log/golem.log`, this can be changed via the command-line, with the
`--log` option, and similarly in the server file.
### custom logger #
We can specify a custom logger, by setting the `logger` option in the server file, for example
if we want *syslog* logging, we can do:
config.logger = syslog.createClient(514, 'localhost');
documentation
-------------
See the `golem(1)` man page for specifics. Alternatively, you can view `doc/golem.1.md`.
development
-----------
Run `make` to build the source files, `make install` to install.
license
-------
**golem** is licensed under the AGPLv3 license. See `LICENSE` for more information.
copyright
---------
Copyright (C) 2011 [Alexis Sellier](http://cloudhead.io)