[KS][S] GuideSmiths Process Child + Cluster
Este repo es parte de una formación interna en GuideSmiths
python3 exec/error.py > logs/stout_clean.log # Guardar solo el stdout
python3 exec/error.py >> logs/append.log # Append del stdout
python3 exec/error.py &> logs/all.log # Guardar stdout y stderr
python3 exec/error.py 1> logs/stout.log # Guardar solo el stdout
python3 exec/error.py 2> logs/error.log # Guardar solo el stderr
python3 exec/error.py 1> logs/all_stout.log 2>&1 # Guardar el stdout (redirect de stderr)
python3 exec/error.py 2> logs/all_stderr.log 1>&2 # Guardar el error (redirect de stout)
child_process.exec()
genera un shell y ejecuta un comando dentro de ese shell, pasando elstdout
y elstderr
al callback cuando se completa. Internamente utilizabuffer
Docchild_process.execSync()
una versión síncrona y bloqueante dechild_process.exec()
Docchild_process.execFile()
similar achild_process.exec()
, excepto que genera el comando directamente sin generar primero un shell de forma predeterminada Docchild_process.execFileSync()
una versión síncrona y bloqueante dechild_process.execFile()
Docchild_process.spawn()
genera un shell y ejecuta un comando devolviendo unstream
y que debemos gestionar por eventos Docchild_process.spawnSync()
una versión síncrona y bloqueante dechild_process.spawn()
Docchild_process.fork()
Es similar achild_process.spawn()
solo que nos permite enviar mensajes al proceso hijo Doc
- exec
- spawn
- The Node.js Way - Understanding Error-First Callbacks
- Node.js Best Practices | Error Handling Practices
- Building Robust Node Applications: Error Handling
- Joyent | Production Practices
- How to prevent your Node.js process from crashing
- Working with Environment Variables in Node.js
- process.env: What it is and why/when/how to use it effectively
- Environment Variables in Node.js
- Here’s how you can actually use Node environment variables
- Using dotenv package to create environment variables
- Configuration settings in Node with dotenv
- Managing Configurations in Node.JS apps with dotenv and convict
- dotenv Loads environment variables from .env for nodejs projects.
- cross-env Set environment variables cross-platform.
- node-upstarter Easily create upstart services for your node apps
- diable 😈 Daemonize the things out.
- daemonize-process Daemonize the current Node.js process
- daemonix A utility for creating daemons out of NodeJS applications.
- Node.js Child Processes: Everything you need to know
- Understanding execFile, spawn, exec, and fork in Node.js
- Node.js: managing child processes
- Getting to know Node’s child_process module
- Nodejs Doc | exec
- Nodejs Doc | execFile
- Nodejs Doc | fork
- Nodejs Doc | execSync
- Nodejs Doc | execFileSync
- Nodejs Doc | spawnSync
- Nodejs Doc | spawn
- Scaling Node.js Applications
- Taking Advantage of Multi-Processor Environments in Node.js
- Modo cluster para node.js
- How to Create a Node.js Cluster for Speeding Up Your Apps
- How to scale your Node.js server using clustering
- Clustering in NodeJs — Performance Optimization
- Understanding the NodeJS cluster module