<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:43 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-631] Problems with the first query(s) </title>
                <link>https://jira.mongodb.org/browse/JAVA-631</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://groups.google.com/d/topic/mongodb-user/JvlCDGQI65g/discussion&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://groups.google.com/d/topic/mongodb-user/JvlCDGQI65g/discussion&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In a simple test Java application first query for 3000 elements occurs within 350-400 ms, the second and subsequent occur faster. In the same PHP application query the results are 10-15ms. This is a very serious limitation for web applications.&lt;/p&gt;

&lt;p&gt;I&apos;m not sure that this is normal behavior for java driver. What could be wrong?&lt;/p&gt;</description>
                <environment></environment>
        <key id="48485">JAVA-631</key>
            <summary>Problems with the first query(s) </summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="-1">Unassigned</assignee>
                                    <reporter username="ilyaskorik">Ilya Skorik</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Aug 2012 06:36:12 +0000</created>
                <updated>Wed, 11 Sep 2019 19:12:27 +0000</updated>
                            <resolved>Thu, 30 Aug 2012 12:12:13 +0000</resolved>
                                                                    <component>Performance</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="158565" author="jeff.yemin" created="Thu, 30 Aug 2012 16:00:21 +0000"  >&lt;p&gt;It&apos;s not a client OS issue.  You just need to increase connectionsPerHost in MongoOptions to ensure there are enough connections to adequately account for the number of threads in the app server that are concurrently using Mongo.&lt;/p&gt;</comment>
                            <comment id="158527" author="ilyaskorik" created="Thu, 30 Aug 2012 14:48:08 +0000"  >&lt;p&gt;Thank you all for your participation, the problem with semaphores is probably due to limitations of the client OS. Current level of performance I have more than satisfied. Thank you again!&lt;/p&gt;</comment>
                            <comment id="158467" author="scotthernandez" created="Thu, 30 Aug 2012 12:45:44 +0000"  >&lt;p&gt;Ilya, please make sure connectionsForHost is set to the max number of threads which may be active. that error about semaphores says it is too low.&lt;/p&gt;</comment>
                            <comment id="158454" author="jeff.yemin" created="Thu, 30 Aug 2012 12:12:13 +0000"  >&lt;p&gt;OK, sounds good.  Good luck.&lt;/p&gt;</comment>
                            <comment id="158397" author="ilyaskorik" created="Thu, 30 Aug 2012 08:49:26 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.springsource.org/browse/DATAMONGO-520&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://jira.springsource.org/browse/DATAMONGO-520&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Spring-data-mongodb issue created, I will try Morphia&lt;/p&gt;</comment>
                            <comment id="158371" author="ilyaskorik" created="Thu, 30 Aug 2012 07:08:16 +0000"  >&lt;p&gt;This is 100 request by 100 concurent users in &quot;internet&quot; mode (not flood):&lt;/p&gt;

&lt;p&gt;Transactions:		         973 hits&lt;br/&gt;
Availability:		       48.48 %&lt;br/&gt;
Elapsed time:		       24.75 secs&lt;br/&gt;
Data transferred:	       10.24 MB&lt;br/&gt;
Response time:		        1.46 secs&lt;br/&gt;
Transaction rate:	       39.31 trans/sec&lt;br/&gt;
Throughput:		        0.41 MB/sec&lt;br/&gt;
Concurrency:		       57.32&lt;br/&gt;
Successful transactions:         973&lt;br/&gt;
Failed transactions:	        1034&lt;br/&gt;
Longest transaction:	        8.34&lt;br/&gt;
Shortest transaction:	        0.00&lt;/p&gt;

&lt;p&gt;From logs:&lt;/p&gt;

