Link to home
Start Free TrialLog in
Avatar of jon18_uk
jon18_uk

asked on

EAGAIN (Resource temporarily unavailable)

Hi all,

Lately I have been experiencing an odd error with Apache.  At times, a page would fail to download.  The error_log were not giving any clues, so I tried using strace.  Once I worked out with pid my request was being served by, I attached strace and made requests until one demonstrated the problem.  The strace output is as follows.  I am running Linux (RedHat) with Apache 1.3.27.

writev(3, [{"HTTP/1.1 200 OK\r\nDate: Thu, 13 M"..., 308}, {"fe7\r\n",5}, {"<!DOCTYPE HTML PUBLIC \"-//W3C//D"..., 4071}, {"\r\n", 2}], 4) =4386
read(7, 0xbffef860, 8192)               = -1 EAGAIN (Resource temporarily unavailable)
select(8, [7], NULL, NULL, NULL)        = 1 (in [7])
read(7, "d></tr>\n</table>\n<img src=\"http:"..., 8192) = 4096
writev(3, [{"1000\r\n", 6}, {"d></tr>\n</table>\n<img src=\"http:"..., 4096}, {"\r\n", 2}], 3) = 4104
read(7, 0xbffef860, 8192)               = -1 EAGAIN (Resource temporarily unavailable)
select(8, [7], NULL, NULL, NULL)        = 1 (in [7])
read(7, 0xbffef860, 8192)               = -1 EAGAIN (Resource temporarily unavailable)
select(8, [7], NULL, NULL, NULL)        = 1 (in [7])
read(7, "F4F4\"><font face=\"Arial,Helvetic"..., 8192) = 4096
writev(3, [{"1000\r\n", 6}, {"F4F4\"><font face=\"Arial,Helvetic"...,4096}, {"\r\n", 2}], 3) = 4104
read(7, 0xbffef860, 8192)               = -1 EAGAIN (Resource temporarily unavailable)
select(8, [7], NULL, NULL, NULL)        = 1 (in [7])
read(7, "=\"Arial,Helvetica,sans-serif\" si"..., 8192) = 4096
writev(3, [{"1000\r\n", 6}, {"=\"Arial,Helvetica,sans-serif\" si"...,4096}, {"\r\n", 2}], 3) = 4104
read(7, 0xbffef860, 8192)               = -1 EAGAIN (Resource temporarily unavailable)
select(8, [7], NULL, NULL, NULL)        = 1 (in [7])
read(7, "=\"2\"><strong><a href=\"http://www"..., 8192) = 4096
writev(3, [{"1000\r\n", 6}, {"=\"2\"><strong><a href=\"http://www"...,4096}, {"\r\n", 2}], 3) = 1918
--- SIGCHLD (Child exited) ---

Doing a bit of digging shows that the error may be related to limits the apache user has been set, and it hitting these limits?  Its quite a busy server, plus the requests Apache is processing, when the error is experienced, are very dynamic pages, so it does execute Perl a few times (though side server includes) - we are looking at mod_perl, but would like to try and get to the bottom of this problem first.

Any points, or possible solutions?  Thanks.

Jon.
Avatar of jon18_uk
jon18_uk

ASKER

I thought I better add a bit of background.  The apache the site in question is based on also hosts some other sites of ours, which again use high numbers of Perl scripts.  These do not have the problem, or which you can see anyway.

The problem normally happens when you refresh a page, for example, visit the site, and it loads, press refresh moments later, and the request will fail.  The page would part download, and then the browser will request the page again, which would then work.  As the strace shows I think, the child process handling the requests dies, hence the termination of the request to the browser - then the browser re-requests the page, and hence a new child process is used for it.

There is no core dump or clues in the error log.  I couldn't see how to turn on apache debug, "LogLevel debug" (replacing the current LogLevel) didn't make a different to what was logged, apart from some other info details like the build date.

Anyway to turn on the debug, so it walks though what Apache does?
ASKER CERTIFIED SOLUTION
Avatar of samri
samri
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial