I've ZendFramework based application that's using XMLRPC communication with other ZendFramework application. Both of them are on a single server (for development). That communication is extremely slow, and i'm attempting to discover why. After profiling, I acquired to the stage where there's a downturn within fgets() of ZF Lib XMLRPC readers.

While strace-ing ZendFramework based PHP Application, I recieve some designs with recv() awaiting just a few seconds? Anybody have idea how can this be may be happening?

 0.000038 gettimeofday({1278333900, 86101}, NULL) = 0
 0.000037 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 32
 0.000035 fcntl64(32, F_GETFL)      = 0x2 (flags O_RDWR)
 0.000033 fcntl64(32, F_SETFL, O_RDWR|O_NONBLOCK) = 0
 0.000034 connect(32, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in progress)
 0.000076 poll([{fd=32, events=POLLIN|POLLOUT|POLLERR|POLLHUP}], 1, 120000) = 1 ([{fd=32, revents=POLLOUT}])
 0.000045 getsockopt(32, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
 0.000036 fcntl64(32, F_SETFL, O_RDWR) = 0
 0.000113 send(32, "POST /r/?articleId=554&hpr=Pimpl"..., 1180, MSG_DONTWAIT) = 1180
 0.000148 poll([{fd=32, events=POLLIN|POLLERR|POLLHUP}], 1, 120000) = 1 ([{fd=32, revents=POLLIN}])
 0.028020 recv(32, "HTTP/1.1 200 OK\r\nDate: Mon, 05 J"..., 8192, MSG_DONTWAIT) = 543
 0.000105 poll([{fd=32, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 0 (Timeout)
 0.000050 poll([{fd=32, events=POLLIN|POLLERR|POLLHUP}], 1, 120000) = 1 ([{fd=32, revents=POLLIN}])
15.012976 recv(32, "", 8192, MSG_DONTWAIT) = 0
 0.000123 close(32)                 = 0

I understand little about ZendFramework so take my comments having a touch of suspicion... but!

Basically appreciate this properly

0.000050 poll([{fd=32, events=POLLIN|POLLERR|POLLHUP}], 1, 120000) = 1 ([{fd=32, revents=POLLIN}])
15.012976 recv(32, "", 8192, MSG_DONTWAIT) = 0

This means that you're polling around the socket (32) you receive a signal POLLIN (incoming data) put forth recv and watch for just a few seconds (timeout) getting bytes back

This in my experience would indicate a bug. most likely within the zendframework or possibly the way you are calling it. receiving bytes following a recv signifies the socket was cleanly closed (instead of forced shut). Therefore whenever you emerge from poll and get into recv the response ought to be immediate (its only reading through bytes in the end)

The Monosodium glutamate_DONTWAIT flag I suppose means to enter non obstructing mode meaning regardless of the information waiting it will return immediately, either with data or having a wouldblock error, to come back in to the polling loop.

It might often be that another thing is freezing the thread leading to this to lockup. try placing the applications on two different machines to ascertain if you receive exactly the same error. it might be some strange interaction.

Electricity