PostgreSQL Performance Showdown: Apple M1 vs. Intel Xeon Silver 4110
Apple

PostgreSQL Performance Showdown: Apple M1 vs. Intel Xeon Silver 4110

2025-01-30 · 5 分鐘 · Ray Lee (System Analyst)

We recently conducted a performance comparison of PostgreSQL on two different architectures: an Apple M1 chip and an Intel Xeon Silver 4110. The goal was to evaluate the transaction processing speed and latency under a simple workload. This blog post details the setup, results, and some initial observations.

Test Setup:

We used pgbench, a standard PostgreSQL benchmarking tool, for this comparison. The following commands were executed on both systems:

pgbench -i testdb
pgbench -c 10 -t 1000 testdb

This initializes a database named testdb and then runs a benchmark with 10 clients, each performing 1000 transactions. We used the simple query mode for this test. The key parameters were:

  • Number of clients: 10
  • Number of threads: 1 (default)
  • Transactions per client: 1000
  • Query mode: simple

Results:

Here’s a comparison of the results:

MetricIntel Xeon Silver 4110Apple M1
CPU2.10 GHz 3.2 GHz
Latency Average (ms)12.8470.867
Initial Connection Time (ms)102.141N/A
Transactions per Second (tps) (incl. conn)778.3711532.72
Transactions per Second (tps) (excl. conn)778.3711571.74

Observations:

The results show a significant performance difference between the two systems. The Apple M1 outperformed the Intel Xeon Silver 4110 by a substantial margin. Specifically:

  • Latency: The Apple M1 exhibited significantly lower latency (0.867ms) compared to the Intel Xeon (12.847ms). This suggests that the M4 can process individual transactions much faster.
  • Transactions per Second (TPS): The Apple M1 achieved a dramatically higher TPS (11532.72 including connection time) compared to the Intel Xeon (778.37). This indicates the M4’s ability to handle a much greater volume of transactions per unit of time.

Initial Thoughts:

The massive difference in performance is striking. While a comprehensive analysis would require more in-depth investigation, a few potential factors contribute to this disparity:

  • Architecture: The Apple M1’s unified memory architecture and high clock speed likely play a significant role in its superior performance. It’s designed for efficiency and low latency.
  • Clock Speed vs. IPC: While the Intel Xeon has a higher clock speed, the Apple M1 likely has a much higher Instructions Per Cycle (IPC), meaning it can execute more instructions per clock cycle.
  • Cooling and Power: The M1 is designed for a mobile environment, which often prioritizes power efficiency and thermal management. This could lead to more consistent performance under load.
English Version

We recently conducted a performance comparison of PostgreSQL on two different architectures: an Apple M1 chip and an Intel Xeon Silver 4110. The goal was to evaluate the transaction processing speed and latency under a simple workload. This blog post details the setup, results, and some initial observations.

Test Setup:

We used pgbench, a standard PostgreSQL benchmarking tool, for this comparison. The following commands were executed on both systems:

pgbench -i testdb
pgbench -c 10 -t 1000 testdb

This initializes a database named testdb and then runs a benchmark with 10 clients, each performing 1000 transactions. We used the simple query mode for this test. The key parameters were:

  • Number of clients: 10
  • Number of threads: 1 (default)
  • Transactions per client: 1000
  • Query mode: simple

Results:

Here’s a comparison of the results:

MetricIntel Xeon Silver 4110Apple M1
CPU2.10 GHz 3.2 GHz
Latency Average (ms)12.8470.867
Initial Connection Time (ms)102.141N/A
Transactions per Second (tps) (incl. conn)778.3711532.72
Transactions per Second (tps) (excl. conn)778.3711571.74

Observations:

The results show a significant performance difference between the two systems. The Apple M1 outperformed the Intel Xeon Silver 4110 by a substantial margin. Specifically:

  • Latency: The Apple M1 exhibited significantly lower latency (0.867ms) compared to the Intel Xeon (12.847ms). This suggests that the M4 can process individual transactions much faster.
  • Transactions per Second (TPS): The Apple M1 achieved a dramatically higher TPS (11532.72 including connection time) compared to the Intel Xeon (778.37). This indicates the M4’s ability to handle a much greater volume of transactions per unit of time.

