<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:09:04 UTC 2024

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 append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-5493] Delete by query is really slow</title>
                <link>https://jira.mongodb.org/browse/SERVER-5493</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I have a collection with 35m objects with avg size 430 bytes. There are several indices including &lt;/p&gt;
{f:1}
&lt;p&gt; and when I run a count on {&quot;f&quot;: 0, wc: {$gt: 4}}) I get about 530k matches - this took a minute or so.&lt;/p&gt;

&lt;p&gt;Next I tried a delete using the same query, which is live but not very loaded right now. After over 8 hours it is still running. I see a lot of wait time in top - so I guess it&apos;s i/o bound.&lt;/p&gt;

&lt;p&gt;The machine has 70G of ram and the filesystem is ext4 with RAID5.&lt;/p&gt;</description>
                <environment>Linux RHEL5</environment>
        <key id="35411">SERVER-5493</key>
            <summary>Delete by query is really slow</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="gregor">Gregor Macadam</assignee>
                                    <reporter username="niccottrell">Nic Cottrell (Personal)</reporter>
                        <labels>
                    </labels>
                <created>Tue, 3 Apr 2012 20:29:05 +0000</created>
                <updated>Mon, 11 Jul 2016 18:33:12 +0000</updated>
                            <resolved>Fri, 31 Aug 2012 14:58:46 +0000</resolved>
                                    <version>2.0.4</version>
                                                    <component>Performance</component>
                                        <votes>3</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="159373" author="gregor" created="Fri, 31 Aug 2012 14:58:36 +0000"  >&lt;p&gt;Hi Stefen - closing this issue. &lt;/p&gt;</comment>
                            <comment id="116588" author="scotthernandez" created="Sun, 6 May 2012 02:49:33 +0000"  >&lt;p&gt;Stefen, please create a new issue with your information, and include a link to this one. Include all the information about your system and collections as well as the old version you were using.&lt;/p&gt;</comment>
                            <comment id="116586" author="stefankutko" created="Sun, 6 May 2012 00:56:17 +0000"  >&lt;p&gt;We&apos;re experiencing the same issue.  Deleting by query using 2.0.3 takes SIGNIFICANTLY longer than in previous versions.  Not sure what changed, but +1 for a resolution to this issue.&lt;/p&gt;</comment>
                            <comment id="112340" author="eliot" created="Sun, 22 Apr 2012 01:33:11 +0000"  >&lt;p&gt;With that many indexes capped won&apos;t really help too much.&lt;br/&gt;
There are 14 indexes, so a total of 15 things to remove.&lt;br/&gt;
In the worst case, that&apos;s 15 seeks per delete, so 60 objects/sec could be doing 900 seeks per second, which would be a lot.&lt;br/&gt;
What kind of disk is this on?&lt;br/&gt;
Can you cluster the indexes better?&lt;/p&gt;</comment>
                            <comment id="111460" author="niccottrell" created="Thu, 19 Apr 2012 08:01:32 +0000"  >&lt;p&gt;I also have a 12-hourly batch delete of old logs. This collection has about 1.5M objects, average size 1500. It has the following indexes:&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
