On Nov 26, 2007 2:48 PM, Bill Moran <<a href="mailto:wmoran@potentialtech.com">wmoran@potentialtech.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">In response to "Khalid Baheyeldin" <<a href="mailto:kb@2bits.com">kb@2bits.com</a>>:<br><br></div><div><div></div><div class="Wj3C7c">> On Nov 26, 2007 1:52 PM, Bill Moran <<a href="mailto:wmoran@potentialtech.com">
wmoran@potentialtech.com</a>> wrote:<br>><br>> > My point is:<br>> > a) Let me send you a tweaked postgresql.conf file and well find<br>> > out whether the performance difference is simply a matter of
<br>> > untuned configuration and ...<br>><br>> I will post them for all to see, maybe someone will point out something<br>> else.<br>><br>> These are the non comment lines in postgresql.conf<br>>
<br>> hba_file = '/etc/postgresql/8.2/main/pg_hba.conf'<br>> ident_file = '/etc/postgresql/8.2/main/pg_ident.conf'<br>> external_pid_file = '/var/run/postgresql/8.2-main.pid'<br>> listen_addresses = 'localhost'
<br>> port = 5432<br>> max_connections = 100<br>> unix_socket_directory = '/var/run/postgresql'<br>> shared_buffers = 24MB<br>> max_fsm_pages = 153600<br>> log_line_prefix = '%t '<br>> stats_row_level = on
<br>> autovacuum = on<br>> datestyle = 'iso, dmy'<br>> lc_messages = 'en_CA.UTF-8'<br>> lc_monetary = 'en_CA.UTF-8'<br>> lc_numeric = 'en_CA.UTF-8'<br>> lc_time = 'en_CA.UTF-8'
<br><br></div></div>Oh yeah ... there's lots of room for improvement here.<br><br>How much RAM does this system have, and how much of it is "free"<br>memory during the test?<br></blockquote><div><br>2GB of RAM.
<br><br>Here is the output from free:<br><br><span style="font-family: courier new,monospace;"> total used free shared buffers cached</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Mem: 2060032 1813748 246284 0 576896 439828</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
-/+ buffers/cache: 797024 1263008</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Swap: 3903712 260 3903452</span><br style="font-family: courier new,monospace;">
<br>And here is /proc/meminfo<br><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">MemTotal: 2060032 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
MemFree: 245736 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Buffers: 577000 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
Cached: 439912 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">SwapCached: 16 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
Active: 777476 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Inactive: 550212 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
SwapTotal: 3903712 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">SwapFree: 3903452 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
Dirty: 96 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Writeback: 0 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
AnonPages: 310812 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Mapped: 32764 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
Slab: 457012 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">SReclaimable: 425856 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
SUnreclaim: 31156 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">PageTables: 9352 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
NFS_Unstable: 0 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Bounce: 0 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
CommitLimit: 4933728 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Committed_AS: 526896 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
VmallocTotal: 34359738367 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">VmallocUsed: 2724 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
VmallocChunk: 34359735611 kB</span><br><br>We can carve off some memory from cache and buffers (1016 MB combined).<br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Khalid ... are you willing to work with me to investigate this?<br>If not, I'll try to get my own test rig set up, but it probably<br>won't happen until the new year.<br></blockquote><div><br>I am willing to, time permitting of course.
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Off the top of my head, I'd start out with 2 things:<br>*) Bump shared_buffers to 1/4 the total memory on the system
<br>*) "vacuum analyze" the database after the load but before<br> the perf test.<br></blockquote><div><br>What do you mean after the load? You mean after loading data into the database but before running ab?<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>I'll look this over a bit and send you a recommended config file<br>later this evening.
<br><br></blockquote></div><br>Will look forward to it.<br><br>I guess we can take this conversation off the list too, so as not to spam others.<br>-- <br>Khalid M. Baheyeldin<br><a href="http://2bits.com">2bits.com</a><br>
<a href="http://2bits.com">http://2bits.com</a><br>Drupal optimization, development, customization and consulting.