-
sudo dnf list | grep nginx //Search
-
sudo dnf update //To Install Latest Update
-
sudo dnf install -y nginx // Install Nginx
-
sudo systemctl start nginx.service //Start Nginx Server
-
sudo systemctl status nginx.service // Check Server Status
-
sudo systemctl enable nginx.service // Enable Auto Server Start on
-
sudo yum update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| socket.emit('message', "this is a test"); //sending to sender-client only | |
| socket.broadcast.emit('message', "this is a test"); //sending to all clients except sender | |
| socket.broadcast.to('game').emit('message', 'nice game'); //sending to all clients in 'game' room(channel) except sender | |
| socket.to('game').emit('message', 'enjoy the game'); //sending to sender client, only if they are in 'game' room(channel) | |
| socket.broadcast.to(socketid).emit('message', 'for your eyes only'); //sending to individual socketid | |
| io.emit('message', "this is a test"); //sending to all clients, include sender | |
| io.in('game').emit('message', 'cool game'); //sending to all clients in 'game' room(channel), include sender | |
| io.of('myNamespace').emit('message', 'gg'); //sending to all clients in namespace 'myNamespace', include sender | |
| socket.emit(); //send to all connected clients | |
| socket.broadcast.emit(); //send to all connected clients except the one that sent the message |
Create an empty git repo or reinitialize an existing one
git init
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require("express"); | |
| const cors = require("cors") | |
| const { join } = require("path"); | |
| const { parse } = require("url"); | |
| const next = require("next"); | |
| const fetch = require("isomorphic-unfetch") | |
| const LRUCache = require('lru-cache') | |
| const port = parseInt(process.env.PORT, 10) || 3000; | |
| const dev = process.env.NODE_ENV !== "production"; |
Moved to git repository: https://github.com/denji/nginx-tuning
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.