From: Alex Sharp <ajsharp@gmail.com>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: Strange quit behavior
Date: Mon, 22 Aug 2011 19:59:36 -0700 [thread overview]
Message-ID: <CAB3oGjrp1Dspb7=igdF07O8NdTBKd99BrofjsN7c=E8_FdCGzg@mail.gmail.com> (raw)
In-Reply-To: <CAB3oGjojahyt8gQvj22b=HNOU0bj5b46orfc0PRQuQMB7Ezv3w@mail.gmail.com>
>> Can you add "-f -e '!futex'" to the strace invocation so we see
>> all the threads? You can also add '-T' to get timing information
>> to see how long each syscall takes or '-tt' to get timestamps
>> in strace if you think it's useful.
Here's the result of strace with suggested flags on the old master.
(To clarify, this is still the spinning CPU issue)
→ sudo strace -v -f -e '!futex' -p 18862
Process 18862 attached with 2 threads - interrupt to quit
[pid 22170] restart_syscall(<... resuming interrupted call ...> <unfinished ...>
[pid 18862] select(4, [3], NULL, NULL, {3, 546106}) = 0 (Timeout)
[pid 18862] wait4(-1, 0x7fffbb907d3c, WNOHANG, NULL) = 0
[pid 18862] clock_gettime(CLOCK_REALTIME, {1314067031, 459472514}) = 0
[pid 18862] fstat(7, {st_dev=makedev(202, 1), st_ino=31695,
st_mode=S_IFREG, st_nlink=0, st_uid=1001, st_gid=1001,
st_blksize=4096, st_blocks=0, st_size=0, st_atime=2011/08/23-00:09:05,
st_mtime=2011/08/23-00:09:05, st_ctime=2011/08/23-02:37:06}) = 0
[pid 18862] clock_gettime(CLOCK_REALTIME, {1314067031, 459813102}) = 0
[pid 18862] fstat(11, {st_dev=makedev(202, 1), st_ino=31696,
st_mode=S_IFREG, st_nlink=0, st_uid=1001, st_gid=1001,
st_blksize=4096, st_blocks=0, st_size=0, st_atime=2011/08/23-00:09:05,
st_mtime=2011/08/23-00:09:05, st_ctime=2011/08/23-02:37:07}) = 0
[pid 18862] clock_gettime(CLOCK_REALTIME, {1314067031, 459999675}) = 0
[pid 18862] fstat(13, {st_dev=makedev(202, 1), st_ino=31697,
st_mode=S_IFREG, st_nlink=0, st_uid=1001, st_gid=1001,
st_blksize=4096, st_blocks=0, st_size=0, st_atime=2011/08/23-00:09:05,
st_mtime=2011/08/23-00:09:05, st_ctime=2011/08/23-02:37:07}) = 0
[pid 18862] clock_gettime(CLOCK_REALTIME, {1314067031, 460168995}) = 0
[pid 18862] fstat(14, {st_dev=makedev(202, 1), st_ino=31698,
st_mode=S_IFREG, st_nlink=0, st_uid=1001, st_gid=1001,
st_blksize=4096, st_blocks=0, st_size=0, st_atime=2011/08/23-00:09:05,
st_mtime=2011/08/23-00:09:05, st_ctime=2011/08/23-02:37:07}) = 0
[pid 18862] clock_gettime(CLOCK_REALTIME, {1314067031, 460343593}) = 0
[pid 18862] select(4, [3], NULL, NULL, {6, 255959}) = 0 (Timeout)
[pid 18862] wait4(-1, 0x7fffbb907d3c, WNOHANG, NULL) = 0
[pid 18862] clock_gettime(CLOCK_REALTIME, {1314067037, 739352608}) = 0
[pid 18862] fstat(7, {st_dev=makedev(202, 1), st_ino=31695,
st_mode=S_IFREG, st_nlink=0, st_uid=1001, st_gid=1001,
st_blksize=4096, st_blocks=0, st_size=0, st_atime=2011/08/23-00:09:05,
st_mtime=2011/08/23-00:09:05, st_ctime=2011/08/23-02:37:16}) = 0
[pid 18862] clock_gettime(CLOCK_REALTIME, {1314067037, 739570659}) = 0
[pid 18862] fstat(11, {st_dev=makedev(202, 1), st_ino=31696,
st_mode=S_IFREG, st_nlink=0, st_uid=1001, st_gid=1001,
st_blksize=4096, st_blocks=0, st_size=0, st_atime=2011/08/23-00:09:05,
st_mtime=2011/08/23-00:09:05, st_ctime=2011/08/23-02:37:17}) = 0
[pid 18862] clock_gettime(CLOCK_REALTIME, {1314067037, 739768755}) = 0
[pid 18862] fstat(13, {st_dev=makedev(202, 1), st_ino=31697,
st_mode=S_IFREG|01, st_nlink=0, st_uid=1001, st_gid=1001,
st_blksize=4096, st_blocks=0, st_size=0, st_atime=2011/08/23-00:09:05,
st_mtime=2011/08/23-00:09:05, st_ctime=2011/08/23-02:37:17}) = 0
[pid 18862] clock_gettime(CLOCK_REALTIME, {1314067037, 739951254}) = 0
[pid 18862] fstat(14, {st_dev=makedev(202, 1), st_ino=31698,
st_mode=S_IFREG|01, st_nlink=0, st_uid=1001, st_gid=1001,
st_blksize=4096, st_blocks=0, st_size=0, st_atime=2011/08/23-00:09:05,
st_mtime=2011/08/23-00:09:05, st_ctime=2011/08/23-02:37:17}) = 0
[pid 18862] clock_gettime(CLOCK_REALTIME, {1314067037, 740130965}) = 0
[pid 18862] select(4, [3], NULL, NULL, {9, 996190}^C <unfinished ...>
>> Also, I assume you're using preload_app? If you are, do you see this
>> issue with preload_app=false? I suspect there's some background thread
>> that could be running in the master process taking up all the CPU time.
>> Unicorn itself never spawns background threads.
I went ahead and ran strace with the same flags on the *new* master,
and saw a bunch of output that looked bundler-related:
https://gist.github.com/138344b5b19ec6ba1a4c
Even more bizarre, eventually the process started successfully :-/ Is
it possible this had something to do with strace de-taching?
You can see this in the unicorn.stderr.log file I included in the
gist. Check out these two lines in particular, which occur 25 minutes
apart:
I, [2011-08-23T02:15:08.396868 #22169] INFO -- : Refreshing Gem list
I, [2011-08-23T02:40:16.621210 #22925] INFO -- : worker=1 spawned pid=22925
Question: If I turn on debug flags in unicorn, will I get much of this
output in the unicorn.stderr log?
- Alex
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying
next prev parent reply other threads:[~2011-08-23 4:08 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-02 20:09 Strange quit behavior James Cox
2011-08-02 20:34 ` Alex Sharp
2011-08-02 21:54 ` Eric Wong
2011-08-05 4:09 ` Alex Sharp
2011-08-05 4:12 ` Alex Sharp
2011-08-05 8:07 ` Eric Wong
2011-08-17 4:26 ` Alex Sharp
2011-08-17 9:22 ` Eric Wong
2011-08-17 20:13 ` Eric Wong
2011-08-18 23:13 ` Alex Sharp
2011-08-19 1:53 ` Eric Wong
2011-08-19 9:42 ` Alex Sharp
2011-08-19 16:51 ` Eric Wong
2011-08-23 2:59 ` Alex Sharp [this message]
2011-08-23 7:12 ` Eric Wong
2011-08-23 16:49 ` Alex Sharp
2011-08-23 20:23 ` Eric Wong
2011-08-31 0:33 ` Eric Wong
2011-09-01 18:45 ` Alex Sharp
2011-09-01 19:46 ` Eric Wong
2011-09-01 19:57 ` Alex Sharp
2011-09-01 20:26 ` Eric Wong
2011-08-02 20:45 ` cliftonk
2011-08-02 21:53 ` Eric Wong
2011-08-02 22:46 ` James Cox
2011-08-02 23:08 ` Eric Wong
2011-08-02 23:49 ` Alex Sharp
2011-08-03 0:34 ` Eric Wong
2011-08-03 1:36 ` Eric Wong
2011-08-19 22:18 ` Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/unicorn/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAB3oGjrp1Dspb7=igdF07O8NdTBKd99BrofjsN7c=E8_FdCGzg@mail.gmail.com' \
--to=ajsharp@gmail.com \
--cc=mongrel-unicorn@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/unicorn.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).