You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by jotpe <jo...@gmail.com> on 2013/12/03 09:53:25 UTC

Slow connection operations with java fork=false

Hello list,

at first my values:
Apache Ant(TM) version 1.9.2 compiled on July 8 2013
java.runtime.version : 1.7.0_45-b18
java.vm.name : Java HotSpot(TM) Client VM
os.name : Windows XP


I've written a Java utility class, that executes some import jobs. If
executed via commandline only OR by ant task with fork="true" parameter, it
runs as it schould: fast and without blocking.

The bottlenecks are retrieving websites
    new URL("xyz").openConnection().getInputStream()
and establishing a database connections
    DriverManager.getConnection(url, props)


With fork="true" OR direct commandline both takes ~ 50 ms +- 25 ms
With fork="false" it takes always 9047 ms +- 13 ms


The ant target looks normal, i think:

<target name="read">
    <java classname="ImportJob" fork="false" failonerror="true">
        <arg value="a" />
        <classpath>
            <pathelement path="dist/classes"/>
            <pathelement location="dist/postgresql-9.1-903.jdbc4.jar" />
            <pathelement location="dist/commons-codec-1.7.jar" />
            <pathelement location="dist/commons-io-2.4.jar" />
            <pathelement location="dist/commons-lang3-3.1.jar" />
            <pathelement location="dist/commons-logging-1.1.1.jar" />
            <pathelement location="dist/httpclient-4.2.3.jar" />
            <pathelement location="dist/httpcore-4.2.2.jar" />
            <pathelement location="dist/utils-io-0.0.2.jar" />
            <pathelement location="dist/gson-2.2.2.jar" />
        </classpath>
    </java>
</target>


Is there somewhere an internal timeout which is reached after 9 seconds
without throwing an exception? Does anyone know this problem, is it a bug?

Best Regards Johannes

Re: Slow connection operations with java fork=false

Posted by Peter West <pb...@pbw.id.au>.
Yes. Just to try to eliminate some of the variables in the situation.


Peter West

"For my yoke is easy, and my burden is light."

On 11 Dec 2013, at 8:05 am, jotpe <jo...@gmail.com> wrote:

> Do you mean, establishing no Connection?
> 
> Am Dienstag, 10. Dezember 2013 schrieb Peter West :
> 
>> What happens if you use dummy values instead of actually setting up a
>> database connection?
>> 
>> Peter West
>> 
>> "For my yoke is easy, and my burden is light."
>> 
>> On 10 Dec 2013, at 8:43 pm, jotpe <jotpe.osm@gmail.com <javascript:;>>
>> wrote:
>> 
>>> Nobody with same experience?
>>> 
>>> 
>>> 2013/12/3 jotpe <jotpe.osm@gmail.com <javascript:;>>
>>> 
>>>> Hello list,
>>>> 
>>>> at first my values:
>>>> Apache Ant(TM) version 1.9.2 compiled on July 8 2013
>>>> java.runtime.version : 1.7.0_45-b18
>>>> java.vm.name : Java HotSpot(TM) Client VM
>>>> os.name : Windows XP
>>>> 
>>>> 
>>>> I've written a Java utility class, that executes some import jobs. If
>>>> executed via commandline only OR by ant task with fork="true"
>> parameter, it
>>>> runs as it schould: fast and without blocking.
>>>> 
>>>> The bottlenecks are retrieving websites
>>>>   new URL("xyz").openConnection().getInputStream()
>>>> and establishing a database connections
>>>>   DriverManager.getConnection(url, props)
>>>> 
>>>> 
>>>> With fork="true" OR direct commandline both takes ~ 50 ms +- 25 ms
>>>> With fork="false" it takes always 9047 ms +- 13 ms
>>>> 
>>>> 
>>>> The ant target looks normal, i think:
>>>> 
>>>> <target name="read">
>>>>   <java classname="ImportJob" fork="false" failonerror="true">
>>>>       <arg value="a" />
>>>>       <classpath>
>>>>           <pathelement path="dist/classes"/>
>>>>           <pathelement location="dist/postgresql-9.1-903.jdbc4.jar" />
>>>>           <pathelement location="dist/commons-codec-1.7.jar" />
>>>>           <pathelement location="dist/commons-io-2.4.jar" />
>>>>           <pathelement location="dist/commons-lang3-3.1.jar" />
>>>>           <pathelement location="dist/commons-logging-1.1.1.jar" />
>>>>           <pathelement location="dist/httpclient-4.2.3.jar" />
>>>>           <pathelement location="dist/httpcore-4.2.2.jar" />
>>>>           <pathelement location="dist/utils-io-0.0.2.jar" />
>>>>           <pathelement location="dist/gson-2.2.2.jar" />
>>>>       </classpath>
>>>>   </java>
>>>> </target>
>>>> 
>>>> 
>>>> Is there somewhere an internal timeout which is reached after 9 seconds
>>>> without throwing an exception? Does anyone know this problem, is it a
>> bug?
>>>> 
>>>> Best Regards Johannes
>>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org <javascript:;>
>> For additional commands, e-mail: user-help@ant.apache.org <javascript:;>
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Slow connection operations with java fork=false

