<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0"><id>tag:blogger.com,1999:blog-17085626</id><updated>2012-05-24T10:38:46.442-04:00</updated><category term="DataDirector" /><category term="postgresql" /><category term="VMware" /><category term="SunBlogs" /><title type="text">Jignesh Shah's  Blog</title><subtitle type="html">Blog about technologies like PostgreSQL, vFabric Postgres (vPostgres), vFabric  Data Director, Open Source..</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/search/label/postgresql" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/jkshah" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="jkshah" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry><id>tag:blogger.com,1999:blog-17085626.post-2509718953594435939</id><published>2012-05-18T15:11:00.002-04:00</published><updated>2012-05-24T10:37:12.849-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">PgCon 2012: OLTP Performance Benchmarks Overview</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;The slides from my presentation today.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.pgcon.org/2012/schedule/attachments/255_PGConf12_OLTP_Benchmarks.pdf" target="_blank"&gt;&lt;img alt="" border="0" height="300" src="http://1.bp.blogspot.com/-Cn3HlYy-wM0/T7aeQg4MvDI/AAAAAAAAAGo/nY9zSLsuvBI/s400/PGConf12_OLTP_Benchmarks.jpg" title="PgCon 2012: OLTP Performance Benchmark Review - Jignesh Shah" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-2509718953594435939?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/2509718953594435939/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=2509718953594435939" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/2509718953594435939" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/2509718953594435939" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2012/05/pgcon-2012-oltp-performance-benchmarks.html" title="PgCon 2012: OLTP Performance Benchmarks Overview" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-Cn3HlYy-wM0/T7aeQg4MvDI/AAAAAAAAAGo/nY9zSLsuvBI/s72-c/PGConf12_OLTP_Benchmarks.jpg" height="72" width="72" /><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-65027497897812826</id><published>2011-12-20T17:46:00.001-05:00</published><updated>2011-12-20T17:48:18.802-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VMware" /><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><category scheme="http://www.blogger.com/atom/ns#" term="DataDirector" /><title type="text">Using DVDStore with PostgreSQL</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;We now have support for PostgreSQL in the popular &lt;a href="http://en.community.dell.com/techcenter/extras/w/wiki/dvd-store.aspx"&gt;DVDStore Benchmark&lt;/a&gt; which stresses database using an emulated DVDStore e-Commerce website. DVDStore Benchmark is maintained by Dave Jaffe (Dell) and&amp;nbsp; &lt;a href="http://virtualtoddsbigblog.blogspot.com/"&gt;Todd Muirhead&lt;/a&gt; (VMware).&amp;nbsp; It is an open source database test kit. The beauty of the benchmark kit is it allows the same web application being deployed either as &lt;br /&gt;&lt;ol style="text-align: left;"&gt;&lt;li&gt;Java/Tomcat&amp;nbsp; and connect to the database, &lt;/li&gt;&lt;li&gt;Web Server/PHP and connect to the database, &lt;/li&gt;&lt;li&gt;IIS/ASP.NET connect to the database or &lt;/li&gt;&lt;li&gt;Direct connect to the database and invoking the business logic as stored procedures stored on the database itself. &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Currently the PostgreSQL implementation&amp;nbsp;details&amp;nbsp;are as follows&lt;br /&gt;&lt;ol style="text-align: left;"&gt;&lt;li&gt;Java/Tomcat using PostgreSQL JDBC driver, &lt;/li&gt;&lt;li&gt;Web Server/PHP&amp;nbsp; using &amp;nbsp;PHP-postgres&amp;nbsp;modules which uses&amp;nbsp; libpq&lt;/li&gt;&lt;li&gt;Currently there is noIIS/ASP.NET web app&amp;nbsp; implementation for PostgreSQL&lt;/li&gt;&lt;li&gt;&amp;nbsp;Direct connect to PostgreSQL database and business logic implemented in stored procedures however the driver is implemented using .NET C# and requires Npgsql 2.0.11.0&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Setup instructions for the database are relatively quite easy.&lt;br /&gt;&lt;ol style="text-align: left;"&gt;&lt;li&gt;Download &lt;a href="http://linux.dell.com/dvdstore/ds21.tar.gz"&gt;ds21.tar.gz&lt;/a&gt;&amp;nbsp;&amp;nbsp;and also&amp;nbsp;&lt;a href="http://linux.dell.com/dvdstore/ds21_postgresql.tar.gz"&gt;ds21_postgresql.tar.gz&lt;/a&gt; from&amp;nbsp; &lt;a href="http://linux.dell.com/dvdstore/"&gt;http://linux.dell.com/dvdstore/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Unzip them on the system running PostgreSQL&lt;/li&gt;&lt;li&gt;The default data size is 10MB. If you want a different size execute &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;'perl Install_DVDStore.pl'&lt;/span&gt; in the ds2 directory. (Expects perl to be available on the system. I used the option 100, MB , PGSQL, LINUX respectively for the options.)&lt;/li&gt;&lt;li&gt;Assuming you are logged on as the DB Owner and the database is on the localhost at port 5432, execute the script &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;pgsql_create_all.sh&lt;/span&gt; in the ds2/pgsqlds2 directory. It will create a database "ds2", two users "ds2/ds2" and "web/web", create tables, load tables, create indexes, update sequences and finally run analyze. (The script needs to be modified slighly if the database is already hardened and you want to control the creation of database and the users.)&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Setup for the actual load&amp;nbsp;driver is probably easiest on&amp;nbsp; another Windows platform as follows as it was designed for .NET platform.&lt;br /&gt;&lt;ol style="text-align: left;"&gt;&lt;li&gt;Download and install Windows SDK v6.1 and .NET 3.5 framework&amp;nbsp; on a Windows Client machine. &lt;/li&gt;&lt;li&gt;Once installed start the CMD prompt from &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Programs-&amp;gt; Windows SDKv6.1-&amp;gt; CMD Prompt&lt;/span&gt;. &lt;/li&gt;&lt;li&gt;Verify the above CMD prompt has path setup for gacutil in windows&amp;nbsp;(Try&amp;nbsp;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;'gacutil/l'&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;Download Npgsql 2.0.11 for msnet35 and install the dlls using the gacutil.exe (Note other versions of Npgsql&amp;nbsp;may&amp;nbsp;have issues.)&lt;/li&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;gacutil/i Npgsql.dll &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;gacutil/i Mono.security.dll &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;gacutil/i policy-2.0.Npgsql.dll&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;With the above setup you can use the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;ds2webdriver.exe&lt;/span&gt; in ds2/drivers or the direct &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;ds2pgsqldriver.exe&lt;/span&gt; in ds2/pgsqlds2. More on running the benchmark driver itself&amp;nbsp; in another post.&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-65027497897812826?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/65027497897812826/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=65027497897812826" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/65027497897812826" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/65027497897812826" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2011/12/using-dvdstore-with-postgresql.html" title="Using DVDStore with PostgreSQL" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-5477524875381038808</id><published>2011-10-27T00:00:00.000-04:00</published><updated>2011-10-27T00:00:02.307-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><category scheme="http://www.blogger.com/atom/ns#" term="DataDirector" /><title type="text">How does PostgreSQL HA works in vFabric Data Director?</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Databases go down due to various reasons. Some reasons are known and some unknown.&lt;br /&gt;Common reasons are hardware failure, software failure, database unresponsive, etc. What is considered as a failure is actually one of the tasks. Various DBA's use a simple select statement as a test to make sure that the database is up and working. But what does one do if that simple select statement fails. I remembers years ago I worked on a module which will start paging&amp;nbsp; engineers in a sequence (and eventually their managers if the engineers failed to respond back in a certain expected way).&amp;nbsp; In this email/text age, scripts will start sending out emails and text messages.&amp;nbsp; What we are is basically in the Event-&amp;gt;React-&amp;gt; Respond mode of operation.&lt;br /&gt;&lt;br /&gt;However true HA needs to lower downtime which can&amp;nbsp; only be done by having the mode of operation as Event-&amp;gt;Respond-&amp;gt;React. To explain that when such an event happens, do an automated response first and then React to wake the engineers up :-)&lt;br /&gt;&lt;br /&gt;How do you set this up in vFabric Data Director? This can be achieved by selecting the database properties, selecting the Database Configuration tab and set "High Availability" to "Enable". This is also refered as One-Click HA setting.&lt;br /&gt;&lt;br /&gt;Of course this assumes that your virtual Data Cluster is set properly for providing the high availability services. How do you set it up properly? Well you need atleast two ESXi Hosts so if one host fails, the other can cover for it. Also vSphere HA property has been enabled in the Virtual Data Center Cluster. Note these settings are all "required" for vFabric Database setup and a "supported" setup does mandate atleast two ESXi Hosts in order for HA to work.&lt;br /&gt;&lt;br /&gt;Now that we have gone over the setup requirements, lets go over the scenarios on how the application or user sees it.&amp;nbsp; A user is connected to the database using the connection string. Something happens and the database goes down and the connection drops. Chances are if you reconnect again immediately it may fail. However with certain time which is expected to be less than 5 minutes (which we call our Recovery Time Objective or RTO) &amp;nbsp;by default, if you try again you can connect to the database again. &lt;br /&gt;&lt;br /&gt;So what happens in the background? Well if it was Magic, we would not tell you. But it is not really magic though it feels like that. Here is what will typically happen in the background.&lt;br /&gt;For some reason the PostgreSQL fails to respond anymore it could be a "hung" situation or the PostgreSQL server has died. There is a small heartbeat monitor which figures out the status of the database. If it notices that the hung situation or no DB server process, it will try to restart the database. If the database cannot be restarted (because the whole VM appliance cannot respond anymore), it will in novice terms kill the virtual machine. The vCenter Server which has its own heartbeat on the VM appliance will see that the Virtual Machine has died (irrespective of the Database Monitor which may not be working if the whole host dies), the vCenter Server will restart the VM appliance on another server.&lt;br /&gt;&lt;br /&gt;Since shared-storage is a requirement, the VM appliance will start on another host and it will feel like a reboot. Once the VM starts, the PostgreSQL server process will be restarted. At this point of time, the PostgreSQL server goes into recovery mode. The biggest question at this point of time typically is how long will the recovery mode take. Typically based on internal tests even with the heaviest workload on 8vCPU, the recovery time can finish within the checkpoint_timeout settings which means our Recovery Time Objective is guided by checkpoint_timeout + heartbeat latency + the time to restart the VM on another hosts.&amp;nbsp; Overall we try to fit that into our Recovery Time Objective of 5 minutes.&lt;br /&gt;&lt;br /&gt;Great the virtual machine has restarted and the database has done its recovery and working again. Now what? Well dont forget in this cloud setup, the easiest thing is to use DHCP addresses. Unfortunately DHCP addresses are not guaranteed to be same after reboot . Plus rebooting on a different host makes it more complex to get the same IP. This IP address change can cause the Database connectivity to be lost to the actual end user.&amp;nbsp;&amp;nbsp; In order to shield the end users from this complexity, we sort of implemented our own Database Name Server. However this can only work by modifying the clients which references the database using this "Virtual Hosts" format so that the clients can always find their intended database without really worrying about where it is running. A minor change in the PostgreSQL clients but a huge complexity reducer for end users to fix their IP addresses or domain names to the changed location.&lt;br /&gt;&lt;br /&gt;Aha now this explains why vPostgres ships their own clients and libpq library which is API compatible with standard PostgreSQL libpq library.The libpq library is actually 100% compatible with standard PostgreSQL Libpq library. The only addition it has is the feature of Virtual Hosts which is critical for HA to work seemlessly without the users being concerned about the actual IP of the database. Without the change, HA will not work on the framework. Since it is 100% compatible, if an application works standard libpq it will work with vPostgres libpq. Similar changes are also done in the JDBC driver and ODBC Driver for vPostgres so HA is supported across all supported clients.&lt;br /&gt;&lt;br /&gt;That said if you use standard libpq/psql and other standard clients&amp;nbsp;and you know the IP Address of the vPostgres database and connect to it via that IP address (and not the virtual host string) &amp;nbsp;it will still work flawlessly. However if the database goes down and restarts with a new IP address then the client will have no ability to figure out the new IP address and will have to bug the Administrator to figure out the new IP address. &lt;br /&gt;&lt;br /&gt;Though for folks familiar with vSphere terminology, HA is not FT - Fault Tolerant which is a different take on HA to further reduce downtime from minutes to seconds. More on that in future.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-5477524875381038808?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/5477524875381038808/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=5477524875381038808" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/5477524875381038808" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/5477524875381038808" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2011/10/how-does-postgresql-ha-works-in-vfabric.html" title="How does PostgreSQL HA works in vFabric Data Director?" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-6345323650030781827</id><published>2011-10-13T11:14:00.001-04:00</published><updated>2011-10-13T11:29:03.607-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">Using PostgreSQL Server on Micro Cloud Foundry</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;With the recent news that &lt;a href="http://blog.cloudfoundry.com/post/11063041222/micro-cloud-foundry-tm-now-with-postgresql-and"&gt;PostgreSQL is now available in the Micro Cloud Foundry&lt;/a&gt;, I decided to take it for a test spin. I downloaded the &lt;a href="https://cloudfoundry.com/micro"&gt;Micro Cloud Foundry VM&lt;/a&gt; zip file which is about 1.0GB big. After downloading it I unzipped it on my MacBookPro and use VMware Fusion 4.0.2 to open the VM. As the VM booted up the console shows a message&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Micro Cloud Foundry not configured&lt;/div&gt;&lt;br /&gt;I selected the option 1 to configure the Micro Cloud. It asked me to configure my VM user password, Networking (DHCP or Static) and then asked me to enter my Cloud Foundry configuration token which was provided to me after I had created a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;pgtest.cloudfoundry.me&lt;/span&gt; domain&amp;nbsp; just before the download.&lt;br /&gt;&lt;br /&gt;It took about 5 minutes to setup the cloud &lt;br /&gt;&lt;br /&gt;After the setup: I got my micro cloud foundry setup with my local IP (looked like a bridge connection rather than NAT).&lt;br /&gt;&lt;br /&gt;Then I installed the VMC tool on my Mac using&amp;nbsp; (Need Ruby)&lt;br /&gt;(NOTE: Skip directly to ssh part if you donot want to install Ruby/vmc)&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ gem install vmc&lt;/div&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ vmc target http://api.pgtest.cloudfoundry.me&lt;/div&gt;&lt;br /&gt;Got me connected to my micro cloud.&lt;br /&gt;Then I did a&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ vmc register&lt;/div&gt;to create my user account using a email id and password&lt;br /&gt;Then I logged into the MicroCloud using&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ vmc login&lt;/div&gt;&lt;br /&gt;Now when I do the following I see the PostgreSQL Service available with other databases also.&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ vmc services&lt;br /&gt;&lt;br /&gt;============== System Services ==============&lt;br /&gt;&lt;br /&gt;+------------+---------+---------------------------------------+&lt;br /&gt;| Service&amp;nbsp;&amp;nbsp;&amp;nbsp; | Version | Description&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;+------------+---------+---------------------------------------+&lt;br /&gt;| mongodb&amp;nbsp;&amp;nbsp;&amp;nbsp; | 1.8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | MongoDB NoSQL store&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;| mysql&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 5.1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | MySQL database service&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;| postgresql | 9.0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | PostgreSQL database service (vFabric) |&lt;br /&gt;| rabbitmq&amp;nbsp;&amp;nbsp; | 2.4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | RabbitMQ messaging service&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;| redis&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 2.2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | Redis key-value store service&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;+------------+---------+---------------------------------------+&lt;br /&gt;&lt;br /&gt;=========== Provisioned Services ============&lt;br /&gt;&lt;/div&gt;As you can see there are no provisioned services currently.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here if you are like a Java/Spring developer you want to creating an application using Xin Li's post on "&lt;a href="http://support.cloudfoundry.com/entries/20470268-postgresql-for-micro-cloud-foundry-spring-tutorial"&gt;PostgreSQL for Micro Cloud Foundry- Spring Tutorial&lt;/a&gt;".&lt;br /&gt;&lt;br /&gt;I am not interested in developing Java applications but I want access to the postgresql server directly.&lt;br /&gt;&lt;br /&gt;Now comes the ssh part. &lt;br /&gt;&lt;br /&gt;Currently the PostgreSQL server is not exposed externally from the Micro Cloud.&lt;br /&gt;But on the console of Micro Cloud VM, you can configure the password of vcap user. Which means now you have ssh access to the Micro Cloud VM.&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ ssh vcap@mircrocloudip&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ cd /var/vcap/store/postgresql&lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ vi postgresql.conf&amp;nbsp;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/div&gt;and edit listen_address to add your database client ip address out there.&lt;br /&gt;For my demo setup I just opened it to all&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;listen_addresses='*'&lt;/div&gt;&lt;br /&gt;Next assign a Postgres password for the "vcap" user&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ /var/vcap/packages/postgresql/bin/psql -d postgres&lt;br /&gt;psql (9.0.4)&lt;br /&gt;Type "help" for help.&lt;br /&gt;&lt;br /&gt;postgres=# ALTER USER vcap WITH PASSWORD 'secret';&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ALTER ROLE&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;postgres=#\q&lt;/div&gt;&lt;br /&gt;Now I exit from Micro Cloud VM and using the console I restart the services.&lt;br /&gt;Now the PostgreSQL service can be accessed from postgres client anywhere.&lt;br /&gt;&lt;br /&gt;For example from a Macbook Pro&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ psql -h microcloudip -d postgres -U vcap&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Password for user vcap: &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;psql (9.0.5, server 9.0.4)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Type "help" for help.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;postgres=# &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Try it out!&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-6345323650030781827?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/6345323650030781827/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=6345323650030781827" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/6345323650030781827" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/6345323650030781827" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2011/10/using-postgresql-server-on-micro-cloud.html" title="Using PostgreSQL Server on Micro Cloud Foundry" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-3387773758501610762</id><published>2011-09-29T16:51:00.000-04:00</published><updated>2011-09-29T16:51:05.281-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">#PGWest 2011 -   Using vFabric Postgres - A DB User's Perspective</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Here are my slides from my #PGWest 2011 Presentation " Using vFabric Postgres - A DB User's Perspective" for vPostgres Databases as&amp;nbsp; deployed by vFabric Data Director. &lt;br /&gt;&lt;br /&gt;&lt;iframe frameborder="0" height="506" scrolling="no" src="http://app.sliderocket.com:80/app/fullplayer.aspx?id=03E8FDE2-3758-CB65-FB9A-8C60D5D96504" width="640"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-3387773758501610762?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/3387773758501610762/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=3387773758501610762" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/3387773758501610762" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/3387773758501610762" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2011/09/pgwest-2011-using-vfabric-postgres-db.html" title="#PGWest 2011 -   Using vFabric Postgres - A DB User's Perspective" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-6306735607110869582</id><published>2011-09-15T17:44:00.000-04:00</published><updated>2011-09-15T17:46:25.650-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">Running PostgreSQL on Virtual Environments - #pgopen 2011</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Slides from my presentation&amp;nbsp; at Postgres Open 2011 (#pgopen11) in Chicago.&lt;br /&gt;&lt;br /&gt;&lt;iframe frameborder="0" height="506" scrolling="no" src="http://app.sliderocket.com:80/app/fullplayer.aspx?id=6cd18c4b-dfd3-4ec8-aa98-bf5616fc451a" width="640"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-6306735607110869582?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/6306735607110869582/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=6306735607110869582" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/6306735607110869582" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/6306735607110869582" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2011/09/running-postgresql-on-virtual.html" title="Running PostgreSQL on Virtual Environments - #pgopen 2011" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-1159629644880364127</id><published>2011-09-13T10:46:00.001-04:00</published><updated>2011-09-13T10:46:29.250-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">Next Stop: Postgres Open 2011 - Chicago</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Soon I will be in Chicago for Postgres Open 2011. Here I will be presenting once again&amp;nbsp; &lt;br /&gt;"&lt;a href="http://www.postgresopen.org/2011/schedule/presentations/44/"&gt;Running PostgreSQL on Virtualized Environments&lt;/a&gt;"&amp;nbsp; on Thurday - 11:30am in the Cotillion Ballroom (according to the &lt;a href="http://www.postgresopen.org/2011/schedule/"&gt;current schedule&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;The title should really be "Running Community PostgreSQL on Virtualized Environments" since this presentation really applies to the experiences of running community PostgreSQL in Virtual Machines.&amp;nbsp; Most of the things in the presentation should really be a checklist which helps you get the most of PostgreSQL in VMs. Of course depending on the VM and the underlying infrastructure, your mileage may vary.&lt;br /&gt;&lt;br /&gt;Overall I am also looking forward to attend other sessions (besides mine of course) . &lt;a href="http://www.postgresopen.org/2011/speaker/profile/3/"&gt;Greg Smith&lt;/a&gt; has couple of sessions which sounds interesting. There is &lt;a href="http://www.postgresopen.org/2011/schedule/presentations/1/"&gt;key note by&amp;nbsp; Charles Fan&lt;/a&gt; on Friday&amp;nbsp; (that should be no brainer for me). Probably the most interesting to me is "&lt;a href="http://www.postgresopen.org/2011/schedule/presentations/39/"&gt;Unlocking the Postgres Lock Manager&lt;/a&gt;" by Bruce Momjian which definitely is in line of my interest (since I try to control/avoid/reduce lock contentions and LWLocks in benchmarks which actually lead to my past presentation in pgcon on "&lt;a href="http://jkshah.blogspot.com/2011/05/understanding-postgresql-lwlocks-pgcon.html"&gt;Understanding Postgres LWLocks&lt;/a&gt;").&lt;br /&gt;&lt;br /&gt;Definitely looking forward for the trip. &lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-1159629644880364127?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/1159629644880364127/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=1159629644880364127" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/1159629644880364127" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/1159629644880364127" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2011/09/next-stop-postgres-open-2011-chicago.html" title="Next Stop: Postgres Open 2011 - Chicago" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-6158377419739278548</id><published>2011-05-20T11:08:00.002-04:00</published><updated>2011-09-08T14:55:36.933-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">Understanding PostgreSQL LWLocks - PGCon 2011</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;From PGCon 2011 here are my slides on "Understanding PostgreSQL LWLocks"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe frameborder="0" height="401" scrolling="no" src="http://app.sliderocket.com:80/app/fullplayer.aspx?id=37d4ee14-d151-4435-8f71-faff31f507c1" width="500"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Or alternatively at the &lt;a href="http://portal.sliderocket.com/AQXFX/PgCon2011_LWLocks"&gt;direct link&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-6158377419739278548?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/6158377419739278548/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=6158377419739278548" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/6158377419739278548" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/6158377419739278548" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2011/05/understanding-postgresql-lwlocks-pgcon.html" title="Understanding PostgreSQL LWLocks - PGCon 2011" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-8191430953905672145</id><published>2011-03-24T10:12:00.000-04:00</published><updated>2011-09-08T14:58:53.497-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">Running Postgres in Virtualized Environment - #pgeast 2011</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Slides from today's presentation at PGEast.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://sites.google.com/site/pgmonitor/PgEast2011-VirtEnv.pdf"&gt;&lt;img border="0" height="240" src="https://lh3.googleusercontent.com/-7U4ldp8BQ7E/TYtQ7SDyz9I/AAAAAAAAADk/MtGVtdaPo0Y/s320/PgEast2011-VirtEnv.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;As usual feedback, questions welcome. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-8191430953905672145?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/8191430953905672145/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=8191430953905672145" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/8191430953905672145" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/8191430953905672145" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2011/03/running-postgres-in-virtualized.html" title="Running Postgres in Virtualized Environment - #pgeast 2011" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh3.googleusercontent.com/-7U4ldp8BQ7E/TYtQ7SDyz9I/AAAAAAAAADk/MtGVtdaPo0Y/s72-c/PgEast2011-VirtEnv.jpg" height="72" width="72" /><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-3533920291007785987</id><published>2011-03-23T17:48:00.000-04:00</published><updated>2011-09-08T14:58:53.498-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">Introduction to PostgreSQL for System Administrators - #pgeast 2011</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Here are the slides from my presentation today at PGEast 2011.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://sites.google.com/site/pgmonitor/PgEast2011-IntroPGSA.pdf"&gt;&lt;img border="0" height="240" src="https://lh5.googleusercontent.com/-kIwqQRyOFQo/TYpo2ApSKpI/AAAAAAAAADU/NhVfmZfsx5M/s320/PgEast2011-IntroPGSA.jpg" width="320" /&gt; &lt;/a&gt;&lt;/div&gt;&lt;br /&gt;It turned out to be a fast faced presentation for 45 minutes. Online feedback, questions are welcome as usual.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Update: Also my next presentation "PostgreSQL in Virtualized Environments" has moved to tomorrow (Thurday) at 9:00am in the Boardroom for the early bird attendees :-)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-3533920291007785987?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/3533920291007785987/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=3533920291007785987" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/3533920291007785987" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/3533920291007785987" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2011/03/introduction-to-postgresql-for-system.html" title="Introduction to PostgreSQL for System Administrators - #pgeast 2011" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh5.googleusercontent.com/-kIwqQRyOFQo/TYpo2ApSKpI/AAAAAAAAADU/NhVfmZfsx5M/s72-c/PgEast2011-IntroPGSA.jpg" height="72" width="72" /><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-6296803114040220112</id><published>2011-03-16T10:45:00.000-04:00</published><updated>2011-09-08T14:58:53.498-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">PgEast 2011 - New York</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Its less than week for&lt;a href="https://www.postgresqlconference.org/2011/east/agenda"&gt; PgEast 2011&lt;/a&gt;&amp;nbsp; and this time I have two sessions out there.&lt;br /&gt;&lt;br /&gt;My first session is on &lt;a href="https://www.postgresqlconference.org/files/east_2011_schedule.html"&gt;Wednesday at 3:00pm&lt;/a&gt; titled "&lt;a href="https://www.postgresqlconference.org/content/introduction-postgresql-system-administrators"&gt;Introduction to PostgreSQL for System Administrators&lt;/a&gt;" . This session is not about learning SQL or any real database feature but it is meant for system administrators to get their first exposure to PostgreSQL as an application running on their systems. We look at basic installation and some internals on understanding the various processes running on the system and understanding them.&lt;br /&gt;&lt;br /&gt;My session session is on &lt;a href="http://www.blogger.com/"&gt;Friday at 10:05am&lt;/a&gt; titled "&lt;a href="https://www.postgresqlconference.org/content/running-postgres-virtualized-environments"&gt;Running Postgres on Virtualized Environments&lt;/a&gt;". This session is about running Postgres in VM using VMware's vSphere. Many of the content while specific to vSphere can be used to understand in general when running Postgres on any virtual platform.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;With the increase in adoption of "Cloud Computing"&amp;nbsp; in various industries, I expect the usage of Postgres on VMs to increase dramatically in next few years. PgEast 2011 has a roundtable discussion with a panel of experts on Thursday at 2:30pm to precisely answer questions about deploying PostgreSQL in the cloud.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-6296803114040220112?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/6296803114040220112/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=6296803114040220112" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/6296803114040220112" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/6296803114040220112" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2011/03/pgeast-2011-new-york.html" title="PgEast 2011 - New York" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-7318592424956581374</id><published>2010-11-22T01:50:00.000-05:00</published><updated>2011-09-08T14:58:53.498-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">PostgreSQL 9.0 Simple Select Scaling using sysbench</title><content type="html">While I still haven't found a working way to test sysbench read-write test, I decided to continue on sysbench testing with PostgreSQL 9.0. This time I selected the oltp-test-mode=simple which essentially does a select lookup based on a primary key. The basic idea is to see if you are only doing a select statement how far can you scale.&lt;br /&gt;&lt;br /&gt;Here are my initial results with PostgreSQL 9.0&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/__9VTPFYIKns/TObu2eaDy5I/AAAAAAAAACw/w9GtPtI9VA8/s1600/PG9SimpleScaling.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/__9VTPFYIKns/TObu2eaDy5I/AAAAAAAAACw/w9GtPtI9VA8/s1600/PG9SimpleScaling.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This is still work in progress in some ways since this test has never been done before with PostgreSQL 9.0 (or atleast I haven't seen any body publish anything around this before).&lt;br /&gt;&lt;br /&gt;Anyway my real goal is not to just put the numbers here but to understand what is happening here. Round about 40-48 clients we seen to peak out on scaling and hit a wall as far as scaling goes. The statement is pretty simple select from sbtest with a primary key which is randomly generated.&lt;br /&gt;&lt;br /&gt;This is where I miss dtrace and OpenSolaris. Now that I am working on Linux it thought of trying it out with systemtap. The setting up of a working systemtap itself was a big challenge and took me some time to make it to work on my existing kernel. (Boy Linux should get their act straight at user level tracing. Its not omnipresent as dtrace on Solaris).&lt;br /&gt;&lt;br /&gt;I converted my old lockstat utility to work on systemtap. The script seems to work but systemtap can act funny sometimes like dont abruptly exit from systemtap&amp;nbsp; otherwise it may send a "wrong" signal to postgres backend which then just commits suicide since it cannot figure out what to do with such "trace/debug" signal.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOCKNAME LWID M W/A COUNT SUM-TIME(us) MAX(us) AVG-TIME(us)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LockMgrLock 45 Ex W &amp;nbsp; 85343 469682510 13152 5503&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LockMgrLock 57 Ex W&amp;nbsp;&amp;nbsp; 57547&amp;nbsp; 30903727&amp;nbsp; 8313&amp;nbsp; 537&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LockMgrLock 44 Ex W &amp;nbsp; &amp;nbsp; 390 &amp;nbsp; &amp;nbsp; 34061&amp;nbsp; 1670&amp;nbsp;&amp;nbsp; 87&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LockMgrLock 59 Ex W &amp;nbsp;&amp;nbsp;&amp;nbsp; 375&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 41570&amp;nbsp; 2032&amp;nbsp; 110&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LockMgrLock 56 Ex W &amp;nbsp; &amp;nbsp; 361&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 39685&amp;nbsp; 1889&amp;nbsp; 109&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LockMgrLock 47 Ex W &amp;nbsp; &amp;nbsp; 344&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24548&amp;nbsp; 1564&amp;nbsp;&amp;nbsp; 71&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LockMgrLock 54 Ex W &amp;nbsp; &amp;nbsp; 335 &amp;nbsp; &amp;nbsp; 67770&amp;nbsp; 2319&amp;nbsp; 202&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LockMgrLock 50 Ex W &amp;nbsp; &amp;nbsp; 325 &amp;nbsp; &amp;nbsp; 44213&amp;nbsp; 1690&amp;nbsp; 136&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LockMgrLock 49 Ex W &amp;nbsp; &amp;nbsp; 325&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 39280&amp;nbsp; 1475&amp;nbsp; 120&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LockMgrLock 55 Ex W &amp;nbsp; &amp;nbsp; 323&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 39448&amp;nbsp; 1584&amp;nbsp; 122&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LockMgrLock 48 Ex W &amp;nbsp; &amp;nbsp; 323&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 26982&amp;nbsp; 1669&amp;nbsp;&amp;nbsp; 83&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What you see above is top WAITS on lwlocks by count and what was the average wait and max wait time for a particular LWLock.&lt;br /&gt;&lt;br /&gt;(Thinking it might be related to NUM_LOCK_PARTITIONS, I did some experiments with different sizes but since they are all related to the same table it does not help here.)&lt;br /&gt;&lt;br /&gt;Then I modified my lockstat script slightly to do stack straces for those two locks:&lt;br /&gt;&lt;br /&gt;Majority of those were pretty much caused by the same code path:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;span style="font-size: small;"&gt;Lock id:45, LockMode:0&lt;br /&gt;&amp;nbsp;0x000000000062412e : LWLockAcquire+0x25e/0x270 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x00000000006228cc : LockAcquireExtended+0x2dc/0xa40 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x0000000000620788 : LockRelationOid+0x48/0x60 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x000000000064be85 : AcquireExecutorLocks+0xd5/0x190 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x000000000064c96a : RevalidateCachedPlan+0x5a/0x3b0 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x000000000062ee64 : exec_bind_message+0x604/0xab0 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x0000000000630bbd : PostgresMain+0x82d/0x16e0 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x00000000005f302e : ServerLoop+0x96e/0xcb0 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x00000000005f3dec : PostmasterMain+0xa7c/0x1150 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x000000000044e4f0 : main+0x370/0x430 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&lt;br /&gt;Lock id:57, LockMode:0&lt;br /&gt;&amp;nbsp;0x000000000062412e : LWLockAcquire+0x25e/0x270 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x00000000006228cc : LockAcquireExtended+0x2dc/0xa40 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x0000000000620788 : LockRelationOid+0x48/0x60 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x0000000000477425 : relation_open+0x55/0x90 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x000000000047e5e3 : index_open+0x13/0x90 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x00000000005732a5 : ExecInitIndexScan+0x125/0x1e0 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x0000000000560275 : ExecInitNode+0x135/0x290 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x000000000055ed80 : standard_ExecutorStart+0x530/0xc70 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x000000000063278b : PortalStart+0x1bb/0x380 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x000000000062ee9c : exec_bind_message+0x63c/0xab0 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x0000000000630bbd : PostgresMain+0x82d/0x16e0 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x00000000005f302e : ServerLoop+0x96e/0xcb0 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x00000000005f3dec : PostmasterMain+0xa7c/0x1150 [/usr/local/aurora-1.0/bin/postgres]&lt;br /&gt;&amp;nbsp;0x000000000044e4f0 : main+0x370/0x430 [/usr/local/aurora-1.0/bin/postgres]&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;So what I understand is that we have two problems here:&lt;br /&gt;1. RevalidateCachedPlan (the Major bottleneck)&lt;br /&gt;2. AccessShare Lock entry (the second bottleneck)&lt;br /&gt;&lt;br /&gt;Well atleast now I know the area where there seems to be some scaling bottlenecks which can limit simple SELECT statement scalings. The question now is what to do about them. Back to the mailing list.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-7318592424956581374?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/7318592424956581374/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=7318592424956581374" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/7318592424956581374" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/7318592424956581374" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2010/11/postgresql-90-simple-select-scaling.html" title="PostgreSQL 9.0 Simple Select Scaling using sysbench" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/__9VTPFYIKns/TObu2eaDy5I/AAAAAAAAACw/w9GtPtI9VA8/s72-c/PG9SimpleScaling.jpg" height="72" width="72" /><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-7904781470494142128</id><published>2010-11-18T15:00:00.000-05:00</published><updated>2011-09-08T14:58:53.499-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">sysbench, PostgreSQL 9.0 and OLTP complex read-write test</title><content type="html">Continuing with my sysbench saga with PostgreSQL 9.0, I was generally not encountering any errors except recently. I found two differences on how I did execute this test in order to hit this problem. One is I used a relatively small number of rows (1 million) which forces the special distribution of sysbench clients to be smaller and a reasonably high number of threads (80) as follows&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ sysbench --db-driver=pgsql --oltp-dist-type=special --oltp-table-size=1000000 --oltp-read-only=off --oltp-test-mode=complex --max-requests=0 --max-time=300 --num-threads=64 --test=oltp run&lt;/div&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sysbench 0.4.12:&amp;nbsp; multi-threaded system evaluation benchmark&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Running the test with following options:&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Number of threads: 80&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Doing OLTP test.&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Running mixed OLTP test&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Using Special distribution (12 iterations,&amp;nbsp; 1 pct of values are returned in 75 pct cases)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Using "BEGIN" for starting transactions&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Using auto_inc on the id column&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Threads started!&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;FATAL: query execution failed: 9490352&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;FATAL: database error, exiting...&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Done.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And the test failed with error reported in pg_log:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ERROR:&amp;nbsp; duplicate key value violates unique constraint "sbtest_pkey"&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;DETAIL:&amp;nbsp; Key (id)=(500815) already exists.&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;STATEMENT:&amp;nbsp; INSERT INTO sbtest values($1,0,' ','aaaaaaaaaaffffffffffrrrrrrrrrreeeeeeeeeeyyyyyyyyyy')&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br /&gt;&lt;br /&gt;The way sysbench works for the complex read-write test transaction, after doing some bunch of selects and updates, it deletes a row and inserts the same row back. So in a transaction logic it should not hit this error since it just deleted the row. This took me some time to recreate it in a way that I could understand what is happening.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;What's happening is the timing of the start of a query in transaction with respect to another transaction in flight &lt;br /&gt;working with the same key-value row such that the other transaction just deleted the row and also inserted the same row back in the same transaction.&lt;br /&gt;&lt;br /&gt;Lets consider two transactions A and B&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Transaction A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: purple;"&gt;Transaction B&lt;/span&gt;&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;BEGIN;&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: purple;"&gt;BEGIN;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;DELETE FROM sbtest WHERE id=500815;&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(returns DELETE 1)&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;INSERT INTO sbtest values(500815,0,'','aaaaaaaaaaffffffffffrrrrrrrrrreeeeeeeeeeyyyyyyyyyy');&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(returns INSERT 0 1)&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: purple;"&gt;DELETE FROM sbtest WHERE id=500815;&amp;lt; ------- hangs/waits&lt;/span&gt;&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;END;&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(COMMIT)&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: purple;"&gt;(returns DELETE 0 – returns success but doesn’t delete any rows . It doesn't roll back the transaction)&lt;/span&gt;&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: purple;"&gt;INSERT INTO sbtest values(500815,0,'','aaaaaaaaaaffffffffffrrrrrrrrrreeeeeeeeeeyyyyyyyyyy');&lt;/span&gt;&lt;/div&gt;&lt;div style="color: purple; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ERROR: duplicate key value violates unique constraint "sbtest_pkey"&lt;/div&gt;&lt;div style="color: purple; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END;&lt;/div&gt;&lt;div style="color: purple; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (ROLLBACK)&lt;/div&gt;&lt;div style="color: blue;"&gt;&lt;br /&gt;&lt;/div&gt;The way MySQL-InnoDB handles it is slightly different. It actually deletes the new row inserted and hence always can do the INSERT successfully and thats why sysbench with MySQL - InnoDB never showed that problem.&lt;br /&gt;&lt;br /&gt;If you read the &lt;a href="http://www.postgresql.org/docs/9.0/static/transaction-iso.html"&gt;documentation on PostgreSQL&lt;/a&gt; for READ COMMITTED Isolation level, it says: "In effect, a &lt;tt class="COMMAND"&gt;SELECT&lt;/tt&gt; query sees     a snapshot  of the database as of the instant the query begins to     run". So had the DELETE actually started after the END of the first transaction it would delete the new INSERTed row.I am not sure how other databases (ORACLE, DB2, etc) behave in this scenario.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;As one of my co-worker mentioned "Correctness is in the Implementation of Beholder", it is hard to say who is right or wrong..&lt;br /&gt;&lt;br /&gt;Just another one of the minor differences between MySQL and PostgreSQL.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-7904781470494142128?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/7904781470494142128/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=7904781470494142128" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/7904781470494142128" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/7904781470494142128" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2010/11/sysbench-postgresql-90-and-oltp-complex.html" title="sysbench, PostgreSQL 9.0 and OLTP complex read-write test" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-7213717474780726559</id><published>2010-11-03T17:18:00.001-04:00</published><updated>2011-09-08T14:58:53.499-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">PostgreSQL in Virtual Environment - PGWest 2010</title><content type="html">Yesterday I had my presentation at PgWest 2010 at San Francisco.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://sites.google.com/site/pgmonitor/PGWest-VirtEnv.pdf"&gt;&lt;img border="0" height="240" src="http://2.bp.blogspot.com/__9VTPFYIKns/TNHPYlp8vkI/AAAAAAAAACs/OiXdj7bupEE/s320/PGWest-VirtEnv-title.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;If you have questions on the presentation please feel free to leave comments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-7213717474780726559?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/7213717474780726559/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=7213717474780726559" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/7213717474780726559" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/7213717474780726559" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2010/11/postgresql-in-virtual-environment.html" title="PostgreSQL in Virtual Environment - PGWest 2010" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/__9VTPFYIKns/TNHPYlp8vkI/AAAAAAAAACs/OiXdj7bupEE/s72-c/PGWest-VirtEnv-title.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-7132781331502868725</id><published>2010-10-04T15:50:00.001-04:00</published><updated>2011-09-08T14:58:53.499-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">Postgres 9 and sysbench 0.4.12</title><content type="html">Ever since the release of Postgres 9 I was hoping for a chance to do some performance tests on it. I finally got around to try it out. This time I tried Postgres running in a virtual machine on top of VMware's vSphere Infrastructure 4.1.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Since there were plenty of sysbench numbers available for mysql, I thought it was time to try it with sysbench. The version I tried was sysbench 0.4.12. Compiling sysbench 0.4.12 for PostgreSQL itself was a huge challenge that it deserves a separate blogpost but for now lets start at the point where I got a working sysbench binary that I run it from a separate virtual machine against my Postgres database server.&lt;br /&gt;&lt;br /&gt;The first step to do a sysbench oltp was to do the "prepare" step where the benchmark tool creates the table and loads rows into the table. I saw many mysql tests running with 1 million rows or some with 10 million rows.&lt;br /&gt;&lt;br /&gt;So anyway I started with 1 million rows with similar options.&amp;nbsp;The load&amp;nbsp;started and went on and went on for a while.. (I should have taken a lunch break instead of waiting for it to finish.) It literally finished after some 20 odd minutes. I found that odd. So I downloaded MySQL 5.5 rc binaries and created a mysql database and compiled sysbench to run against MySQL and started the same "prepare" step with 1 million rows. &lt;br /&gt;&lt;br /&gt;&amp;nbsp;The "prepare" step finished for MySQL in an amazing 30 seconds or so. My first reaction was MySQL is damn fast than Postgres. As a Postgres lover I found that hard to believe. There's got to be some other problem. I added the --debug flag to sysbench and I saw the insert statements that sysbench did to mysql. When I used the same debug flag for Postgres version it did not show me any statements that it used.. That was no help.&lt;br /&gt;&lt;br /&gt;Anyway the Postgres was running on a version of the "late" OpenSolaris and used the query_time_breakdown.d script from pgfoundry dtrace scripts to see that the query that it was using to insert rows. I noticed that it was doing multi-row inserts on MySQL and single-row inserts on Postgres.&lt;br /&gt;&lt;br /&gt;Now came the hard part of reading through the sysbench code which took me some while to understand its layout and how it uses the database driver. To cut the long story short, I figured sysbench uses "drv_caps_t" structure to record the capabilities of the database drivers. The MySQL driver enables multi-row inserts while the Postgres driver had multi-row support disabled. &lt;br /&gt;&lt;br /&gt;Checking the documentation of Postgres I saw multi-row inserts in a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;INSERT&lt;/span&gt; statement is allowed.&lt;br /&gt;&lt;br /&gt;So I modified &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sysbench/drivers/pgsql/drv_pgsql.c&lt;/span&gt; and changed&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;/* PgSQL driver capabilities */&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;static drv_caps_t pgsql_drv_caps =&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;0,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;1,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;1,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;0,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;0,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;1,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;0,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;NULL&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;};&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;to the following&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;/* PgSQL driver capabilities */&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;static drv_caps_t pgsql_drv_caps =&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;1,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;1,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;1,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;0,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;0,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;1,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;0,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;NULL&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;};&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The resulting difference that it now loads 1000 rows in each INSERT statement (like it does for MySQL)&lt;br /&gt;&lt;br /&gt;As for the difference it makes on the "prepare" operation:&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;$&amp;nbsp;time ./sysbench --pgsql-user=pguser --pgsql-password=xxxxxx --pgsql-db=sbtest --pgsql-host=pgdb --db-driver=pgsql --oltp-dist-type=special --oltp-table-size=1000000 --oltp-read-only=off --oltp-test-mode=complex --max-requests=0 --init-rng --max-time=300 --num-threads=96 --test=oltp --debug prepare &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sysbench 0.4.12: multi-threaded system evaluation benchmark&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Creating table 'sbtest'...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;NOTICE: CREATE TABLE will create implicit sequence "sbtest_id_seq" for serial column "sbtest.id"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "sbtest_pkey" for table "sbtest"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Creating 1000000 records in table 'sbtest'...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;real 17m47.695s&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;user 0m0.328s&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sys 0m0.700s&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;to:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;$&amp;nbsp;time ./sysbench --pgsql-user=pguser --pgsql-password=xxxxxx --pgsql-db=sbtest --pgsql-host=pgdb --db-driver=pgsql --oltp-dist-type=special --oltp-table-size=1000000 --oltp-read-only=off --oltp-test-mode=complex --max-requests=0 --init-rng --max-time=300 --num-threads=96 --test=oltp --debug prepare&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sysbench 0.4.12: multi-threaded system evaluation benchmark&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Creating table 'sbtest'...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;NOTICE: CREATE TABLE will create implicit sequence "sbtest_id_seq" for serial column "sbtest.id"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "sbtest_pkey" for table "sbtest"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Creating 1000000 records in table 'sbtest'...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;real 0m36.237s&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;user 0m0.180s&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sys 0m0.064s&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This looks much better and acceptable.&amp;nbsp; Now I can proceed to the real sysbench testing.&lt;br /&gt;If somebody knows the&amp;nbsp; maintainer of the sysbench, can&amp;nbsp;you please point him to this blog article to&amp;nbsp;&amp;nbsp;get the drv_pgsql.c patched up to be similar to MySQL driver.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-7132781331502868725?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/7132781331502868725/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=7132781331502868725" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/7132781331502868725" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/7132781331502868725" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2010/10/postgres-9-and-sysbench-0412.html" title="Postgres 9 and sysbench 0.4.12" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17085626.post-9148865272571822262</id><published>2010-06-20T22:46:00.000-04:00</published><updated>2011-09-08T14:58:53.499-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="postgresql" /><title type="text">Virtualization and Postgres</title><content type="html">It will be soon couple of months for me at VMware. I have been learning a lot of VMware and Virtualization. Often time I try to view it from the point of view of a database like Postgres. To say the least it has been a learning experience. &lt;br /&gt;&lt;br /&gt;In the most simplest form of understanding, virtualization (not to be confused with simulation or emulation) is a set of resources. The primary resources are CPU, Memory, Disk and Network. Then there are others but most others are not that interested for majority of the database users (or alteast for me).&amp;nbsp; For a java programmer this is more like an interface which can be implemented by a class but retains its properties. One cannot use it directly but you use a class typically implementing that interface. Similarly for virtualization&amp;nbsp;while you think only in terms of this interface resources&amp;nbsp;it is actually implemented by the underlying physical resources of the system. Hence it is&amp;nbsp;not to be confused with "emulation". &lt;br /&gt;&lt;br /&gt;That said one would think that they need not think of it as a "special" case in their deployment. This is where expectations and reality start to diverge and we could have a case of finger pointing. To set the right expectations for virtualization one needs to understand the philosophy behind virtualization which I guess is what I have been doing recently. It is more like soul-searching in some sense. From what I get the philosophy behind virtualization is actually efficient and simplified utilization of resources. Again lets go back to our primary resources CPU, Memory, Disk, Network. What virtualization tries to achieve is efficient utilization of these resources beyond one operating system. I think everyone understands the efficient utilization part. The clause that becomes tricky is "beyond one operating system". This clause is like the last minute change included by some smart lawyer which no one will understand till some years letter when another legal review is done. :-)&lt;br /&gt;&lt;br /&gt;This clause is what is causing many operating systems, applications like database to rethink their behavior of "My world is the only world here".&amp;nbsp; The details of these behaviour are actually too long to list but to give an idea, an idle operating system throws enough tick interrupts to keep the clock up to date that few of these operating systems while doing nothing can keep a core busy just to do these time updates. Occassionally it can happen that the interrupt that does not happen in time which can cause time drifting in operating systems.&lt;br /&gt;&lt;br /&gt;Similarly my experience with databases and shared memory is often the databases just pin the max memory we expect the database will use at peak loads. So even though it may be say 10-20% of the case that peak&amp;nbsp;utilization will occur but &amp;nbsp;memory has been&amp;nbsp; fully allocated and pinned (marked "unusable" for others) which may not be the most efficient way of using that resource. (Primary true in my past life where the immediate thing we do is use Intimate Shared Memory on Solaris so nothing else&amp;nbsp;can use it.)&amp;nbsp;Other thing that can come to mind is spin locks where CPU cylces are forced to spin to do nothing but wait, network polling to see if there is more incoming data and many other operations.&lt;br /&gt;&lt;br /&gt;Plus with the isolation provided a person within an operating system now has no idea what other things could be using the same resources that the OS is using which makes it more difficult for both the administrator and the Virtualization professional to reach some common understanding. :-) &lt;br /&gt;&lt;br /&gt;Anyway this is probably my first post on this topic in relation with Postgres. As I learn more things about Virtualization, you can expect me to share&amp;nbsp; my learning of the impact of&amp;nbsp;Virtualization on Postgres and vice versa. In the mean while if you have other "bugging" questions related to Postgres and Virtualization&amp;nbsp;do let me know and maybe I can test it out on my spare time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17085626-9148865272571822262?l=jkshah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkshah.blogspot.com/feeds/9148865272571822262/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=17085626&amp;postID=9148865272571822262" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/9148865272571822262" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/17085626/posts/default/9148865272571822262" /><link rel="alternate" type="text/html" href="http://jkshah.blogspot.com/2010/06/virtualization-and-postgres.html" title="Virtualization and Postgres" /><author><name>Jignesh Shah</name><uri>https://profiles.google.com/107657423935937111113</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-0OfovQqFqZ0/AAAAAAAAAAI/AAAAAAAAAAA/7u4Ddq5wkC8/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry></feed>

