getRecentPerformanceSamples
Returns a list of recent performance samples, in reverse slot order. Performance samples are taken every 60 seconds and include the number of transactions and slots that occur in a given time window.
Common use cases
| Monitor network throughput (TPS calculation) | Fetch recent samples and compute numTransactions / samplePeriodSecs to measure current network capacity and health. Essential for dashboards, alerts, and capacity planning. |
| Analyze historical network performance | Retrieve multiple samples (up to 720) to calculate rolling averages, detect performance degradation patterns, or measure network behavior during specific events (e.g., NFT mints, protocol upgrades). |
| Calculate average slot time | Use samplePeriodSecs / numSlots to determine slot production rate (typically 400-450ms). Critical for validator performance analysis and confirming network timing assumptions. |
Parameters
number of samples (usize, optional)
Number of samples to return (maximum 720)
Request
- cURL
- JavaScript
- Python
curl https://solana-mainnet.api.syndica.io/api-key/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getRecentPerformanceSamples",
"params": [
2
]
}'
// Using fetch
const response = await fetch('https://solana-mainnet.api.syndica.io/api-key/YOUR_API_KEY', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "getRecentPerformanceSamples",
"params": [
2
]
})
});
const data = await response.json();
console.log(data);
import requests
import json
url = 'https://solana-mainnet.api.syndica.io/api-key/YOUR_API_KEY'
headers = {'Content-Type': 'application/json'}
data = {
"jsonrpc": "2.0",
"id": 1,
"method": "getRecentPerformanceSamples",
"params": [
2
]
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
Replace mainnet with devnet in the URL to query devnet instead.
Response
{
"jsonrpc": "2.0",
"result": [
{
"slot": 348125,
"numTransactions": 126,
"numSlots": 126,
"samplePeriodSecs": 60,
"numNonVoteTransactions": 1
},
{
"slot": 347999,
"numTransactions": 126,
"numSlots": 126,
"samplePeriodSecs": 60,
"numNonVoteTransactions": 1
}
],
"id": 1
}
Response Fields
Return value: array
An array of performance sample objects containing:
FAQ and Troubleshooting
How do I calculate the current TPS of the Solana network?
Fetch a recent sample with limit: 1, then compute TPS = numTransactions / samplePeriodSecs. For example, if numTransactions = 263299 and samplePeriodSecs = 60, then TPS = 4388.3.
What is the samplePeriodSecs value, and does it change?
It is always 60 seconds. Each sample represents a fixed 60-second window of network activity.
Why is numNonVoteTransactions sometimes missing?
The numNonVoteTransactions field is optional and may be absent in older samples. Always check for its presence before using it in calculations.
How can I analyze performance over a specific time range?
Fetch up to 720 samples (12 hours of history), filter by slot range, and aggregate numTransactions and numSlots to compute metrics over your desired timeframe.
Related Methods
getSlot
Retrieve the current slot to correlate performance samples with real-time network state. Often used together to validate that samples are recent.
getEpochInfo
Fetch epoch details to contextualize performance data within epoch boundaries. Useful for analyzing performance trends across epochs.
getRecentPrioritizationFees
While getRecentPerformanceSamples measures network throughput, this method reveals fee market dynamics. Together, they provide comprehensive network health insights.
getVersion
Confirm the validator software version to correlate performance characteristics with specific releases.