unmaintained It was great developing the high performance HTTP server alternative for NodeJS, but I don't have the time to continue development of the project. If anyone wants to continue development, feel free to contact me...
Lightweight, high performance NodeJS Server.
Project was born out of the need for faster performing server using NodeJS. Current implementation lacks focus on performance, which can be achieved by moving parts of code to native C++ bindings.
Aim of the project is to offer an alternative solution, which is using less memory and CPU power, giving you available resources for your code or handling higher number of requests.
- No changes required: Just replace require('http') with require('mitol')
- Top Speed: Roughly 3x better performance than integrated server
- Additional features: Work in progress (Static file server, Router, ...)
Currently only Linux has been tested. To install the project make sure you have node-gyp, python and build-tools (GCC, etc.) installed. To build the node package do the following:
npm i mitol
To test the project you can use the following script
(Single process):
const http = require('mitol');
let server = http.createServer((req, res) => {
res.end('Hello World!');
});
server.listen(8080, () => {
console.log('Example app listening on port 8080!')
});
(Multi process):
const cluster = require('cluster');
const numCPUs = require('os').cpus().length;
const http = require('mitol');
if (cluster.isMaster) {
// Fork workers.
for (let i = 0; i < numCPUs; i++) {
cluster.fork();
}
cluster.on('exit', (worker, code, signal) => {
console.log(`worker ${worker.process.pid} died`);
});
} else {
let server = http.createServer((req, res) => {
res.end('Hello World!');
});
server.listen(8080, () => {
console.log('Example app listening on port 8080!')
});
}
You can support me by donating: https://www.paypal.com/paypalme/helidium
My Family and Friends for supporting me!
All the fans for believing in the project!
Leandro A. F. Pereira For his wonderful Lwan project.
Alex Hultman For his wonderful uWebSockets project.
TechEmpower For Server benchmarks.
GitHub For code hosting.
Travis For code testing.
Coverity For code defects check
Copyright (c) 2017 Mitol Project - Released under the Zlib license.