对服务器造肯定有影响。但没有想像中那样严重,作为一个Web服务器它是允许服务器使用者有自己的后台处理线程,适当的实时/定时处理一些情况。

解决方案 »

  1.   

    I suggest you not to load the servlet in Tomcat. One of the better solutions is to run the schedule job in another console. Your question is whether or not the servlet will influence the server, and my question is definitely yes. But if you do not run the job in Tomcat's JVM, your tomcat will not be affected. But for your hardware server, the two solution are almost the same.
      

  2.   

    to: patrickwang() 
    我用的是linux + tomcat.
    如果另外来控制,我将如何知道我的服务是启动的?(因为只有服务启动了,在指定的时间这个任务才执行的)
    指点一下!
      

  3.   

    在linux写一个守护程序定时调用执行就可。
      

  4.   

    to:bill_hongs(hongs) 
    比如我要每天的6:30执行,执行前我要判断我的web程序是否打开,如果打开就执行,否则等待下一个6:30.
    在linux怎么写守护程序?可以有参考吗?
      

  5.   

    你说判断web程序是否打开,意思就是tomcat有没有启动吗?写一个cronjob很简单的,用不着在servlet中起timer. 看看crontab的帮助
      

  6.   

    服务器已经启用tomcat了,             吧~
    不用写timer了,                      吧~