&lt;p&gt;11:04:39.615 WARN  matrix.webapp.LoginForm - Time for 2725 object is 3201ms&lt;br/&gt;
11:04:39.655 WARN  matrix.webapp.LoginForm - Time for 2725 object is 713ms&lt;br/&gt;
11:04:39.663 WARN  matrix.webapp.LoginForm - Time for 2725 object is 1616ms&lt;br/&gt;
11:04:39.666 WARN  matrix.webapp.LoginForm - Time for 2725 object is 719ms&lt;br/&gt;
11:04:39.674 WARN  matrix.webapp.LoginForm - Time for 2725 object is 315ms&lt;br/&gt;
11:04:39.685 WARN  matrix.webapp.LoginForm - Time for 2725 object is 642ms&lt;br/&gt;
11:04:39.702 WARN  matrix.webapp.LoginForm - Time for 2725 object is 1270ms&lt;br/&gt;
11:04:39.818 WARN  matrix.webapp.LoginForm - Time for 2725 object is 3203ms&lt;br/&gt;
11:04:39.821 WARN  matrix.webapp.LoginForm - Time for 2725 object is 836ms&lt;br/&gt;
11:04:39.832 WARN  matrix.webapp.LoginForm - Time for 2725 object is 596ms&lt;br/&gt;
11:04:39.851 WARN  matrix.webapp.LoginForm - Time for 2725 object is 342ms&lt;br/&gt;
11:04:39.859 WARN  matrix.webapp.LoginForm - Time for 2725 object is 1165ms&lt;br/&gt;
11:04:39.871 WARN  matrix.webapp.LoginForm - Time for 2725 object is 4568ms&lt;br/&gt;
11:04:39.873 WARN  matrix.webapp.LoginForm - Time for 2725 object is 3667ms&lt;br/&gt;
11:04:39.877 WARN  matrix.webapp.LoginForm - Time for 2725 object is 2038ms&lt;br/&gt;
11:04:39.963 WARN  matrix.webapp.LoginForm - Time for 2725 object is 2568ms&lt;br/&gt;
11:04:39.970 WARN  matrix.webapp.LoginForm - Time for 2725 object is 332ms&lt;br/&gt;
11:04:40.046 WARN  matrix.webapp.LoginForm - Time for 2725 object is 2593ms&lt;br/&gt;
11:04:40.051 WARN  matrix.webapp.LoginForm - Time for 2725 object is 668ms&lt;br/&gt;
11:04:40.055 WARN  matrix.webapp.LoginForm - Time for 2725 object is 2468ms&lt;/p&gt;

&lt;p&gt;All errors (&amp;gt;50%) is a 500 error with &quot;Out of semaphores to get db connection&quot;. &lt;br/&gt;
Can this be a constraint OS or hardware?&lt;/p&gt;</comment>
                            <comment id="158368" author="ilyaskorik" created="Thu, 30 Aug 2012 06:56:57 +0000"  >&lt;p&gt;Without Spring-Datat the result is greatly improved, probably a problem with a single request is in the Spring Data code. But there were other interesting questions.&lt;/p&gt;

&lt;p&gt;This is a log of 100 queries with 1 concurrent user:&lt;/p&gt;

&lt;p&gt;10:42:22.456 WARN  matrix.webapp.LoginForm - Time for 2725 object is 6ms&lt;br/&gt;
10:42:22.466 WARN  matrix.webapp.LoginForm - Time for 2725 object is 7ms&lt;br/&gt;
10:42:22.476 WARN  matrix.webapp.LoginForm - Time for 2725 object is 6ms&lt;br/&gt;
10:42:22.486 WARN  matrix.webapp.LoginForm - Time for 2725 object is 6ms&lt;br/&gt;
10:42:22.496 WARN  matrix.webapp.LoginForm - Time for 2725 object is 7ms&lt;br/&gt;
10:42:22.511 WARN  matrix.webapp.LoginForm - Time for 2725 object is 10ms&lt;br/&gt;
10:42:22.532 WARN  matrix.webapp.LoginForm - Time for 2725 object is 17ms&lt;br/&gt;
10:42:22.542 WARN  matrix.webapp.LoginForm - Time for 2725 object is 6ms&lt;br/&gt;
10:42:22.553 WARN  matrix.webapp.LoginForm - Time for 2725 object is 8ms&lt;br/&gt;
10:42:22.569 WARN  matrix.webapp.LoginForm - Time for 2725 object is 9ms&lt;/p&gt;

&lt;p&gt;This is a log of 10 queries with 10 concurrent user:&lt;/p&gt;

