2007年12月22日土曜日

[Java>JavaMail] Sometimes "java.net.ConnectException: Connection refused" occures.

[Description]
I'm using Sendmail SMTP Server in our Web System.
Sometimes in our web systems, "java.net.ConnectException: Connection refused" were occured when accessing SMTP Server via Java Servlet Programs. I tried to reproducing this problem again and again, but I could not reproduced this problem manually. I tried to simulate the operations to reproduce this problem in parallel by using Apache JMeter, I could reproduce this problem .

[Error Details]
java.net.ConnectException: Connection refused -> final: xxxxx.jp(Domainname): javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: ;

And I got the result of executing ps command as follows to check the sendmail process when this problem occured.
xxxxx 21249 1 0 12:22 ?
00:00:00 sendmail: rejecting connections on daemon MTA: load average: 13

[Cause]
In case of this, this problem occured only when the CPU load average was high.
We are using Sendmail and qpopper as SMTP system, Sendmail has a functionality to reject connecting to the SMTP system.

[Workaround]
We can control rejecting the user's connection by using following parameters when CPU load is high. We set these parameters into sendmail.mc, try recreating sendmail.cf and restart sendmail process.
define(`confQUEUE_LA',`30')dnl
define(`confDELAY_LA',`40')dnl
define(`confREFUSE_LA',`100')dnl

0 件のコメント: