You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by ravi <sa...@yahoo.co.in> on 2016/03/20 01:19:17 UTC
Tomee 7.0.0M3 embedded shade fatjar - needs improvements
Hi,
When doing load testing on a executable jar created using tomee
embedded(org.apache.tomee.embedded.Main) shade I felt few things needs
improvement.
1) It's using bio(Blocking I/O connector).
Note: Starting from Tomcat 8 the default connector is NIO it can handle
10000 concurrent requests.
In org.apache.tomee.embedded.Container.java line numbers 484 and 496 uses
bio connector could you please change it to Http11NioProtocol
final Connector connector = new Connector(Http11Protocol.class.getName());
final Connector httpsConnector = new
Connector(Http11Protocol.class.getName());
2) How to configure the options in server.xml like maxThreads,
maxKeepAliveRequests, keepAliveTimeout, connectionTimeout, https
configuration (key store) etc. using embedded
shade(org.apache.tomee.embedded.Main).
Thanks,
Ravisankar Challa
Thanks,
Ravi
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Tomee-7-0-0M3-embedded-shade-fatjar-needs-improvements-tp4677935.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Tomee 7.0.0M3 embedded shade fatjar - needs improvements
Posted by Romain Manni-Bucau <rm...@gmail.com>.
2016-03-21 5:54 GMT+01:00 ravi <sa...@yahoo.co.in>:
> Hi Romain,
>
> I have noticed few things
>
> 1) org.apache.tomee.embedded.Main.java
> Line 135 - config.setDir(System.getProperty("java.io.tmpdir")); //Setting
> to tmp dir
> overridden in
> Line 138 - config.setDir(args.getOptionValue(DIRECTORY, new File(new
> File("."), "apache-tomee").getAbsolutePath())); Setting to current
> folder/apache-tomee
>
> I think line 135 can be removed
>
Good catch! Surely an inheritance from pre-option time. Changed.
> 2) In Container.java
> if (connector.getAttribute("connectionTimeout") == null) {
> connector.setAttribute("connectionTimeout", "3000");
> }
> This condition never passes because connectionTimeout is never null default
> value is 60000.
> I don't know if this has any side effects because before this change we are
> setting connect timeout to 3000 with out any condition.
>
>
I never understood this 3000, surely for tests but really breaks all
other cases. You are right tomcat often uses 60000 by default. However
this is dependent of the protocol/handler/endpoint so having a default
is not bad cause you can use your own (useful for tests sometimes from
my experience).
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/Tomee-7-0-0M3-embedded-shade-fatjar-needs-improvements-tp4677935p4677942.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Tomee 7.0.0M3 embedded shade fatjar - needs improvements
Posted by ravi <sa...@yahoo.co.in>.
Hi Romain,
I have noticed few things
1) org.apache.tomee.embedded.Main.java
Line 135 - config.setDir(System.getProperty("java.io.tmpdir")); //Setting
to tmp dir
overridden in
Line 138 - config.setDir(args.getOptionValue(DIRECTORY, new File(new
File("."), "apache-tomee").getAbsolutePath())); Setting to current
folder/apache-tomee
I think line 135 can be removed
2) In Container.java
if (connector.getAttribute("connectionTimeout") == null) {
connector.setAttribute("connectionTimeout", "3000");
}
This condition never passes because connectionTimeout is never null default
value is 60000.
I don't know if this has any side effects because before this change we are
setting connect timeout to 3000 with out any condition.
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Tomee-7-0-0M3-embedded-shade-fatjar-needs-improvements-tp4677935p4677942.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Tomee 7.0.0M3 embedded shade fatjar - needs improvements
Posted by ravi <sa...@yahoo.co.in>.
Hi Romain,
I have tested it's working fine.
java -server -DSalesDataSource=new://Resource?type=javax.sql.DataSource ^
-DSalesDataSource.jdbcDriver=org.h2.Driver ^
-DSalesDataSource.jdbcUrl=jdbc:h2:file:~/test ^
-DSalesDataSource.userName=sa
-DSalesDataSource.password=sa ^
-jar tomeedemo.jar ^
-p8900 -s8901 ^
--as-war ^
--property=connector.attributes.maxThreads=500 ^
--property=connector.attributes.maxKeepAliveRequests=1000 ^
--property=connector.attributes.connectionTimeout=20000
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Tomee-7-0-0M3-embedded-shade-fatjar-needs-improvements-tp4677935p4677941.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Tomee 7.0.0M3 embedded shade fatjar - needs improvements
Posted by ravi <sa...@yahoo.co.in>.
Thanks Romain,
Will test my application with these changes
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Tomee-7-0-0M3-embedded-shade-fatjar-needs-improvements-tp4677935p4677940.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Tomee 7.0.0M3 embedded shade fatjar - needs improvements
Posted by Romain Manni-Bucau <rm...@gmail.com>.
FYI https://issues.apache.org/jira/browse/TOMEE-1744
https://issues.apache.org/jira/browse/TOMEE-1745
https://issues.apache.org/jira/browse/TOMEE-1746
Romain Manni-Bucau
@rmannibucau | Blog | Github | LinkedIn | Tomitriber
2016-03-20 11:53 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
> fair enough :), will add the option to the main as well but personally
> i often rewrite the main and Container/Configuration exposes
> setServerXml(File), see
> https://github.com/rmannibucau/jrunning/blob/master/jrunning-heroku/src/main/java/io/github/rmannibucau/jrunning/heroku/JRunningTomEE.java
> for a sample
>
> Romain Manni-Bucau
> @rmannibucau | Blog | Github | LinkedIn | Tomitriber
>
>
> 2016-03-20 11:19 GMT+01:00 ravi <sa...@yahoo.co.in>:
>> Hi Romain,
>>
>> I am using the following code as my reference
>> https://github.com/tomitribe/50-shades-of-tomee/tree/master/tomeeembedded-shade
>>
>> Could please tell me how to set the server.xml in configuration.
>>
>> Thanks,
>> Ravisankar Challa
>>
>>
>>
>> --
>> View this message in context: http://tomee-openejb.979440.n4.nabble.com/Tomee-7-0-0M3-embedded-shade-fatjar-needs-improvements-tp4677935p4677937.html
>> Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Tomee 7.0.0M3 embedded shade fatjar - needs improvements
Posted by Romain Manni-Bucau <rm...@gmail.com>.
fair enough :), will add the option to the main as well but personally
i often rewrite the main and Container/Configuration exposes
setServerXml(File), see
https://github.com/rmannibucau/jrunning/blob/master/jrunning-heroku/src/main/java/io/github/rmannibucau/jrunning/heroku/JRunningTomEE.java
for a sample
Romain Manni-Bucau
@rmannibucau | Blog | Github | LinkedIn | Tomitriber
2016-03-20 11:19 GMT+01:00 ravi <sa...@yahoo.co.in>:
> Hi Romain,
>
> I am using the following code as my reference
> https://github.com/tomitribe/50-shades-of-tomee/tree/master/tomeeembedded-shade
>
> Could please tell me how to set the server.xml in configuration.
>
> Thanks,
> Ravisankar Challa
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/Tomee-7-0-0M3-embedded-shade-fatjar-needs-improvements-tp4677935p4677937.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Tomee 7.0.0M3 embedded shade fatjar - needs improvements
Posted by ravi <sa...@yahoo.co.in>.
Hi Romain,
I am using the following code as my reference
https://github.com/tomitribe/50-shades-of-tomee/tree/master/tomeeembedded-shade
Could please tell me how to set the server.xml in configuration.
Thanks,
Ravisankar Challa
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Tomee-7-0-0M3-embedded-shade-fatjar-needs-improvements-tp4677935p4677937.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Tomee 7.0.0M3 embedded shade fatjar - needs improvements
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi
Just set a server.xml in the configuration.
Will change the connector for M4.
Le 20 mars 2016 01:48, "ravi" <sa...@yahoo.co.in> a écrit :
> Hi,
>
> When doing load testing on a executable jar created using tomee
> embedded(org.apache.tomee.embedded.Main) shade I felt few things needs
> improvement.
>
> 1) It's using bio(Blocking I/O connector).
> Note: Starting from Tomcat 8 the default connector is NIO it can handle
> 10000 concurrent requests.
>
> In org.apache.tomee.embedded.Container.java line numbers 484 and 496 uses
> bio connector could you please change it to Http11NioProtocol
>
> final Connector connector = new Connector(Http11Protocol.class.getName());
> final Connector httpsConnector = new
> Connector(Http11Protocol.class.getName());
>
> 2) How to configure the options in server.xml like maxThreads,
> maxKeepAliveRequests, keepAliveTimeout, connectionTimeout, https
> configuration (key store) etc. using embedded
> shade(org.apache.tomee.embedded.Main).
>
> Thanks,
> Ravisankar Challa
>
> Thanks,
> Ravi
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Tomee-7-0-0M3-embedded-shade-fatjar-needs-improvements-tp4677935.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>