&lt;p&gt;10:46:50.571 WARN  matrix.webapp.LoginForm - Time for 2725 object is 70ms&lt;br/&gt;
10:46:50.666 WARN  matrix.webapp.LoginForm - Time for 2725 object is 164ms&lt;br/&gt;
10:46:50.666 WARN  matrix.webapp.LoginForm - Time for 2725 object is 165ms&lt;br/&gt;
10:46:50.670 WARN  matrix.webapp.LoginForm - Time for 2725 object is 168ms&lt;br/&gt;
10:46:50.672 WARN  matrix.webapp.LoginForm - Time for 2725 object is 170ms&lt;br/&gt;
10:46:50.677 WARN  matrix.webapp.LoginForm - Time for 2725 object is 173ms&lt;br/&gt;
10:46:50.681 WARN  matrix.webapp.LoginForm - Time for 2725 object is 168ms&lt;br/&gt;
10:46:50.682 WARN  matrix.webapp.LoginForm - Time for 2725 object is 169ms&lt;br/&gt;
10:46:50.682 WARN  matrix.webapp.LoginForm - Time for 2725 object is 170ms&lt;br/&gt;
10:46:50.723 WARN  matrix.webapp.LoginForm - Time for 2725 object is 166ms&lt;/p&gt;

&lt;p&gt;This is a log of 10 queries with 50 concurrent user:&lt;/p&gt;

&lt;p&gt;10:47:47.992 WARN  matrix.webapp.LoginForm - Time for 2725 object is 763ms&lt;br/&gt;
10:47:48.009 WARN  matrix.webapp.LoginForm - Time for 2725 object is 309ms&lt;br/&gt;
10:47:48.029 WARN  matrix.webapp.LoginForm - Time for 2725 object is 525ms&lt;br/&gt;
10:47:48.061 WARN  matrix.webapp.LoginForm - Time for 2725 object is 251ms&lt;br/&gt;
10:47:48.104 WARN  matrix.webapp.LoginForm - Time for 2725 object is 205ms&lt;br/&gt;
10:47:48.106 WARN  matrix.webapp.LoginForm - Time for 2725 object is 352ms&lt;br/&gt;
10:47:48.111 WARN  matrix.webapp.LoginForm - Time for 2725 object is 170ms&lt;br/&gt;
10:47:48.124 WARN  matrix.webapp.LoginForm - Time for 2725 object is 333ms&lt;br/&gt;
10:47:48.126 WARN  matrix.webapp.LoginForm - Time for 2725 object is 227ms&lt;br/&gt;
10:47:48.137 WARN  matrix.webapp.LoginForm - Time for 2725 object is 161ms&lt;/p&gt;

&lt;p&gt;This is a log of 10 queries with 100 concurrent user:&lt;/p&gt;

&lt;p&gt;0:49:12.875 WARN  matrix.webapp.LoginForm - Time for 2725 object is 1596ms&lt;br/&gt;
10:49:12.894 WARN  matrix.webapp.LoginForm - Time for 2725 object is 1289ms&lt;br/&gt;
10:49:12.904 WARN  matrix.webapp.LoginForm - Time for 2725 object is 1355ms&lt;br/&gt;
10:49:12.906 WARN  matrix.webapp.LoginForm - Time for 2725 object is 1566ms&lt;br/&gt;
10:49:12.976 WARN  matrix.webapp.LoginForm - Time for 2725 object is 2000ms&lt;br/&gt;
10:49:13.006 WARN  matrix.webapp.LoginForm - Time for 2725 object is 3294ms&lt;br/&gt;
10:49:13.027 WARN  matrix.webapp.LoginForm - Time for 2725 object is 2209ms&lt;br/&gt;
10:49:13.038 WARN  matrix.webapp.LoginForm - Time for 2725 object is 746ms&lt;br/&gt;
10:49:13.082 WARN  matrix.webapp.LoginForm - Time for 2725 object is 713ms&lt;br/&gt;
10:49:13.088 WARN  matrix.webapp.LoginForm - Time for 2725 object is 1761ms&lt;/p&gt;

&lt;p&gt;And there is problems with stability. There are many (40-50%) error &quot;Out of semaphores to get db connection&quot;&lt;/p&gt;

&lt;p&gt;&amp;#8211;&lt;/p&gt;

