A lightweight IOT application server with a hard shell written for node.js
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
tigerbot da68c102cd stop double printing uncaught error stacks 7 年前
..
README.md Near-minimal app boot 9 年前
master.js create the config dir in the install process 7 年前
worker.js stop double printing uncaught error stacks 7 年前

README.md

Small and Fast

We're targetting very tiny systems, so we have to be really small and really fast.

We want to get from 0 to a listening socket as quickly as possible, so we have this little folder of boot code that uses no external modules and as few internal modules as reasonably possible.

  • fs.readFileSync is fast (< 1ms)
  • v8's parser is pretty fast
  • v8's fast compiler is slow
  • v8's optimizer happens just-in-time

Master

Master has a few jobs:

  • spin up the reverse proxy (caddy in this case)
  • spin up the workers (as many as CPU cores)
  • manage shared key/value store
  • manage shared sqlite3
  • perform one-off processes once boot is complete
    • SIGUSR1 (normally SIGHUP) to caddy
    • watch and update ip address
    • watch and update router unpn / pmp-nat
    • watch and update Reverse VPN

Worker

Workers are the ones that master spins up to do the hard core stuff. They run the apis of the apps.

Low Mem

We need to profile very low memory devices and see if it is better to have just one process, or if master and worker is still okay over time.

The working suspision is that by occasionally starting up a new worker and killing the old one when memory usage starts to rise should fair pretty well and keeping the system stable.