Description
The GET /user/me endpoint is used throughout the data submission workflow to verify each user’s permissions, and it is called in parallel by multiple services during this process, and each response takes a considerable amount of time.
Details
For local testing, a Bash script is run in multiple terminals at the same time to concurrently call the /user/me endpoint.
Executed on a mac connected to the OICR VPN on Tue Apr 21 11:57:10 EDT 2026
SERVER="${SERVER:-https://your-server.example.com}"
BEARER_TOKEN="${BEARER_TOKEN:-your-bearer-token-here}"
SERVICE_TOKEN="${SERVICE_TOKEN:-your-service-token-here}"
SERVICE_ID="${SERVICE_ID:-your-service-id-here}"
REQUEST_COUNT="${1:-${REQUEST_COUNT:-100}}"
TOTAL_TIME=0
for i in $(seq 1 "$REQUEST_COUNT"); do
echo "Request #$i"
RESPONSE=$(curl --location "${SERVER}/user/me" \
--header "X-Service-Token: ${SERVICE_TOKEN}" \
--header "X-Service-ID: ${SERVICE_ID}" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
-s -o /dev/null -w "HTTP Status: %{http_code} | Time: %{time_total}s\n")
echo "$RESPONSE"
REQUEST_TIME=$(echo "$RESPONSE" | grep -oE '[0-9]+\.[0-9]+')
TOTAL_TIME=$(echo "$TOTAL_TIME + $REQUEST_TIME" | bc)
done
AVG_TIME=$(echo "scale=6; $TOTAL_TIME / $REQUEST_COUNT" | bc)
echo ""
echo "--- Summary ---"
echo "Total requests: $REQUEST_COUNT"
echo "Total time: ${TOTAL_TIME}s"
echo "Average time: ${AVG_TIME}s"
Bellow the result in dev, staging and prod.
| Environment |
Avg time |
| Dev |
0.69s |
| Staging |
2.08s |
| Prod |
1.52s |
Conclusion: Staging and prod takes 1.5 - 2s to respond each request, which for a frequently consumed endpoint it negatively impacts the performance of the submission workflow
Description
The GET
/user/meendpoint is used throughout the data submission workflow to verify each user’s permissions, and it is called in parallel by multiple services during this process, and each response takes a considerable amount of time.Details
For local testing, a Bash script is run in multiple terminals at the same time to concurrently call the
/user/meendpoint.Executed on a mac connected to the OICR VPN on Tue Apr 21 11:57:10 EDT 2026
Bellow the result in dev, staging and prod.
Conclusion: Staging and prod takes 1.5 - 2s to respond each request, which for a frequently consumed endpoint it negatively impacts the performance of the submission workflow