Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6637773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:21:15+00:00 2026-05-25T23:21:15+00:00

I got two identical servers, in both is installed postgresql server version 9.0.4 with

  • 0

I got two identical servers, in both is installed postgresql server version 9.0.4 with the same configuration. If I launch a .sql file that performs about 5k inserts, on the first one it takes a couple of seconds, on the second one it takes 1 minute and 30 seconds.

If I set synchronous_commit, speed dramatically reduces (as expected), and the performances of the two servers are comparable. But if I set synchronous_commit to on, on one server the insert script execution time increases of less than one second, on the other one it increases too much, as I said in the first period.

Any idea about this difference in performances? Am I missing some configuration?

Update: tried a simple disk test: time sh -c "dd if=/dev/zero of=ddfile bs=8k count=200000 && sync"

fast server output:

1638400000 bytes (1.6 GB) copied, 1.73537 seconds, 944 MB/s

real    0m32.009s
user    0m0.018s
sys 0m2.298s

slow server output:

1638400000 bytes (1.6 GB) copied, 4.85727 s, 337 MB/s

real    0m35.045s
user    0m0.019s
sys 0m2.221s

Common features (both servers):

SATA, RAID1, controller: Intel Corporation 82801JI (ICH10 Family) SATA AHCI Controller, distribution: linux centOS. mount -v output:
/dev/md2 on / type ext3 (rw)
proc on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/md1 on /boot type ext3 (rw)

fast server: kernel 2.6.18-238.9.1.el5 #1 SMP

Disk /dev/sda: 750.1 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            3906     4209029     2102562   fd  Linux raid autodetect
/dev/sda2         4209030     4739174      265072+  fd  Linux raid autodetect
/dev/sda3         4739175  1465144064   730202445   fd  Linux raid autodetect

slow server: kernel 2.6.32-71.29.1.el6.x86_64 #1 SMP

Disk /dev/sda: 750.2 GB, 750156374016 bytes
64 heads, 32 sectors/track, 715404 cylinders, total 1465149168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006ffc4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     4194303     2096128   fd  Linux raid autodetect
/dev/sda2         4194304     5242879      524288   fd  Linux raid autodetect
/dev/sda3         5242880  1465147391   729952256   fd  Linux raid autodetect

Could it be useful to address the performance issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:21:16+00:00Added an answer on May 25, 2026 at 11:21 pm

    I suppose your slow server with newer kernel has working barriers. This is good, as otherwise you can loose data in case of a power failure. But it is of course slower than running with write cache enabled and without barriers, aka running with scissors.

    You can check if barriers are enabled using mount -v — search for barrier=1 in output. You can disable barriers for your filesystem (mount -o remount,barrier=0 /) to speed up, but then you risk data corruption.

    Try to do your 5k inserts in one transaction — Postgres won’t have to write to disk on every row inserted. The theoretical limit for number of transactions per second wound be comparable to disk rotational speed (7200rpm disk ≈ 7200/60 tps = 120 tps) as a disk can only write to a sector once per rotation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got two web portals that are almost identical in architecture. One requires that
I've got an Employees table on a SQL 2005 server, and a nearly-identical Employees
I got two projects running, both written in PHP. Now I want to merge
I got two gridviews in the same page, which basically displays the same type
We've got two developers on the same closed (ugh, stupid gov) network, Another developer
I've got two Silverlight Controls in my project, both have properties TeamId. I would
I've got two controls in my Interface Builder file, and each of those controls
I've got some code files that are used in two different projects (and solutions).
The scenario I've got two tables with identical structure. TABLE [INFORMATION], [SYNC_INFORMATION] [ITEM] [nvarchar](255)
Bug: I've got an ASP.NET web application that occasionally sets identical cookie keys for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.