Project

General

Profile

Subfolders hangs

Added by webjay almost 11 years ago

According to the log files everything looks good, but when I load a page from a subfolder the connection hangs.
If I stop the server I can see that the browser got what it asked for.

Try this one:
curl -iv http://fhngt8aa.joyent.us:81/test/logo.png

Also, after it hangs nothing is served.

2009-02-04 16:42:23: (log.c.75) server started
2009-02-04 16:42:27: (request.c.294) fd: 7 request-len: 166
GET /test/logo.png HTTP/1.1
User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
Host: fhngt8aa.joyent.us:81
Accept: */*

2009-02-04 16:42:27: (response.c.205) -- splitting Request-URI
2009-02-04 16:42:27: (response.c.206) Request-URI : /test/logo.png
2009-02-04 16:42:27: (response.c.207) URI-scheme : http
2009-02-04 16:42:27: (response.c.208) URI-authority: fhngt8aa.joyent.us:81
2009-02-04 16:42:27: (response.c.209) URI-path : /test/logo.png
2009-02-04 16:42:27: (response.c.210) URI-query :
2009-02-04 16:42:27: (response.c.260) -- sanatising URI
2009-02-04 16:42:27: (response.c.261) URI-path : /test/logo.png
2009-02-04 16:42:27: (mod_access.c.135) -- mod_access_uri_handler called
2009-02-04 16:42:27: (response.c.375) -- before doc_root
2009-02-04 16:42:27: (response.c.376) Doc-Root : /var/www/htdocs
2009-02-04 16:42:27: (response.c.377) Rel-Path : /test/logo.png
2009-02-04 16:42:27: (response.c.378) Path :
2009-02-04 16:42:27: (response.c.426) -- after doc_root
2009-02-04 16:42:27: (response.c.427) Doc-Root : /var/www/htdocs
2009-02-04 16:42:27: (response.c.428) Rel-Path : /test/logo.png
2009-02-04 16:42:27: (response.c.429) Path : /var/www/htdocs/test/logo.png
2009-02-04 16:42:27: (response.c.446) -- logical > physical
2009-02-04 16:42:27: (response.c.447) Doc-Root : /var/www/htdocs
2009-02-04 16:42:27: (response.c.448) Rel-Path : /test/logo.png
2009-02-04 16:42:27: (response.c.449) Path : /var/www/htdocs/test/logo.png
2009-02-04 16:42:27: (response.c.466) -
handling physical path
2009-02-04 16:42:27: (response.c.467) Path : /var/www/htdocs/test/logo.png
2009-02-04 16:42:27: (response.c.474) -- file found
2009-02-04 16:42:27: (response.c.475) Path : /var/www/htdocs/test/logo.png
2009-02-04 16:42:27: (response.c.613) -- handling subrequest
2009-02-04 16:42:27: (response.c.614) Path : /var/www/htdocs/test/logo.png
2009-02-04 16:42:27: (mod_access.c.135) -- mod_access_uri_handler called
2009-02-04 16:42:27: (mod_staticfile.c.394) -- handling file as static file
2009-02-04 16:42:27: (response.c.625) -- subrequest finished
2009-02-04 16:42:27: (response.c.114) Response-Header:
HTTP/1.1 200 OK
Content-Type: image/png
Accept-Ranges: bytes
ETag: "-1715170880"
Last-Modified: Wed, 04 Feb 2009 12:10:17 GMT
Content-Length: 10966
Date: Wed, 04 Feb 2009 16:42:27 GMT
Server: lighttpd/1.4.18

$ sudo /opt/local/svc/svc-lighttpd start
[fhngt8aa@fhngt8aa /opt/local]$ 2009-02-04 16:37:16: (mod_fastcgi.c.1303) --- fastcgi spawning local
proc: /usr/local/bin/php-cgi c /opt/local/etc/php.ini
port: 0
socket /tmp/php-fastcgi.socket
min-procs: 4
max-procs: 4
2009-02-04 16:37:16: (mod_fastcgi.c.1328) --
fastcgi spawning
port: 0
socket /tmp/php-fastcgi.socket
current: 0 / 4
2009-02-04 16:37:16: (mod_fastcgi.c.1328) --- fastcgi spawning
port: 0
socket /tmp/php-fastcgi.socket
current: 1 / 4
2009-02-04 16:37:16: (mod_fastcgi.c.1328) --- fastcgi spawning
port: 0
socket /tmp/php-fastcgi.socket
current: 2 / 4
2009-02-04 16:37:16: (mod_fastcgi.c.1328) --- fastcgi spawning
port: 0
socket /tmp/php-fastcgi.socket
current: 3 / 4


Replies (15)

RE: Subfolders hangs - Added by icy almost 11 years ago

Hm strange it hangs indeed. Can you provide more info like OS, config etc?
You also mentioned subfolders. Is it specific to certain subfolder, to all subfolders or any resource?

RE: Subfolders hangs - Added by webjay almost 11 years ago

I'm on SunOS.
My Lighttpd config is attached.
Here's my phpinfo()

What I find very odd is that when it hangs it's impossible to access anything.

I've been hacking this for days now. When it works I'll use it on port 80.

Thanks for helping.

Jacob

RE: Subfolders hangs - Added by icy almost 11 years ago

BTW: it doesn't seem to hang for ever. The png loaded in my browser after a LOT of time.
The php info page loads fast.
Can you attach strace or whatever the equivalent is on Solaris and find out what lighty is doing?
If that doesn't show anything than try with gdb and provide a backtrace.

RE: Subfolders hangs - Added by webjay almost 11 years ago

It looks like I have /usr/bin/strace but no gdb.

Could you help me with strace?

$ sudo strace /opt/local/svc/svc-lighttpd start
ERROR: tracer already exists

RE: Subfolders hangs - Added by icy almost 11 years ago

sudo strace -p `pidof lighttpd`
Execute this when the server is "hanging".

RE: Subfolders hangs - Added by webjay almost 11 years ago

I get:

$ sudo strace -p /var/run/lighttpd.pid
ERROR: tracer already exists

I also tried
$ sudo strace -olighttpd.trace -tt -s 4000 -p /var/run/lighttpd.pid
which gives me nothing

RE: Subfolders hangs - Added by webjay almost 11 years ago

Attached is:
$ sudo truss /opt/local/sbin/lighttpd -D -f /opt/local/etc/lighttpd/lighttpd.conf &> truss.txt

truss.txt (31.5 KB) truss.txt truss output

RE: Subfolders hangs - Added by webjay almost 11 years ago

... and it's still sleeping:
$ tail /tmp/truss.txt
write(6, " 2 0 0 9 - 0 2 - 0 4 1".., 62) = 62
write(6, " 2 0 0 9 - 0 2 - 0 4 1".., 84) = 84
write(6, " 2 0 0 9 - 0 2 - 0 4 1".., 74) = 74
write(6, " 2 0 0 9 - 0 2 - 0 4 1".., 77) = 77
write(6, " 2 0 0 9 - 0 2 - 0 4 1".., 62) = 62
write(6, " 2 0 0 9 - 0 2 - 0 4 1".., 276) = 276
setsockopt(7, tcp, TCP_CORK, 0x080476C8, 4, SOV_DEFAULT) = 0
writev(7, 0x08047610, 1) = 218
open64("/var/www/htdocs/test/logo.png", O_RDONLY) = 8
sendfilev64(1, 7, 0x080475F0, 1, 0x080475E8) (sleeping...)

RE: Subfolders hangs - Added by icy almost 11 years ago

Could you repeat that but with additional timestamp output? Or is is just doing nothing after the sendfilev64 call?

RE: Subfolders hangs - Added by webjay almost 11 years ago

I think it's doing nothing. I've waited for about 2 hours.

$ tail /tmp/truss.txt
write(6, " 2 0 0 9 - 0 2 - 0 4 1".., 62) = 62
write(6, " 2 0 0 9 - 0 2 - 0 4 1".., 84) = 84
write(6, " 2 0 0 9 - 0 2 - 0 4 1".., 74) = 74
write(6, " 2 0 0 9 - 0 2 - 0 4 1".., 77) = 77
write(6, " 2 0 0 9 - 0 2 - 0 4 1".., 62) = 62
write(6, " 2 0 0 9 - 0 2 - 0 4 1".., 276) = 276
setsockopt(7, tcp, TCP_CORK, 0x080476C8, 4, SOV_DEFAULT) = 0
writev(7, 0x08047610, 1) = 218
open64("/var/www/htdocs/test/logo.png", O_RDONLY) = 8
sendfilev64(1, 7, 0x080475F0, 1, 0x080475E8) (sleeping...)

And my browser is still waiting for the server to hang up.

RE: Subfolders hangs - Added by webjay almost 11 years ago

When I manually stop lighttpd I get:

sendfilev64(1, 7, 0x080475F0, 1, 0x080475E8) (sleeping...)
Received signal #2, SIGINT, in sendfilev64() [caught]
siginfo: SIG#0
sendfilev64(1, 7, 0x080475F0, 1, 0x080475E8) Err#4 EINTR
lwp_sigmask(SIG_SETMASK, 0x00000002, 0x00000000) = 0xFFBFFEFF [0x0000FFFF]
setcontext(0x08047060)
close(8) = 0
setsockopt(7, tcp, TCP_CORK, 0x080476C8, 4, SOV_DEFAULT) = 0
write(3, " 9 3 . 1 6 1 . 2 3 7 . 2".., 242) = 242
ioctl(7, FIONREAD, 0x08047648) = 0
read(7, 0x080DF210, 639) Err#11 EAGAIN
time() = 1233780787
shutdown(7, SHUT_WR, SOV_DEFAULT) = 0
close(7) = 0
close(5) = 0
unlink("/var/run/lighttpd.pid") Err#13 EACCES [ZONE]
write(6, " 2 0 0 9 - 0 2 - 0 4 2".., 71) = 71
pollsys(0x080A1E98, 2, 0x08047AE8, 0x00000000) (sleeping...)
pollsys(0x080A1E98, 2, 0x08047AE8, 0x00000000) = 0
write(6, " 2 0 0 9 - 0 2 - 0 4 2".., 72) = 72
close(6) = 0
close(3) = 0
munmap(0xFEB10000, 5273) = 0
munmap(0xFEB21000, 1756) = 0
munmap(0xFEA30000, 7651) = 0
munmap(0xFEA41000, 4208) = 0
munmap(0xFEA10000, 4820) = 0
munmap(0xFEA21000, 1272) = 0
munmap(0xFE9F0000, 4481) = 0
munmap(0xFEA01000, 924) = 0
munmap(0xFE9D0000, 44089) = 0
munmap(0xFE9EA000, 4396) = 0
munmap(0xFE9B0000, 11528) = 0
munmap(0xFE9C2000, 4064) = 0
munmap(0xFE980000, 63955) = 0
munmap(0xFE99F000, 4206) = 0
munmap(0xFE960000, 48703) = 0
munmap(0xFE97B000, 7390) = 0
munmap(0xFE940000, 7138) = 0
munmap(0xFE951000, 3620) = 0
munmap(0xFE920000, 11969) = 0
munmap(0xFE932000, 4464) = 0
munmap(0xFE900000, 14955) = 0
munmap(0xFE913000, 3528) = 0
munmap(0xFE8E0000, 9160) = 0
munmap(0xFE8F2000, 1620) = 0
munmap(0xFEB00000, 4096) = 0
_exit(0)

RE: Subfolders hangs - Added by webjay almost 11 years ago

If I tunnel in via SSH there's no problem.
Does that tell us that it's some network problem?

RE: Subfolders hangs - Added by icy almost 11 years ago

I think it's a problem with sendfilev64 in some way. But not sure what is really causing it.
Can you try setting server.network-backend to writev?

RE: Subfolders hangs - Added by webjay almost 11 years ago

Done. Looks like that was it :)

I had never imagined it could be that simple.

RE: Subfolders hangs - Added by webjay almost 11 years ago

Thanks a lot for your time icy.

    (1-15/15)