command
Version:
v0.15.0
Opens a new window with list of versions in this module.
Published: Aug 25, 2025
License: MIT
Opens a new window with license information.
Imports: 10
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Example RPC Server usage.
- Implement a simple RPC server
- Handle requests with different processing times and gc-heavy operations
- Use pprof for profiling
- Use Vegeta for load testing
Getting started:
cd examples/rpcserver
# Run the RPC server
go run main.go
# Example requests
curl 'http://localhost:8080' --header 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"slow","params":[],"id":2}'
# Using packaged payloads
curl 'http://localhost:8080' --header 'Content-Type: application/json' --data "@rpc-payload-fast.json"
curl 'http://localhost:8080' --header 'Content-Type: application/json' --data "@rpc-payload-slow.json"
# Load testing with Vegeta
vegeta attack -rate=10000 -duration=60s -targets=targets.txt | tee results.bin | vegeta report
# Grab pprof profiles
go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30
go tool pprof http://localhost:6060/debug/pprof/heap
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.