0

here is some information:

cat /proc/net/sockstat

sockets: used 541
TCP: inuse 4000 orphan 3515 tw 4459 alloc 4011 mem 2012
UDP: inuse 2
RAW: inuse 0
FRAG: inuse 0 memory 0

TIME_WAIT 6014
CLOSE_WAIT 5
FIN_WAIT1 1563
FIN_WAIT2 47
ESTABLISHED 586
SYN_RECV 1314
CLOSING 154
LAST_ACK 211
Cpu(s):  0.1% us,  0.1% sy,  0.0% ni, 99.8% id,  0.0% wa,  0.0% hi,  0.0% si

The resin server takes several seconds to response a HTTP request, this bothers me for a long time.

Should I need more servers? Though the CPU usage, the server load seems not heavy at all.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
tanxiuguang
  • 65
  • 1
  • 6

1 Answers1

0

There are a few things you might look at to help track this down. It might be a thread starvation issue with older versions of Resin. (That guess wouldn't apply to Resin 4.0, but the debugging process would be similar.)

If you have Resin 4.0 professional, generate the PDF report or take a look at the /resin-admin. In particular, take a look at the thread graphs.

Or take a look at the thread dump, either in /resin-admin or using "resinctl thread-dump" or using jps/jstack.

You should see several threads in accept() for your HTTP port, and several threads processing the requests.

If you only see one or two threads in accept() for the port, you probably have hit that issue.

Either you can upgrade to Resin 4.0 or you can increase to something large like 4096. The older Resin 3.x default was set too low because 64-bit machines were rare then.