Initial Thoughts:

The massive difference in performance is striking. While a comprehensive analysis would require more in-depth investigation, a few potential factors contribute to this disparity:

  • Architecture: The Apple M1’s unified memory architecture and high clock speed likely play a significant role in its superior performance. It’s designed for efficiency and low latency.
  • Clock Speed vs. IPC: While the Intel Xeon has a higher clock speed, the Apple M1 likely has a much higher Instructions Per Cycle (IPC), meaning it can execute more instructions per clock cycle.
  • Cooling and Power: The M1 is designed for a mobile environment, which often prioritizes power efficiency and thermal management. This could lead to more consistent performance under load.
日本語版

最近、Apple M1チップとIntel Xeon Silver 4110という2つの異なるアーキテクチャでPostgreSQLのパフォーマンス比較を実施しました。目的は、シンプルなワークロードにおけるトランザクション処理速度とレイテンシを評価することです。このブログ記事では、セットアップ、結果、および初期的な考察について詳しく説明します。

テストセットアップ:

この比較には、PostgreSQLの標準ベンチマークツールであるpgbenchを使用しました。両システムで以下のコマンドを実行しました:

pgbench -i testdb
pgbench -c 10 -t 1000 testdb

これによりtestdbという名前のデータベースを初期化し、10クライアントがそれぞれ1000トランザクションを実行するベンチマークを実行します。このテストではシンプルクエリモードを使用しました。主なパラメータは以下の通りです:

  • クライアント数: 10
  • スレッド数: 1(デフォルト)
  • クライアントあたりのトランザクション数: 1000
  • クエリモード: simple

結果:

結果の比較は以下の通りです:

指標Intel Xeon Silver 4110Apple M1
CPU2.10 GHz 3.2 GHz
平均レイテンシ (ms)12.8470.867
初期接続時間 (ms)102.141N/A
秒間トランザクション数 (tps)(接続込み)778.3711532.72
秒間トランザクション数 (tps)(接続除外)778.3711571.74

考察:

結果は、2つのシステム間に大きなパフォーマンス差があることを示しています。Apple M1はIntel Xeon Silver 4110を大幅に上回りました。具体的には:

  • レイテンシ: Apple M1はIntel Xeon(12.847ms)と比較して大幅に低いレイテンシ(0.867ms)を示しました。これは、M1が個々のトランザクションをはるかに高速に処理できることを示唆しています。
  • 秒間トランザクション数 (TPS): Apple M1はIntel Xeon(778.37)と比較して劇的に高いTPS(接続時間込みで11532.72)を達成しました。これは、M1が単位時間あたりはるかに多くのトランザクションを処理できる能力を示しています。

初期的な考察:

パフォーマンスの大きな差は注目に値します。包括的な分析にはより深い調査が必要ですが、この差に寄与するいくつかの潜在的な要因があります:

  • アーキテクチャ: Apple M1のユニファイドメモリアーキテクチャと高いクロック速度が、その優れたパフォーマンスに大きく貢献していると考えられます。効率性と低レイテンシのために設計されています。
  • クロック速度 vs. IPC: Intel Xeonはより高いクロック速度を持っていますが、Apple M1はおそらくはるかに高いIPC(Instructions Per Cycle:クロックサイクルあたりの命令数)を持っており、クロックサイクルあたりにより多くの命令を実行できます。
  • 冷却と消費電力: M1はモバイル環境向けに設計されており、電力効率と熱管理を優先することが多いです。これにより、負荷時でもより安定したパフォーマンスが得られる可能性があります。
Ray Lee (System Analyst)
作者 Ray Lee (System Analyst)

iDempeire ERP Contributor, 經濟部中小企業處財務管理顧問 李寶瑞