&lt;p&gt;It can be seen that with the increasing competitive connections, query speed degrades linearly and there are errors connecting to the database.&lt;/p&gt;

&lt;p&gt;Question, this property MongoDB or am I wrong to configure a connection to a database?&lt;/p&gt;</comment>
                            <comment id="158366" author="ilyaskorik" created="Thu, 30 Aug 2012 06:41:38 +0000"  >&lt;p&gt;Test controller configuration&lt;/p&gt;</comment>
                            <comment id="158365" author="ilyaskorik" created="Thu, 30 Aug 2012 06:41:16 +0000"  >&lt;p&gt;Mongo Object configuration&lt;/p&gt;</comment>
                            <comment id="158312" author="jeff.yemin" created="Thu, 30 Aug 2012 02:18:25 +0000"  >&lt;p&gt;Just to rule out some unknowns:&lt;/p&gt;

&lt;p&gt;1. Perform measurements using System.nanoTime instead of Calendar.  More accurate for benchmarking.&lt;br/&gt;
2. Use the raw java driver instead of Spring Data MongoDB&lt;/p&gt;</comment>
                            <comment id="158004" author="ilyaskorik" created="Wed, 29 Aug 2012 15:54:56 +0000"  >&lt;p&gt;I tested the old applications, generally on my computer Java Web applications work in two to four times more productive than their analogs in PHP. Until then, not to begin to use the Mongo Java Driver. I can not understand what I am wrong and how to fix it.&lt;/p&gt;</comment>
                            <comment id="157977" author="ilyaskorik" created="Wed, 29 Aug 2012 15:00:54 +0000"  >&lt;p&gt;Same computer and database, php:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;PHP Internet mode&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;$siege &lt;a href=&quot;http://localhost:8080/mongotest.php&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8080/mongotest.php&lt;/a&gt; -r 100 -c 10 -i &lt;/p&gt;

&lt;p&gt;Transactions:		        1000 hits&lt;br/&gt;
Availability:		      100.00 %&lt;br/&gt;
Elapsed time:		       55.92 secs&lt;br/&gt;
Data transferred:	        0.03 MB&lt;br/&gt;
Response time:		        0.02 secs&lt;br/&gt;
Transaction rate:	       17.88 trans/sec&lt;br/&gt;
Throughput:		        0.00 MB/sec&lt;br/&gt;
Concurrency:		        0.29&lt;br/&gt;
Successful transactions:        1000&lt;br/&gt;
Failed transactions:	           0&lt;br/&gt;
Longest transaction:	        0.13&lt;br/&gt;
Shortest transaction:	        0.01&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;PHP Flood mode&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;$siege &lt;a href=&quot;http://localhost:8080/mongotest.php&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8080/mongotest.php&lt;/a&gt; -r 100 -c 10 -b&lt;/p&gt;

&lt;p&gt;Transactions:		        1000 hits&lt;br/&gt;
Availability:		      100.00 %&lt;br/&gt;
Elapsed time:		       16.21 secs&lt;br/&gt;
Data transferred:	        0.03 MB&lt;br/&gt;
Response time:		        0.16 secs&lt;br/&gt;
Transaction rate:	       61.69 trans/sec&lt;br/&gt;
Throughput:		        0.00 MB/sec&lt;br/&gt;
Concurrency:		        9.96&lt;br/&gt;
Successful transactions:        1000&lt;br/&gt;
Failed transactions:	           0&lt;br/&gt;
Longest transaction:	        0.27&lt;br/&gt;
Shortest transaction:	        0.04&lt;/p&gt;


&lt;ul&gt;
	&lt;li&gt;JAVA - internet mode&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;$siege &lt;a href=&quot;http://localhost:8181/zr-matrix/test/1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/zr-matrix/test/1&lt;/a&gt; -r 100 -c 10 -i&lt;/p&gt;

&lt;p&gt;Transactions:		        1000 hits&lt;br/&gt;
Availability:		      100.00 %&lt;br/&gt;
Elapsed time:		       64.90 secs&lt;br/&gt;
Data transferred:	        0.00 MB&lt;br/&gt;
Response time:		        0.10 secs&lt;br/&gt;
Transaction rate:	       15.41 trans/sec&lt;br/&gt;
Throughput:		        0.00 MB/sec&lt;br/&gt;
Concurrency:		        1.58&lt;br/&gt;
Successful transactions:        1000&lt;br/&gt;
Failed transactions:	           0&lt;br/&gt;
Longest transaction:	        0.54&lt;br/&gt;
Shortest transaction:	        0.05&lt;/p&gt;


&lt;ul&gt;
	&lt;li&gt;Java - flood mode&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;$siege &lt;a href=&quot;http://localhost:8181/zr-matrix/test/1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/zr-matrix/test/1&lt;/a&gt; -r 100 -c 10 -b&lt;/p&gt;

&lt;p&gt;Transactions:		        1000 hits&lt;br/&gt;
Availability:		      100.00 %&lt;br/&gt;
Elapsed time:		       51.85 secs&lt;br/&gt;
Data transferred:	        0.00 MB&lt;br/&gt;
Response time:		        0.51 secs&lt;br/&gt;
Transaction rate:	       19.29 trans/sec&lt;br/&gt;
Throughput:		        0.00 MB/sec&lt;br/&gt;
Concurrency:		        9.89&lt;br/&gt;
Successful transactions:        1000&lt;br/&gt;
Failed transactions:	           0&lt;br/&gt;
Longest transaction:	        1.05&lt;br/&gt;
Shortest transaction:	        0.06&lt;/p&gt;</comment>
                            <comment id="157967" author="ilyaskorik" created="Wed, 29 Aug 2012 14:44:09 +0000"  >&lt;p&gt;Without a query to the Mongo web application handles something about 1200 requests per second with 0,07 ms per request&lt;/p&gt;</comment>
                            <comment id="157953" author="ilyaskorik" created="Wed, 29 Aug 2012 14:22:18 +0000"  >&lt;p&gt;done.&lt;br/&gt;
Transactions:		        1000 hits&lt;br/&gt;
Availability:		      100.00 %&lt;br/&gt;
Elapsed time:		       74.59 secs&lt;br/&gt;
Data transferred:	        0.00 MB&lt;br/&gt;
Response time:		        0.15 secs&lt;br/&gt;
Transaction rate:	       13.41 trans/sec&lt;br/&gt;
Throughput:		        0.00 MB/sec&lt;br/&gt;
Concurrency:		        2.05&lt;br/&gt;
Successful transactions:        1000&lt;br/&gt;
Failed transactions:	           0&lt;br/&gt;
Longest transaction:	        1.04&lt;br/&gt;
Shortest transaction:	        0.05&lt;/p&gt;

&lt;p&gt;The results have not changed much.&lt;/p&gt;

&lt;p&gt;I run the compiled application from war archive in a separate tomcat instance, outside the development environment. Computer - Macbook Pro 13, 2011, with Corei5 and 8Gb Ram, SSD drive. OSX 10.8.1&lt;/p&gt;</comment>
                            <comment id="157949" author="ilyaskorik" created="Wed, 29 Aug 2012 14:19:46 +0000"  >&lt;p&gt;Without sorting&lt;/p&gt;</comment>
                            <comment id="157948" author="ilyaskorik" created="Wed, 29 Aug 2012 14:18:37 +0000"  >&lt;p&gt;Without sorting&lt;/p&gt;</comment>
                            <comment id="157945" author="jeff.yemin" created="Wed, 29 Aug 2012 14:12:14 +0000"  >&lt;p&gt;The PHP and Java apps are performing different queries.  The Java app is sorting on a field, and the PHP app is not.  Can you make them consistent and retest?  &lt;/p&gt;</comment>
                            <comment id="157938" author="ilyaskorik" created="Wed, 29 Aug 2012 14:05:49 +0000"  >&lt;p&gt;Jeff, I&apos;ve tested the application with 1000 transactions, they all are slow. If the problem is in the sockets, what to do, that would increase the speed of five to ten times?&lt;/p&gt;</comment>
                            <comment id="157937" author="ilyaskorik" created="Wed, 29 Aug 2012 14:01:59 +0000"  >&lt;p&gt;This is Siege log&lt;/p&gt;

