skalenetwork / skale-proxy

SKALE Proxy is high performance, easy-to-run public service that provides proxied and load-balanced JSON-RPC endpoints for SKALE chains. It is based on NGINX.
GNU Affero General Public License v3.0
2 stars 3 forks source link

Improve proxy nginx performance, optimise logs #31

Open dmytrotkk opened 1 year ago

dmytrotkk commented 1 year ago

Problem

  1. Due to the high load users sometimes experience timeout errors:
Error: missing response (requestBody="{\"method\":\"eth_getBlockByNumber\",\"params\":[\"latest\",false],\"id\":47,\"jsonrpc\":\"2.0\"}", requestMethod="POST", serverError={"errno":-60,"code":"ETIMEDOUT","syscall":"connect","address":"18.118.22.234","port":443}, ...
  1. Logs in nginx don't include proxy redirect path
  2. Logs file size limit is too low

Solution

A few changes need to be made to fix it:

  1. Tune nginx config to use all 8 cores
  2. Enable and configure ngx_http_stub_status_module in nginx to see live stats
  3. Increase log file size 10 times 👀
  4. Add proxy path to logs