https://serverfault.com/questions/480241/nginx-failover-without-load-balancing
pstream backend { server 1.2.3.4:80 fail_timeout=5s max_fails=3; server 4.5.6.7:80 backup; } server { listen 80; server_name whatevs.com; location / { proxy_pass http://backend; } } https://www.cnblogs.com/biglittleant/p/8979887.html
backup 预留的备份服务器,当其他所有的非backup服务器出现故障或者忙的时候,才会请求backup机器,因为这台集群的压力最小。
max_fails 允许请求失败的次数,默认是1,当超过最大次数时,返回proxy_next_upstream模块定义的错误。0表示禁止失败尝试,企业场景:2-3.京东1次,蓝汛10次,根据业务需求去配置。
fail_timeout,在经历了max_fails次失败后,暂停服务的时间。京东是3s,蓝汛是3s,根据业务需求配置。常规业务2-3秒合理。
例:如果max_fails是5,他就检测5次,如果五次都是502.那么,他就会根据fail_timeout 的值,等待10秒,再去检测。
https://blog.51cto.com/wangwei007/1103727
https://hackernoon.com/ethereum-blockchain-in-a-real-project-with-500k-users-f85ee4821b12
Nonce collisions
Nonce collisions were another mysterious thing we’ve encountered when trying to scale the number of Geth nodes in order to cover the case when one node crashes. It turns out that
We used a simple load balancer before the three Geth nodes, which was sending each transaction to one of the three nodes. The problem was that each time we submitted many transactions at once, some of those transactions were mysteriously disappearing.
https://ethereum.stackexchange.com/questions/12823/proper-transaction-signing
const Web3 = require('web3'); const Tx = require('ethereumjs-tx'); const config = require('./config'); const web3 = new Web3(new Web3.providers.HttpProvider(config.provider)); //link provided by Infura.io web3.eth.defaultAccount = "0xc929c890f1398d5c1ecdf4f9ecec016906ac9f7f"; const getNonce = () => { return new Promise((resolve, reject) => { web3.eth.getTransactionCount(web3.eth.defaultAccount, (error, result) => { if(error) reject(error); resolve(web3.toHex(result)); }) }) } const getGasPrice = () => { return new Promise((resolve, reject) => { web3.eth.getGasPrice((error, result) => { if(error) reject(error); resolve(web3.toHex(result.toNumber())); }) }) } const sendRawTransaction = (rawTx) => { const privateKey = "190b820c2627f26fd1b973b72dcba78ff677ca4395c64a4a2d0f4ef8de36883c"; const tx = new Tx(rawTx); const privateKeyBuffer = Buffer.
https://zhen.org/blog/ring-buffer-variable-length-low-latency-disruptor-style/
https://github.com/smartystreets-prototypes/go-disruptor
https://ethereum.stackexchange.com/questions/50042/why-does-sendsignedtransaction-return-a-tx-hash-but-does-not-post-to-the-rinkeby
window.web3 = new Web3(new Web3.providers.HttpProvider(endpoint)); sendEther() { const fromAccount = **acct1**; const toAccount = **acct2**; const rawTransaction = this.makeRawTransaction(fromAccount, toAccount); const signedTransaction = this.makeSignedTransaction(rawTransaction); const serializedTransaction = `0x${signedTransaction.serialize().toString('hex')}`; window.web3.eth.sendSignedTransaction(serializedTransaction, (error, result) => { if(!error) { console.log(`Transaction hash is: ${result}`); this.setState({ etherscanUrl: `https://rinkeby.etherscan.io/tx/${result}`, error: null }); } else { this.setState({ error: error.message }) console.error(error); } }); } makeSignedTransaction(rawTransaction) { const privateKey = '**************'; const privateKeyX = new Buffer(privateKey, 'hex'); const transaction = new EthTx(rawTransaction); transaction.
https://www.cnbeta.com/articles/tech/922349.htm
尽管执行了各种各样的测试,但是如果对在七个不同操作系统上成功运行的所有测试取几何平均值,可以得出这样的结论:
Windows 10 Build 19008 的总体性能要比 Build 18362 版本好,而 WSL 的性能并没有太大变化
WSL2 比 WSL 的性能确实稍好一些,这是因为在 I/O 或网络活动繁重的工作负载的情况下前者性能要好得多
在这种特殊的 Core i9 7960X 场景下,运行 Ubuntu Linux 的速度总体上比最快的 Windows 配置快 27%
有兴趣的朋友可查看这份更详细的 OpenBenchmarking.org 结果文件,以深入研究这些 Windows / WSL / Linux 基准测试内容。
geth --exec "eth.blockNumber" attach --datadir ./ geth --exec "eth.syncing" attach --datadir ./ geth --exec "admin.peers" attach --datadir ./ geth --exec "clique.getSnapshot()" attach --datadir ./ watch -n 2 'geth --exec "clique.getSnapshot()" attach --datadir ./'