<!-- 
RSS generated by JIRA (5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9) at Thu Jun 20 03:16:01 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.couchbase.com/issues/si/jira.issueviews:issue-xml/MB-6232/MB-6232.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Couchbase</title>
    <link>http://www.couchbase.com/issues</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.4</version>
        <build-number>845</build-number>
        <build-date>26-12-2012</build-date>
    </build-info>

<item>
            <title>[MB-6232] ep-engine needs 1.5 minutes to create 1k vbuckets. Seems too slow (but gets fast with barrier=0)</title>
                <link>http://www.couchbase.com/issues/browse/MB-6232</link>
                <project id="10010" key="MB">Couchbase Server</project>
                        <description>SUBJ.&lt;br/&gt;
&lt;br/&gt;
Just try single node dev cluster and try to load beers sample (it&amp;#39;ll fail for perhaps different reason).&lt;br/&gt;
&lt;br/&gt;
You can observe in logs:&lt;br/&gt;
&lt;br/&gt;
We&amp;#39;re doing set_vbucket_state requests from janitor (ns_memcached messages) and this is the first messages from mccouch about just created vbucket (capi_set_view_manager messages and mc_connection messages). Note: I&amp;#39;ve added extra log messages at the beginning of sync_notify and end to see if it&amp;#39;s couchdb&amp;#39;s or ns_servers&amp;#39; fault. From timestamps it&amp;#39;s clear that it&amp;#39;s not.&lt;br/&gt;
&lt;br/&gt;
[ns_server:debug,2012-08-15T9:47:40.309,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.868.0&amp;gt;:mc_connection:do_notify_vbucket_update:106]sending out sync_notify&lt;br/&gt;
[ns_server:info,2012-08-15T9:47:40.309,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.870.0&amp;gt;:ns_memcached:do_handle_call:485]Changed vbucket 740 state to active&lt;br/&gt;
[views:debug,2012-08-15T9:47:40.309,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:mc_couch_events:capi_set_view_manager:handle_mc_couch_event:418]Got set_vbucket event for beer-sample/1023. Updated state: active&lt;br/&gt;
[ns_server:info,2012-08-15T9:47:40.309,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.870.0&amp;gt;:ns_memcached:do_handle_call:485]Changed vbucket 739 state to active&lt;br/&gt;
[ns_server:debug,2012-08-15T9:47:40.309,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.868.0&amp;gt;:mc_connection:do_notify_vbucket_update:113]done&lt;br/&gt;
[ns_server:info,2012-08-15T9:47:40.310,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.870.0&amp;gt;:ns_memcached:do_handle_call:485]Changed vbucket 738 state to active&lt;br/&gt;
[ns_server:info,2012-08-15T9:47:40.310,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.870.0&amp;gt;:ns_memcached:do_handle_call:485]Changed vbucket 737 state to active&lt;br/&gt;
&lt;br/&gt;
And last message is at:&lt;br/&gt;
&lt;br/&gt;
[ns_server:debug,2012-08-15T9:49:14.410,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.868.0&amp;gt;:mc_connection:do_notify_vbucket_update:106]sending out sync_notify&lt;br/&gt;
[views:debug,2012-08-15T9:49:14.410,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:mc_couch_events:capi_set_view_manager:handle_mc_couch_event:418]Got set_vbucket event for beer-sample/1. Updated state: active&lt;br/&gt;
[ns_server:debug,2012-08-15T9:49:14.410,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.868.0&amp;gt;:mc_connection:do_notify_vbucket_update:113]done&lt;br/&gt;
[ns_server:debug,2012-08-15T9:49:14.501,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.868.0&amp;gt;:mc_connection:do_notify_vbucket_update:106]sending out sync_notify&lt;br/&gt;
[views:debug,2012-08-15T9:49:14.502,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:mc_couch_events:capi_set_view_manager:handle_mc_couch_event:418]Got set_vbucket event for beer-sample/0. Updated state: active&lt;br/&gt;
[ns_server:debug,2012-08-15T9:49:14.502,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.868.0&amp;gt;:mc_connection:do_notify_vbucket_update:113]done&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
I&amp;#39;ve just retried with remounting with barrier=0 and it was blazing fast. What this mount option changes is short fsync are nearly instant because they merely send data to disk&amp;#39;s buffer without waiting until data actually hits platter.&lt;br/&gt;
&lt;br/&gt;
So that&amp;#39;s evidence of some excessive use of fsyncs somewhere during vbucket db files creation and that&amp;#39;s clearly on ep-engine/couchstore side.&lt;br/&gt;
&lt;br/&gt;
Set this to blocker as it&amp;#39;ll affect people trying to create buckets on real hardware, hard disks and any modern linux distro (where barriers are on by default).&lt;br/&gt;
</description>
                <environment></environment>
            <key id="19045">MB-6232</key>
            <summary>ep-engine needs 1.5 minutes to create 1k vbuckets. Seems too slow (but gets fast with barrier=0)</summary>
                <type id="1" iconUrl="http://www.couchbase.com/issues/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.couchbase.com/issues/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="1" iconUrl="http://www.couchbase.com/issues/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10011">Public</security>
                        <assignee username="mikew">Mike Wiederhold</assignee>
                                <reporter username="alkondratenko">Aleksey Kondratenko</reporter>
                        <labels>
                        <label>PM-PRIORITIZED</label>
                        <label>customer</label>
                    </labels>
                <created>Wed, 15 Aug 2012 12:07:16 -0500</created>
                <updated>Tue, 7 May 2013 00:54:57 -0500</updated>
                                    <version>2.0</version>
                <version>2.0.1</version>
                                <fixVersion>.major-release</fixVersion>
                                <component>couchbase-bucket</component>
                <component>storage-engine</component>
                                <votes>0</votes>
                        <watches>10</watches>
                                                    <comments>
                    <comment id="36026" author="ingenthr" created="Mon, 20 Aug 2012 12:17:31 -0500"  >Note that on &lt;a href=&quot;http://www.couchbase.com/issues/browse/MB-6305&quot; title=&quot;default bucket ends up in limbo between delete and create&quot;&gt;&lt;strike&gt;MB-6305&lt;/strike&gt;&lt;/a&gt; this caused quite a bit of trouble.  Currently, one cannot reliably go through a cycle of delete/create bucket in any reliable fashion using public interfaces.  Sometime between build 1495 and build 2.0.0c 709, the delete/recreate cycle now takes multiple minutes.&lt;br/&gt;
&lt;br/&gt;
In automated testing some SDKs used to use flush_all().  At the recommendation of engineering, we moved to delete/create.  Now using delete/create is intractable.  This has broken our testing again, unfortunately.&lt;br/&gt;
&lt;br/&gt;
The larger concern is that our users will probably see this pretty quickly too.  What we were doing here isn&amp;#39;t all that unusual.</comment>
                    <comment id="36034" author="alkondratenko" created="Mon, 20 Aug 2012 12:54:04 -0500"  >Matt, I think you can try workaround of:&lt;br/&gt;
&lt;br/&gt;
mount / -o remount,nobarrier&lt;br/&gt;
&lt;br/&gt;
And if it&amp;#39;s not helping in your case then there&amp;#39;s something else that makes it slower then needed.&lt;br/&gt;
</comment>
                    <comment id="36035" author="alkondratenko" created="Mon, 20 Aug 2012 12:54:04 -0500"  >Matt, I think you can try workaround of:&lt;br/&gt;
&lt;br/&gt;
mount / -o remount,nobarrier&lt;br/&gt;
&lt;br/&gt;
And if it&amp;#39;s not helping in your case then there&amp;#39;s something else that makes it slower then needed.&lt;br/&gt;
</comment>
                    <comment id="37855" author="alkondratenko" created="Thu, 6 Sep 2012 12:41:46 -0500"  >BTW I recall now having similar problem pre DP4. I&amp;#39;ve fixed it by creating all vbuckets in parallel. But that was ofcourse when mccouch was at it&amp;#39;s full power.&lt;br/&gt;
</comment>
                    <comment id="37856" author="ingenthr" created="Thu, 6 Sep 2012 12:52:48 -0500"  >@alk, I presume that should still be in here, so the issue is further down it would seem.&lt;br/&gt;
&lt;br/&gt;
thanks for the additional info</comment>
                    <comment id="37857" author="tommie" created="Thu, 6 Sep 2012 12:58:46 -0500"  >Just tried to reproduce this with 2.0 build 1689 and loading bear samples times out:&lt;br/&gt;
&lt;br/&gt;
[ns_server:error,2012-09-06T10:49:42.436,&lt;a href=&apos;mailto:ns_1@127.0.0.1&apos;&gt;ns_1@127.0.0.1&lt;/a&gt;:&amp;lt;0.752.0&amp;gt;:menelaus_web:handle_post_sample_buckets:506]Loading sample buckets timed out&lt;br/&gt;
&lt;br/&gt;
Same error is shown in the UI.  If I click to retry it says data is already loaded, however if I inspect the db there are no documents in the bucket.  Not sure if this is similar issue...attaching diag&lt;br/&gt;
</comment>
                    <comment id="37859" author="farshid" created="Thu, 6 Sep 2012 13:01:05 -0500"  >more info here : &lt;a href=&quot;http://www.couchbase.com/issues/browse/MB-6305&quot;&gt;http://www.couchbase.com/issues/browse/MB-6305&lt;/a&gt;</comment>
                    <comment id="37870" author="alkondratenko" created="Thu, 6 Sep 2012 13:24:06 -0500"  >Matt, when I referenced mccouch that was old mccouch that was our persistence path. This is not the case anymore. So same issue is still hitting us. We&amp;#39;re seemingly doing (potentially few) fsyncs per vbucket and we&amp;#39;re doing all that sequentially.&lt;br/&gt;
&lt;br/&gt;
Tommie, docloader thing is most likely distinct issue. I think we already have bug for that.</comment>
                    <comment id="39568" author="mikew" created="Tue, 25 Sep 2012 02:26:55 -0500"  >Alk,&lt;br/&gt;
&lt;br/&gt;
I investigated this issue further and found that the latency to send a vbucket state transition to mccouch was 100ms. Interestingly to do a state transition to dead the latency was an order of magnitude quicker so I think there might be something going on on the mccouch side here.</comment>
                    <comment id="39569" author="alkondratenko" created="Tue, 25 Sep 2012 02:39:43 -0500"  >Mike, by looking at timestamps in logs I&amp;#39;m pretty sure there are no delays on mccouch side.</comment>
                    <comment id="39602" author="peter" created="Tue, 25 Sep 2012 15:21:07 -0500"  >Mike, can you continue driving to analyze this?</comment>
                    <comment id="40379" author="mikew" created="Thu, 4 Oct 2012 13:22:47 -0500"  >The fix for this bug will require changes on both the ep-engine and mccouch side and requires modifying how we store vbucket state data and how we notify mccouch about vbucket state changes. The changes will not be small and will be risky for the 2.0 release. I recommend this change be move to 2.0.1.</comment>
                    <comment id="40389" author="chiyoung" created="Thu, 4 Oct 2012 13:37:02 -0500"  >For more details. we currently store a vbucket state file in its vbucket database as a local doc, which means that it will require one fsync for every state change. I was trying to replace those individual local docs with a global vbucket state doc and store it in the &amp;quot;master&amp;quot; meta database, but realized that it requires changes in interactions between ep-engine and erlang, and also affects our 2.0 backup and restore tools at this time.&lt;br/&gt;
&lt;br/&gt;
This is the design defect and limitation and risky changes for 2.0 at this time.</comment>
                    <comment id="40390" author="alkondratenko" created="Thu, 4 Oct 2012 13:40:29 -0500"  >Can we consider not using fsync for initial vbucket creation ?</comment>
                    <comment id="46206" author="mikew" created="Tue, 18 Dec 2012 13:13:00 -0600"  >Also see &lt;a href=&quot;http://www.couchbase.com/issues/browse/MB-6234&quot; title=&quot;We&amp;#39;re leaving some disk performance on the table&quot;&gt;MB-6234&lt;/a&gt; which is a duplicate of this issue.</comment>
                    <comment id="51898" author="alkondratenko" created="Mon, 4 Mar 2013 11:55:04 -0600"  >&lt;a href=&quot;http://www.couchbase.com/issues/browse/MB-6234&quot; title=&quot;We&amp;#39;re leaving some disk performance on the table&quot;&gt;MB-6234&lt;/a&gt; is not necessarily a dup. This bug is about metadata ops.&lt;br/&gt;
&lt;br/&gt;
Particularly, why ep-engine is even needs tons of fsync to create brand new vbuckets ?&lt;br/&gt;
&lt;br/&gt;
Why ep-engine cannot just drop those ops on the floor when during that 1.5 minute there&amp;#39;s flush ?&lt;br/&gt;
&lt;br/&gt;
I think at least those actions are possible and perhaps more and sdk folks will finally have a working flush.&lt;br/&gt;
</comment>
                    <comment id="51899" author="dipti" created="Mon, 4 Mar 2013 12:06:11 -0600"  >We need to better understand this issue in ep_engine and couchstore and come up with options to fix it in the 2.0.2 / 2.1 timeframe </comment>
                    <comment id="51901" author="ingenthr" created="Mon, 4 Mar 2013 12:11:17 -0600"  >Yay!</comment>
                    <comment id="53682" author="mikew" created="Wed, 27 Mar 2013 16:54:29 -0500"  >There are some other issues still in 2.0.2 that will likely help improve this issue, but I am moving this task out to 2.1</comment>
                    <comment id="54146" author="maria" created="Wed, 3 Apr 2013 13:08:25 -0500"  >Created CBQE for QE to add in functional automation suite: &lt;a href=&quot;http://www.couchbase.com/issues/browse/CBQE-1192&quot;&gt;http://www.couchbase.com/issues/browse/CBQE-1192&lt;/a&gt;&lt;br/&gt;
&amp;nbsp;&amp;nbsp;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="20687">MB-7160</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="14792" name="debug.1.gz" size="275908" author="tommie" created="Thu, 6 Sep 2012 12:59:44 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                        <customfield id="customfield_10180" key="com.atlassian.jira.ext.charting:firstresponsedate">
                <customfieldname>Date of First Response</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>Mon, 20 Aug 2012 12:17:31 -0500</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                                                                                                                                                                <customfield id="customfield_10081" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Rank</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>2862</customfieldvalue>
                </customfieldvalues>
            </customfield>
                                                                                                                                                                                                                                    </customfields>
    </item>
</channel>
</rss>