getRecentPerformanceSamples — Solana RPC Method
getRecentPerformanceSamples returns performance metrics sampled every 60 seconds, including the number of slots, transactions, and non-vote transactions processed in each window. This is the standard way to calculate Solana’s transactions per second (TPS).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | usize | No | Number of samples to return. Default and maximum: 720 (12 hours of data). |
Request
curl -X POST https://api.mainnet-beta.solana.com \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getRecentPerformanceSamples",
"params": [5]
}'
TypeScript (@solana/kit)
import { createSolanaRpc } from "@solana/kit";
const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
const samples = await rpc.getRecentPerformanceSamples(5).send();
for (const sample of samples) {
const tps = Number(sample.numTransactions) / Number(sample.samplePeriodSecs);
console.log(`Slot ${sample.slot}: ${tps.toFixed(0)} TPS`);
}
Response
{
"jsonrpc": "2.0",
"result": [
{
"slot": 341200000,
"numSlots": 150,
"numTransactions": 450000,
"numNonVoteTransactions": 180000,
"samplePeriodSecs": 60
}
],
"id": 1
}
| Field | Type | Description |
|---|---|---|
slot | u64 | Slot at which the sample was taken. |
numSlots | u64 | Number of slots completed in the sample period. |
numTransactions | u64 | Total transactions processed (including vote transactions). |
numNonVoteTransactions | u64 | Non-vote transactions processed. |
samplePeriodSecs | u16 | Duration of the sample period in seconds (always 60). |
Samples are ordered from most recent to oldest.
Calculating TPS
- Total TPS:
numTransactions / samplePeriodSecs - Real TPS (excluding votes):
numNonVoteTransactions / samplePeriodSecs
Vote transactions typically account for 50-80% of total transactions on mainnet. The “real TPS” metric (non-vote) is a better indicator of user activity.
Common errors
- Invalid limit — values above 720 return an error.
Performance
The response contains up to 720 small objects (12 hours of 60-second samples). Even at maximum limit, the response is compact. Safe to call periodically for dashboard updates.
FAQ
How do I calculate current TPS?
Take the most recent sample and divide numTransactions by samplePeriodSecs. For non-vote TPS, use numNonVoteTransactions instead.
Why is TPS so much lower when excluding vote transactions? Validators submit vote transactions every slot to participate in consensus. On a network with 1,500+ validators, this generates thousands of vote transactions per second. Non-vote TPS reflects actual user and application activity.
How far back do samples go? Up to 720 samples at 60 seconds each, covering approximately 12 hours of data.
What is a typical TPS for Solana mainnet? Total TPS (including votes) is typically 2,000-5,000+. Non-vote TPS varies widely with demand, ranging from 500 to 3,000+ during peak periods.
How many slots should I see per sample? At 400ms per slot and a 60-second window, expect approximately 150 slots per sample. Fewer indicates a higher skip rate.
Parameters
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
limit | usize | No | Number of samples to return. Maximum 720. | — |
Updated: