Performance Engineering

Notes

Wall time: Elapsed real time (opens in a new tab)

Benchmark

  • Measure the end to end time for some operations for making comparisons

shell - time

The time command runs the arguments given to it, and records three lines of additional output:

  • real: the wall clock time.
  • user: the process CPU time.
  • sys: the operating system CPU time due to system calls from the process.

Java Microbenchmark Harness (JMH)

Disk I/O Performance

fio

Network I/O Performance

HTTP

wrk
k6
Gatling
nghttp2 - h2load
siege
HAR Analyzer

SSL/TLS

Measure TLS connection and handshake time
openssl s_time -connect $host:$port -new
Measure speed of various security algorithms
openssl speed $algorithm

Shell CLI

Show how long a command takes

time $command

or

hyperfine $command

Show performance counter stats for a command

perf stat $command

Resources

PostgreSQL

Query Performance

Log slow queries
# Log all statements executed longer than 3000 milliseconds
log_min_duration_statement = 3000
Performance maintenance routines
  • For each table, run a manual VACUUM (ANALYZE) operation on the table. This makes sure VACUUM updates the visibility map and ANALYZE updates statistics.
  • For indexes used by the query, check their estimated bloat percentage. Compare the estimated and actual figures. Consider a REINDEX CONCURRENTLY for indexes to rebuild them.
  • If Autovacuum seems to be falling behind, add more resources to Autovacuum globally or per table. You may also schedule supplemental maintenance operations.

Redis

Apache Kafka

Git

Resources - Reading

Load Testing

Load Generator

Faban

Serialization / Deserialization

JSON