&lt;p&gt;$siege  &lt;a href=&quot;http://localhost:8181/zr-matrix/test/1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/zr-matrix/test/1&lt;/a&gt; -r 100 -c 10 -i&lt;/p&gt;

&lt;p&gt;Transactions:		        1000 hits&lt;br/&gt;
Availability:		      100.00 %&lt;br/&gt;
Elapsed time:		       90.01 secs&lt;br/&gt;
Data transferred:	        0.00 MB&lt;br/&gt;
Response time:		        0.40 secs&lt;br/&gt;
Transaction rate:	       11.11 trans/sec&lt;br/&gt;
Throughput:		        0.00 MB/sec&lt;br/&gt;
Concurrency:		        4.48&lt;br/&gt;
Successful transactions:        1000&lt;br/&gt;
Failed transactions:	           0&lt;br/&gt;
Longest transaction:	        1.74&lt;br/&gt;
Shortest transaction:	        0.05&lt;/p&gt;

&lt;p&gt;Simple controller, a simple test. No operations on the data or complex view.&lt;br/&gt;
Look in the matrix-app.log, I do not understand why so much jumping query time value in this test. And why are they so big. php script on this test gives significantly more attractive results.&lt;/p&gt;

&lt;p&gt;It is normal for Java or I something wrong?&lt;/p&gt;</comment>
                            <comment id="157936" author="jeff.yemin" created="Wed, 29 Aug 2012 14:00:12 +0000"  >&lt;p&gt;The Mongo instance manages a pool of sockets, which are created lazily, so the first time a thread invokes an operation that needs to interact with the server, the socket will be created and opened, and this operation will be slower as a result. &lt;/p&gt;

&lt;p&gt;One thing you could try is warming your server before it becomes available for use, thus forcing socket creation.&lt;/p&gt;
</comment>
                            <comment id="157934" author="ilyaskorik" created="Wed, 29 Aug 2012 13:57:06 +0000"  >&lt;p&gt;This is spring-mvc controller&lt;/p&gt;</comment>
                            <comment id="157933" author="ilyaskorik" created="Wed, 29 Aug 2012 13:54:41 +0000"  >&lt;p&gt;Query time log from app&lt;/p&gt;</comment>
                            <comment id="157912" author="ilyaskorik" created="Wed, 29 Aug 2012 12:49:25 +0000"  >&lt;p&gt;I&apos;m using spring-mvc and spring-data-mongodb, did everything according to official instructions. According to the logs, the Mongo object is created only once.&lt;/p&gt;

&lt;p&gt;But each request takes 250-300ms, when a similar php request - 60ms. I do not know how to explain it, and how to fix it.&lt;/p&gt;

&lt;p&gt;Do you have any ideas?&lt;/p&gt;</comment>
                            <comment id="157897" author="jeff.yemin" created="Wed, 29 Aug 2012 11:15:29 +0000"  >&lt;p&gt;It&apos;s likely because the Java driver lazily opens sockets for each thread on first use of mongo&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="19039" name="App.java" size="4995" author="ilyaskorik" created="Wed, 29 Aug 2012 06:36:12 +0000"/>
                            <attachment id="19168" name="LoginForm.java" size="1523" author="ilyaskorik" created="Thu, 30 Aug 2012 06:41:38 +0000"/>
                            <attachment id="19054" name="LoginForm.java" size="1511" author="ilyaskorik" created="Wed, 29 Aug 2012 14:18:37 +0000"/>
                            <attachment id="19052" name="LoginForm.java" size="1692" author="ilyaskorik" created="Wed, 29 Aug 2012 13:57:06 +0000"/>
                            <attachment id="19167" name="MongoConfig.java" size="1364" author="ilyaskorik" created="Thu, 30 Aug 2012 06:41:16 +0000"/>
                            <attachment id="19055" name="matrix-app.log" size="48455" author="ilyaskorik" created="Wed, 29 Aug 2012 14:19:46 +0000"/>
                            <attachment id="19051" name="matrix-app.log" size="49062" author="ilyaskorik" created="Wed, 29 Aug 2012 13:54:41 +0000"/>
                            <attachment id="19038" name="mongotest.php" size="673" author="ilyaskorik" created="Wed, 29 Aug 2012 06:36:12 +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|hrggxr:</customfieldvalue>

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