Code Monkey home page Code Monkey logo

mitol's Introduction

Mitol

Lightweight, high performance NodeJS Server.

Build Status Coverity Status


Project description

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.


Advantages

  • 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, ...)

Benchmarks

Benchmark


How to use

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!')
    });
}

Like the project?

You can support me by donating: https://www.paypal.com/paypalme/helidium


Thanks

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.

mitol's People

Contributors

markobiskup avatar dronbas avatar helidium avatar askuzminov avatar udivankin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.