On Nov 26, 2007 2:48 PM, Bill Moran &lt;<a href="mailto:wmoran@potentialtech.com">wmoran@potentialtech.com</a>&gt; 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 &quot;Khalid Baheyeldin&quot; &lt;<a href="mailto:kb@2bits.com">kb@2bits.com</a>&gt;:<br><br></div><div><div></div><div class="Wj3C7c">&gt; On Nov 26, 2007 1:52 PM, Bill Moran &lt;<a href="mailto:wmoran@potentialtech.com">
wmoran@potentialtech.com</a>&gt; wrote:<br>&gt;<br>&gt; &gt; My point is:<br>&gt; &gt; a) Let me send you a tweaked postgresql.conf file and well find<br>&gt; &gt; &nbsp; out whether the performance difference is simply a matter of
<br>&gt; &gt; &nbsp; untuned configuration and ...<br>&gt;<br>&gt; I will post them for all to see, maybe someone will point out something<br>&gt; else.<br>&gt;<br>&gt; These are the non comment lines in postgresql.conf<br>&gt;
<br>&gt; hba_file = &#39;/etc/postgresql/8.2/main/pg_hba.conf&#39;<br>&gt; ident_file = &#39;/etc/postgresql/8.2/main/pg_ident.conf&#39;<br>&gt; external_pid_file = &#39;/var/run/postgresql/8.2-main.pid&#39;<br>&gt; listen_addresses = &#39;localhost&#39;
<br>&gt; port = 5432<br>&gt; max_connections = 100<br>&gt; unix_socket_directory = &#39;/var/run/postgresql&#39;<br>&gt; shared_buffers = 24MB<br>&gt; max_fsm_pages = 153600<br>&gt; log_line_prefix = &#39;%t &#39;<br>&gt; stats_row_level = on
<br>&gt; autovacuum = on<br>&gt; datestyle = &#39;iso, dmy&#39;<br>&gt; lc_messages = &#39;en_CA.UTF-8&#39;<br>&gt; lc_monetary = &#39;en_CA.UTF-8&#39;<br>&gt; lc_numeric = &#39;en_CA.UTF-8&#39;<br>&gt; lc_time = &#39;en_CA.UTF-8&#39;
<br><br></div></div>Oh yeah ... there&#39;s lots of room for improvement here.<br><br>How much RAM does this system have, and how much of it is &quot;free&quot;<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;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; total&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; used&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; free&nbsp;&nbsp;&nbsp;&nbsp; shared&nbsp;&nbsp;&nbsp; buffers&nbsp;&nbsp;&nbsp;&nbsp; cached</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Mem:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2060032&nbsp;&nbsp;&nbsp; 1813748&nbsp;&nbsp;&nbsp;&nbsp; 246284&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp; 576896&nbsp;&nbsp;&nbsp;&nbsp; 439828</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
-/+ buffers/cache:&nbsp;&nbsp;&nbsp;&nbsp; 797024&nbsp;&nbsp;&nbsp; 1263008</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Swap:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3903712&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 260&nbsp;&nbsp;&nbsp; 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:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2060032 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
MemFree:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 245736 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Buffers:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 577000 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
Cached:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 439912 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">SwapCached:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
Active:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 777476 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Inactive:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 550212 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
SwapTotal:&nbsp;&nbsp;&nbsp;&nbsp; 3903712 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">SwapFree:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3903452 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
Dirty:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 96 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Writeback:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
AnonPages:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 310812 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Mapped:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 32764 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
Slab:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 457012 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">SReclaimable:&nbsp;&nbsp; 425856 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
SUnreclaim:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 31156 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">PageTables:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9352 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
NFS_Unstable:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Bounce:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
CommitLimit:&nbsp;&nbsp; 4933728 kB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Committed_AS:&nbsp;&nbsp; 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:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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&#39;ll try to get my own test rig set up, but it probably<br>won&#39;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&#39;d start out with 2 things:<br>*) Bump shared_buffers to 1/4 the total memory on the system
<br>*) &quot;vacuum analyze&quot; the database after the load but before<br> &nbsp; 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&#39;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.