<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:15 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>[JAVA-864] Lookups in replica set take 20% of CPU time</title>
                <link>https://jira.mongodb.org/browse/JAVA-864</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;We have a replica set with 2 nodes and a arbiter. We originally had the java driver configured using the hostnames and about 40% of the CPU time reported by JProfiler was getByName. I&apos;ve now configured so that it&apos;s the IP address specified in the ServerAddress()... but it&apos;s still 20% via ServerAddress.updateInetAddress. Is it perhaps because the config of the replica set itself it still specified with hostnames not IP addresses?&lt;/p&gt;

&lt;p&gt;I saw a mention of configuring a cache timeout for mapping, but I couldn&apos;t find it in the docs. Also, I saw that in the 3.x Java driver that caching is going to be removed completely. What am I missing? How can this take so much CPU?&lt;/p&gt;</description>
                <environment>Java 6</environment>
        <key id="81319">JAVA-864</key>
            <summary>Lookups in replica set take 20% of CPU time</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="5">Cannot Reproduce</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="niccottrell">Nic Cottrell (Personal)</reporter>
                        <labels>
                    </labels>
                <created>Fri, 5 Jul 2013 11:27:37 +0000</created>
                <updated>Wed, 11 Sep 2019 19:10:47 +0000</updated>
                            <resolved>Thu, 18 Jul 2013 11:04:41 +0000</resolved>
                                    <version>2.11.2</version>
                                                    <component>Connection Management</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="383903" author="jeff.yemin" created="Thu, 18 Jul 2013 11:04:41 +0000"  >&lt;p&gt;Closing this now but please open a new issue if you want to request a feature enhancement.&lt;/p&gt;</comment>
                            <comment id="383902" author="jeff.yemin" created="Thu, 18 Jul 2013 11:03:36 +0000"  >&lt;p&gt;I don&apos;t think the driver should be getting involved.  There are already JVM settings available that are under the user&apos;s control that can influence the caching behavior (see &lt;a href=&quot;http://stackoverflow.com/questions/12099526/setting-java-dns-cache-ttl&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://stackoverflow.com/questions/12099526/setting-java-dns-cache-ttl&lt;/a&gt;), so anything that the driver does just adds another layer, which is something that has confused many of our users. &lt;/p&gt;</comment>
                            <comment id="383854" author="niccottrell" created="Thu, 18 Jul 2013 08:30:53 +0000"  >&lt;p&gt;Looks like I have caching of one minute (this applies to both hostnames) and decent results after the first:&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
1: 1009.395ms&lt;br/&gt;
2: 0.081ms&lt;br/&gt;
3: 0.081ms&lt;br/&gt;
4: 0.063ms&lt;br/&gt;
5: 0.084ms&lt;br/&gt;
6: 0.079ms&lt;br/&gt;
7: 0.05ms&lt;br/&gt;
8: 0.042ms&lt;br/&gt;
9: 0.078ms&lt;br/&gt;
10: 0.083ms&lt;br/&gt;
11: 0.059ms&lt;br/&gt;
12: 0.064ms&lt;br/&gt;
13: 0.053ms&lt;br/&gt;
14: 0.066ms&lt;br/&gt;
15: 0.062ms&lt;br/&gt;
16: 0.097ms&lt;br/&gt;
17: 0.069ms&lt;br/&gt;
18: 0.048ms&lt;br/&gt;
19: 0.079ms&lt;br/&gt;
20: 0.053ms&lt;br/&gt;
21: 0.052ms&lt;br/&gt;
22: 0.074ms&lt;br/&gt;
23: 0.067ms&lt;br/&gt;
24: 0.048ms&lt;br/&gt;
25: 0.071ms&lt;br/&gt;
26: 0.066ms&lt;br/&gt;
27: 0.055ms&lt;br/&gt;
28: 0.062ms&lt;br/&gt;
29: 0.063ms&lt;br/&gt;
30: 0.066ms&lt;br/&gt;
31: 0.639ms&lt;br/&gt;
32: 0.056ms&lt;br/&gt;
33: 0.072ms&lt;br/&gt;
34: 0.062ms&lt;br/&gt;
35: 0.039ms&lt;br/&gt;
36: 0.046ms&lt;br/&gt;
37: 0.039ms&lt;br/&gt;
38: 0.051ms&lt;br/&gt;
39: 0.084ms&lt;br/&gt;
40: 0.082ms&lt;br/&gt;
41: 0.079ms&lt;br/&gt;
42: 0.065ms&lt;br/&gt;
43: 0.074ms&lt;br/&gt;
44: 0.065ms&lt;br/&gt;
45: 0.042ms&lt;br/&gt;
46: 0.035ms&lt;br/&gt;
47: 0.063ms&lt;br/&gt;
48: 0.065ms&lt;br/&gt;
49: 0.061ms&lt;br/&gt;
50: 0.062ms&lt;br/&gt;
51: 0.047ms&lt;br/&gt;
52: 0.04ms&lt;br/&gt;
53: 0.051ms&lt;br/&gt;
54: 0.07ms&lt;br/&gt;
55: 0.046ms&lt;br/&gt;
56: 0.034ms&lt;br/&gt;
57: 0.113ms&lt;br/&gt;
58: 0.078ms&lt;br/&gt;
59: 0.041ms&lt;br/&gt;
60: 0.045ms&lt;br/&gt;
61: 1004.906ms&lt;br/&gt;
62: 0.042ms&lt;br/&gt;
63: 0.054ms&lt;br/&gt;
64: 0.052ms&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;Is it worth increasing the caching? Will risk making it hard to move servers around if a hosting environment goes down....&lt;/p&gt;</comment>
                            <comment id="376396" author="jeff.yemin" created="Mon, 8 Jul 2013 18:57:18 +0000"  >&lt;p&gt;Try running a program like this:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    public static void main(String[] args) throws UnknownHostException, InterruptedException {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        for (int i = 1; i &amp;lt; 1000; i++) {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;            long start = System.nanoTime();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;            InetAddress.getByName(&quot;www.google.com&quot;);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;            System.out.println(i + &quot;: &quot; + (System.nanoTime() - start) / 1000000.0 + &quot;ms&quot;);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;            Thread.sleep(1000);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;substituting your server&apos;s hostname in the call to InetAddress.getByName.  When I run this I get very reasonable response times of under 10ms for the first call and under 1 ms for subsequent calls, showing the effect of the JVMs built-in DNS cache.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="28628" name="Screen Shot 2013-07-05 at 1.26.08 PM.png" size="325371" author="niccottrell" created="Fri, 5 Jul 2013 11:27:37 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrri93:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>74344</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>