db.TranslationResult.getIndexes();&lt;br/&gt;
[&lt;br/&gt;
	{&lt;br/&gt;
		&quot;name&quot; : &quot;&lt;em&gt;id&lt;/em&gt;&quot;,&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;_id&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;v&quot; : 0&lt;br/&gt;
	},&lt;br/&gt;
	{&lt;br/&gt;
		&quot;name&quot; : &quot;start_-1_status_1_group_1&quot;,&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;start&quot; : -1,
			&quot;status&quot; : 1,
			&quot;group&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;v&quot; : 0&lt;br/&gt;
	},&lt;br/&gt;
	{&lt;br/&gt;
		&quot;name&quot; : &quot;start_1_group_1_sourceLang_1_destLang_1&quot;,&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;start&quot; : 1,
			&quot;group&quot; : 1,
			&quot;sourceLang&quot; : 1,
			&quot;destLang&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;v&quot; : 0&lt;br/&gt;
	},&lt;br/&gt;
	{&lt;br/&gt;
		&quot;name&quot; : &quot;requester_1_start_-1&quot;,&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;requester&quot; : 1,
			&quot;start&quot; : -1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;v&quot; : 0&lt;br/&gt;
	},&lt;br/&gt;
	{&lt;br/&gt;
		&quot;name&quot; : &quot;group_1_sourceLang_1_sth_1&quot;,&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;group&quot; : 1,
			&quot;sourceLang&quot; : 1,
			&quot;sth&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;v&quot; : 0&lt;br/&gt;
	},&lt;br/&gt;
	{&lt;br/&gt;
		&quot;name&quot; : &quot;group_1_sth_1_suh_1&quot;,&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;background&quot; : true,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;group&quot; : 1,
			&quot;sth&quot; : 1,
			&quot;suh&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;v&quot; : 0&lt;br/&gt;
	},&lt;br/&gt;
	{&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;destLang&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;name&quot; : &quot;destLang_1&quot;,&lt;br/&gt;
		&quot;v&quot; : 0&lt;br/&gt;
	},&lt;br/&gt;
	{&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;group&quot; : 1,
			&quot;start&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;name&quot; : &quot;group_1_start_1&quot;,&lt;br/&gt;
		&quot;v&quot; : 0&lt;br/&gt;
	},&lt;br/&gt;
	{&lt;br/&gt;
		&quot;v&quot; : 1,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;sourceUrl&quot; : 1,
			&quot;group&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;name&quot; : &quot;sourceUrl_1_group_1&quot;,&lt;br/&gt;
		&quot;background&quot; : true&lt;br/&gt;
	},&lt;br/&gt;
	{&lt;br/&gt;
		&quot;v&quot; : 1,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;g&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;name&quot; : &quot;g_1&quot;&lt;br/&gt;
	},&lt;br/&gt;
	{&lt;br/&gt;
		&quot;v&quot; : 1,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;g&quot; : 1,
			&quot;start&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;name&quot; : &quot;g_1_start_1&quot;&lt;br/&gt;
	},&lt;br/&gt;
	{&lt;br/&gt;
		&quot;v&quot; : 1,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;g&quot; : 1,
			&quot;sl&quot; : 1,
			&quot;dl&quot; : 1,
			&quot;start&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;name&quot; : &quot;g_1_sl_1_dl_1_start_1&quot;,&lt;br/&gt;
		&quot;background&quot; : true&lt;br/&gt;
	},&lt;br/&gt;
	{&lt;br/&gt;
		&quot;v&quot; : 1,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;g&quot; : 1,
			&quot;status&quot; : 1,
			&quot;subResultsSize&quot; : 1,
			&quot;blank&quot; : 1,
			&quot;start&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;name&quot; : &quot;g_1_status_1_subResultsSize_1_blank_1_start_1&quot;,&lt;br/&gt;
		&quot;background&quot; : true&lt;br/&gt;
	},&lt;br/&gt;
	{&lt;br/&gt;
		&quot;v&quot; : 1,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;sth&quot; : 1,
			&quot;g&quot; : 1,
			&quot;dl&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;ns&quot; : &quot;jerome5.TranslationResult&quot;,&lt;br/&gt;
		&quot;name&quot; : &quot;sth_1_g_1_dl_1&quot;,&lt;br/&gt;
		&quot;background&quot; : true&lt;br/&gt;
	}&lt;br/&gt;
]&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;My delete query is simply {start: {$lt: SOMEDATE}}.&lt;/p&gt;

&lt;p&gt;It deletes about 80k objects each run, taking 20 minutes (1200s) - that&apos;s about 60 objects a second I think. Is it all the indexes making this slow? &lt;/p&gt;

&lt;p&gt;I guess I should really just be using capped collections for something like this, or? &lt;/p&gt;</comment>
                            <comment id="110729" author="niccottrell" created="Tue, 17 Apr 2012 16:27:55 +0000"  >&lt;p&gt;I&apos;m running my own setup - a Dell Poweredge with 40GB ram, and a hardware RAID-5 with 64K stripes. I now have Munin running and the disk data is interesting/strange:&lt;br/&gt;
1. Average disk latency (IO wait in seconds) for the data device is reported at 57.31m (sounds high)&lt;br/&gt;
2. The throughput by week averages at 11.8M/s &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/forbidden.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; and 1M/s &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/add.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;. That&apos;s also sounds high.&lt;/p&gt;

&lt;p&gt;I&apos;ve been running many batch processes this week, mostly setting a field to a new value, and in same cases insert new fields into existing objects. &lt;br/&gt;
Is this information useful?&lt;/p&gt;</comment>
                            <comment id="107563" author="scotthernandez" created="Sat, 7 Apr 2012 14:20:54 +0000"  >&lt;p&gt;It is collecting data again. It just took a few minutes for the data to show up. Looking at your numbers it looks liked your faults and disk io time it is not minor, and running hot. What types of disks/storage are you using?&lt;/p&gt;