Posted by jotpe <jo...@gmail.com>.
Do you mean, establishing no Connection?

Am Dienstag, 10. Dezember 2013 schrieb Peter West :

> What happens if you use dummy values instead of actually setting up a
> database connection?
>
> Peter West
>
> "For my yoke is easy, and my burden is light."
>
> On 10 Dec 2013, at 8:43 pm, jotpe <jotpe.osm@gmail.com <javascript:;>>
> wrote:
>
> > Nobody with same experience?
> >
> >
> > 2013/12/3 jotpe <jotpe.osm@gmail.com <javascript:;>>
> >
> >> Hello list,
> >>
> >> at first my values:
> >> Apache Ant(TM) version 1.9.2 compiled on July 8 2013
> >> java.runtime.version : 1.7.0_45-b18
> >> java.vm.name : Java HotSpot(TM) Client VM
> >> os.name : Windows XP
> >>
> >>
> >> I've written a Java utility class, that executes some import jobs. If
> >> executed via commandline only OR by ant task with fork="true"
> parameter, it
> >> runs as it schould: fast and without blocking.
> >>
> >> The bottlenecks are retrieving websites
> >>    new URL("xyz").openConnection().getInputStream()
> >> and establishing a database connections
> >>    DriverManager.getConnection(url, props)
> >>
> >>
> >> With fork="true" OR direct commandline both takes ~ 50 ms +- 25 ms
> >> With fork="false" it takes always 9047 ms +- 13 ms
> >>
> >>
> >> The ant target looks normal, i think:
> >>
> >> <target name="read">
> >>    <java classname="ImportJob" fork="false" failonerror="true">
> >>        <arg value="a" />
> >>        <classpath>
> >>            <pathelement path="dist/classes"/>
> >>            <pathelement location="dist/postgresql-9.1-903.jdbc4.jar" />
> >>            <pathelement location="dist/commons-codec-1.7.jar" />
> >>            <pathelement location="dist/commons-io-2.4.jar" />
> >>            <pathelement location="dist/commons-lang3-3.1.jar" />
> >>            <pathelement location="dist/commons-logging-1.1.1.jar" />
> >>            <pathelement location="dist/httpclient-4.2.3.jar" />
> >>            <pathelement location="dist/httpcore-4.2.2.jar" />
> >>            <pathelement location="dist/utils-io-0.0.2.jar" />
> >>            <pathelement location="dist/gson-2.2.2.jar" />
> >>        </classpath>
> >>    </java>
> >> </target>
> >>
> >>
> >> Is there somewhere an internal timeout which is reached after 9 seconds
> >> without throwing an exception? Does anyone know this problem, is it a
> bug?
> >>
> >> Best Regards Johannes
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org <javascript:;>
> For additional commands, e-mail: user-help@ant.apache.org <javascript:;>
>
>

Re: Slow connection operations with java fork=false

Posted by Peter West <pb...@pbw.id.au>.
What happens if you use dummy values instead of actually setting up a database connection?

Peter West

"For my yoke is easy, and my burden is light."

On 10 Dec 2013, at 8:43 pm, jotpe <jo...@gmail.com> wrote:

