为什么前台进程比UNIX服务器中的后台进程更快

时间:2013-11-20 13:59:55

标签: java unix

我们将在UNIX服务器上运行Java应用程序。要在前台运行它,我们使用下面的代码并将其放在文件

#! /bin/ksh

/usr/java14_64/bin/java -classpath
/clocal/mptsgrp/user/mptsuser/configcfa/classes:/clocal/mptsgrp/user/mptsuser/configcfa/mqjavalib/xerces.jar::$CLASSPATH
-Djava.library.path=/usr/lpp/mqm/lib:/clocal/udb/db2inst1/sqllib/java/sqlj.zip:/clocal/udb/db2inst1/sqllib/java/db2qgjava.jar:/clocal/udb/db2inst1/sqllib/java/Common.jar:/clocal/udb/db2inst1/sqllib/java/db2umplugin.jar:/clocal/udb/db2inst1/sqllib/java/db2policy.jar:/clocal/udb/db2inst1/sqllib/java/db2dbgm.jar:/clocal/udb/db2inst1/sqllib/java/db2jcc_license_cu.jar:/clocal/udb/db2inst1/sqllib/java/db2jcc_javax.jar:/clocal/udb/db2inst1/sqllib/java/db2java.zip:/clocal/udb/db2inst1/sqllib/java/db2jcc.jar:/usr/mqm/java/lib:/clocal/udb/db2inst1/sqllib/lib:/clocal/mptsgrp/user/mptsuser/mqjavalib:/clocal/mptsgrp/user/mptsuser/mqjavalib/com.ibm.mq.jar:/clocal/mptsgrp/user/mptsuser/mqjavalib/com.ibm.mqbind.jar:/clocal/mptsgrp/user/mptsuser/mqjavalib/com.ibm.mqjms.jar:/clocal/mptsgrp/user/mptsuser/mqjavalib/jms.jar:/clocal/mptsgrp/user/mptsuser/mqjavalib
-Dcfa.config.file=/clocal/mptsgrp/user/mptsuser/configcfa/9hpcfa3/config/build_9hpcfa3.properties
-Xms16m -Xmx64m Main

要从后台运行,我们使用下面的代码并将其放在文件中:

#! /bin/ksh

nohup /usr/java14_64/bin/java -classpath
/clocal/mptsgrp/user/mptsuser/configcfa/classes:/clocal/mptsgrp/user/mptsuser/configcfa/mqjavalib/xerces.jar::$CLASSPATH
-Djava.library.path=/usr/lpp/mqm/lib:/clocal/udb/db2inst1/sqllib/java/sqlj.zip:/clocal/udb/db2inst1/sqllib/java/db2qgjava.jar:/clocal/udb/db2inst1/sqllib/java/Common.jar:/clocal/udb/db2inst1/sqllib/java/db2umplugin.jar:/clocal/udb/db2inst1/sqllib/java/db2policy.jar:/clocal/udb/db2inst1/sqllib/java/db2dbgm.jar:/clocal/udb/db2inst1/sqllib/java/db2jcc_license_cu.jar:/clocal/udb/db2inst1/sqllib/java/db2jcc_javax.jar:/clocal/udb/db2inst1/sqllib/java/db2java.zip:/clocal/udb/db2inst1/sqllib/java/db2jcc.jar:/usr/mqm/java/lib:/clocal/udb/db2inst1/sqllib/lib:/clocal/mptsgrp/user/mptsuser/mqjavalib:/clocal/mptsgrp/user/mptsuser/mqjavalib/com.ibm.mq.jar:/clocal/mptsgrp/user/mptsuser/mqjavalib/com.ibm.mqbind.jar:/clocal/mptsgrp/user/mptsuser/mqjavalib/com.ibm.mqjms.jar:/clocal/mptsgrp/user/mptsuser/mqjavalib/jms.jar:/clocal/mptsgrp/user/mptsuser/mqjavalib
-Dcfa.config.file=/clocal/mptsgrp/user/mptsuser/configcfa/9hpcfa3/config/build_9hpcfa3.properties
-Xms16m -Xmx64m Main 1> /dev/null &

在我们的应用程序中,我们不确定,但与前台进程相比,处理数据时后台进程看起来要慢20-30%。我们将把大量信息写入日志。

0 个答案:

没有答案