非常に基本的なJDKの数学APIを使用した同じPOJOコード、永続化レイヤーに関連するものは何もない、POJOだけですが、反復は何百万ラウンドになる可能性があるため、WebsphereからTomcatは10:1になる可能性があります。コードはこのようなものです。WebsphereがTomcatよりも遅い原因は何でしょうか
for(int i=0;i<200000;i++){
logger.info("calculate result 1");
int result_int1 = new Double(param1_double_left/param1_double_right).intValue();
logger.info("calculate result 2");
int result_int2 = new Double(param2_double_left/param2_double_right).intValue();
logger.info("calculate result 3");
int result_int3 = new Double(param3_double_left/param3_double_right).intValue();
logger.info("calculate result 4");
int result_int4 = new Double(param4_double_left/param4_double_right).intValue();
logger.info("calculate result 5");
int result_int5 = new Double(param5_double_left/param5_double_right).intValue();
//... more calculation with java math like above
}
のlog4jログからのTomcatから、各サージ
のためのより多くの時間とタイムスタンプの増加、それはかなり速いので、タイムスタンプは、WebSphereからのlog4jログから2016-12-05 17:53:31,200 INFO .... <-200
.... another 10 - 20 lines with same timestamp
2016-12-05 17:53:31,201 INFO .... <-201
.... another 10 - 20 lines with same timestamp
2016-12-05 17:53:31,202 INFO .... <-202
.... another 10 - 20 lines with same timestamp
2016-12-05 17:53:31,203 INFO .... <-203
.... another 10 - 20 lines with same timestamp
2016-12-05 17:53:31,204 INFO .... <-204
.... another 10 - 20 lines with same timestamp
のようなものです
2016-12-05 17:55:47,197 INFO .... <-197
.... another 10 - 20 lines with same timestamp
2016-12-05 17:55:47,212 INFO .... <-212
.... another 10 - 20 lines with same timestamp
2016-12-05 17:55:47,239 INFO .... <-239
.... another 10 - 20 lines with same timestamp
2016-12-05 17:55:47,251 INFO .... <-251
.... another 10 - 20 lines with same timestamp
2016-12-05 17:55:47,277 INFO .... <-277
.... another 10 - 20 lines with same timestamp
Websphereの遅さに関する要因が何であるか不思議です。 GC?または他のJVMチューニングですか?
どちらの場合も同じJDKを使用していますか?あなたはどのように時間を測定していますか? forループを正確に測定しているのか、サーバーの起動時間が引き込まれていますか? –
@aguibertはい同じJDK(JDK7)です。 Tomcat 6とWebsphere 8.5。私はlog4jを使用し、私はwebsphereからのログに見ることができます。私はうまくいけば状況を少しクリアすることができます質問を更新しました。ありがとう。 – Dreamer