> Nobody with same experience?
> 
> 
> 2013/12/3 jotpe <jo...@gmail.com>
> 
>> Hello list,
>> 
>> at first my values:
>> Apache Ant(TM) version 1.9.2 compiled on July 8 2013
>> java.runtime.version : 1.7.0_45-b18
>> java.vm.name : Java HotSpot(TM) Client VM
>> os.name : Windows XP
>> 
>> 
>> I've written a Java utility class, that executes some import jobs. If
>> executed via commandline only OR by ant task with fork="true" parameter, it
>> runs as it schould: fast and without blocking.
>> 
>> The bottlenecks are retrieving websites
>>    new URL("xyz").openConnection().getInputStream()
>> and establishing a database connections
>>    DriverManager.getConnection(url, props)
>> 
>> 
>> With fork="true" OR direct commandline both takes ~ 50 ms +- 25 ms
>> With fork="false" it takes always 9047 ms +- 13 ms
>> 
>> 
>> The ant target looks normal, i think:
>> 
>> <target name="read">
>>    <java classname="ImportJob" fork="false" failonerror="true">
>>        <arg value="a" />
>>        <classpath>
>>            <pathelement path="dist/classes"/>
>>            <pathelement location="dist/postgresql-9.1-903.jdbc4.jar" />
>>            <pathelement location="dist/commons-codec-1.7.jar" />
>>            <pathelement location="dist/commons-io-2.4.jar" />
>>            <pathelement location="dist/commons-lang3-3.1.jar" />
>>            <pathelement location="dist/commons-logging-1.1.1.jar" />
>>            <pathelement location="dist/httpclient-4.2.3.jar" />
>>            <pathelement location="dist/httpcore-4.2.2.jar" />
>>            <pathelement location="dist/utils-io-0.0.2.jar" />
>>            <pathelement location="dist/gson-2.2.2.jar" />
>>        </classpath>
>>    </java>
>> </target>
>> 
>> 
>> Is there somewhere an internal timeout which is reached after 9 seconds
>> without throwing an exception? Does anyone know this problem, is it a bug?
>> 
>> Best Regards Johannes
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Slow connection operations with java fork=false

Posted by jotpe <jo...@gmail.com>.
Nobody with same experience?


2013/12/3 jotpe <jo...@gmail.com>

> Hello list,
>
> at first my values:
> Apache Ant(TM) version 1.9.2 compiled on July 8 2013
> java.runtime.version : 1.7.0_45-b18
> java.vm.name : Java HotSpot(TM) Client VM
> os.name : Windows XP
>
>
> I've written a Java utility class, that executes some import jobs. If
> executed via commandline only OR by ant task with fork="true" parameter, it
> runs as it schould: fast and without blocking.
>
> The bottlenecks are retrieving websites
>     new URL("xyz").openConnection().getInputStream()
> and establishing a database connections
>     DriverManager.getConnection(url, props)
>
>
> With fork="true" OR direct commandline both takes ~ 50 ms +- 25 ms
> With fork="false" it takes always 9047 ms +- 13 ms
>
>
> The ant target looks normal, i think:
>
> <target name="read">
>     <java classname="ImportJob" fork="false" failonerror="true">
>         <arg value="a" />
>         <classpath>
>             <pathelement path="dist/classes"/>
>             <pathelement location="dist/postgresql-9.1-903.jdbc4.jar" />
>             <pathelement location="dist/commons-codec-1.7.jar" />
>             <pathelement location="dist/commons-io-2.4.jar" />
>             <pathelement location="dist/commons-lang3-3.1.jar" />
>             <pathelement location="dist/commons-logging-1.1.1.jar" />
>             <pathelement location="dist/httpclient-4.2.3.jar" />
>             <pathelement location="dist/httpcore-4.2.2.jar" />
>             <pathelement location="dist/utils-io-0.0.2.jar" />
>             <pathelement location="dist/gson-2.2.2.jar" />
>         </classpath>
>     </java>
> </target>
>
>
> Is there somewhere an internal timeout which is reached after 9 seconds
> without throwing an exception? Does anyone know this problem, is it a bug?
>
> Best Regards Johannes
>