&lt;p&gt;Can you let us know the next time you delete a lot of documents and you see this slowdown again. Then we can look at the MMS info for that time period to diagnose the possible underlying issue.&lt;/p&gt;</comment>
                            <comment id="107075" author="niccottrell" created="Thu, 5 Apr 2012 18:24:45 +0000"  >&lt;p&gt;Strange - definitely have the agent running, but the agent.log shows just:&lt;/p&gt;

&lt;p&gt;2012-04-05 20:17:09,655 INFO Starting agent process&lt;br/&gt;
2012-04-05 20:17:09,659 INFO Started agent process - parent pid: 22321&lt;br/&gt;
2012-04-05 20:23:11,916 INFO starting non-blocking stats monitoring: sture.transmachina.net:27017&lt;br/&gt;
2012-04-05 20:23:11,918 INFO starting blocking stats monitoring: sture.transmachina.net:27017&lt;br/&gt;
2012-04-05 20:23:11,919 INFO starting munin monitoring: sture.transmachina.net:4949&lt;/p&gt;

&lt;p&gt;I tried telnetting to mms.10gen.com on 443 and get through the firewall ok, so not sure why else it&apos;s not pinging. According to settings.py, I have 1.3.7 - is that too old?&lt;/p&gt;</comment>
                            <comment id="106937" author="niccottrell" created="Thu, 5 Apr 2012 14:00:41 +0000"  >&lt;p&gt;Ok - I think I have the agent up and running again, but I&apos;m having trouble logging into mms.10gen.com. It&apos;s telling me I need to choose a group, or ask admin to do it. But I should be the only associated account.&lt;/p&gt;</comment>
                            <comment id="106918" author="scotthernandez" created="Thu, 5 Apr 2012 12:58:37 +0000"  >&lt;p&gt;Yes, it is capitalized which is not an issue but there has not been an agent reporting in since 3-28. Do you believe your MMS setup is working correctly?&lt;/p&gt;

&lt;p&gt;It would be very helpful to start collecting stats again in MMS by having you fix your deployment and start an agent, or if one is running, fix its ability to communicate to the internet.&lt;/p&gt;</comment>
                            <comment id="106854" author="niccottrell" created="Thu, 5 Apr 2012 06:46:24 +0000"  >&lt;p&gt;My MMS alerts say &quot;Group: Transmachina&quot; so I guess it&apos;s capitalized?&lt;/p&gt;</comment>
                            <comment id="106704" author="scotthernandez" created="Wed, 4 Apr 2012 20:46:20 +0000"  >&lt;p&gt;It seems like no data since 3-28 in MMS. Is this the correct group in mms? &lt;a href=&quot;https://mms.10gen.com/host/list/4eb94a93ae6429bfa4101305&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://mms.10gen.com/host/list/4eb94a93ae6429bfa4101305&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="106371" author="niccottrell" created="Wed, 4 Apr 2012 06:52:58 +0000"  >&lt;p&gt;I believe this instance is registered in MMS in the group &quot;transmachina&quot;&lt;/p&gt;</comment>
                            <comment id="106370" author="niccottrell" created="Wed, 4 Apr 2012 06:45:57 +0000"  >&lt;p&gt;Sure - after 16 hours it&apos;s still running and now other queries are piling up. Attached is mongostat, top, and clients/queries.&lt;/p&gt;</comment>
                            <comment id="106355" author="eliot" created="Wed, 4 Apr 2012 05:04:27 +0000"  >&lt;p&gt;Can you send mongostat and hardware stats while the delete is happening? &lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="15745" name="clients-slowdelete.html" size="63266" author="niccottrell" created="Wed, 4 Apr 2012 06:46:33 +0000"/>
                            <attachment id="15743" name="mongostat-slowdelete.txt" size="4650" author="niccottrell" created="Wed, 4 Apr 2012 06:46:12 +0000"/>
                            <attachment id="15744" name="top-slowdelete.txt" size="5247" author="niccottrell" created="Wed, 4 Apr 2012 06:46:23 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>15.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 4 Apr 2012 05:04:27 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 24 weeks, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 24 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>gregor</customfieldvalue>
            <customfieldvalue>niccottrell</customfieldvalue>
            <customfieldvalue>scotthernandez</customfieldvalue>
            <customfieldvalue>stefankutko</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hro79z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrg673:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7908</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hsmilr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>