Google Groups Home
Help | Sign in
Thin, ps, rails, and me
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Jeff  
View profile
 More options May 6, 10:16 pm
From: Jeff <cohen.j...@gmail.com>
Date: Tue, 6 May 2008 19:16:49 -0700 (PDT)
Local: Tues, May 6 2008 10:16 pm
Subject: Thin, ps, rails, and me
With mongrel, I can do ps aux | grep ruby and see which mongrels are
serving up which rails apps.  With thin, I don't see anything that
helps remind me which ports are serving which rails apps.

My linux fu is not that great, so maybe there's a better way to use ps
that will tell me?

If this sounds like a silly question, it's because our servers host
many Rails apps, most of which I don't write, and being able to see
which process is related to which app is sometimes very helpful.

Thanks
Jeff


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kevin Williams  
View profile
 More options May 7, 7:50 am
From: "Kevin Williams" <kev...@gmail.com>
Date: Wed, 7 May 2008 05:50:32 -0600
Local: Wed, May 7 2008 7:50 am
Subject: Re: Thin, ps, rails, and me
If you run your thin processes under your login account, you could
drop the "a" from the command, like "ps ux".

You could match the pids from the pidfiles to what ps shows you.

Could you use unix sockets instead of tcp sockets? I can see exactly
what processes go with which app because the path of the socket file
is listed in the ps output.

root     15131  0.0 23.4 209264 122740 ?       S    05:09   0:06 thin
server (/u/apps/almostserious/shared/pids/thin.1.sock)
root     15133  0.0 23.4 209420 122852 ?       S    05:09   0:07 thin
server (/u/apps/almostserious/shared/pids/thin.2.sock)

Hope that helps.

--
Cheers,

Kevin Williams
http://bantamtech.com/
http://almostserio.us/
http://kevwil.com/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gpop  
View profile
 More options May 7, 9:01 am
From: gpop <gpop2...@gmail.com>
Date: Wed, 7 May 2008 06:01:19 -0700 (PDT)
Local: Wed, May 7 2008 9:01 am
Subject: Re: Thin, ps, rails, and me
Check out thin-proctitle, it's an attempt at duplicating
mongrel_proctitle for thin:

http://github.com/grempe/thin-proctitle/tree/master

I've changed up mine and use:

-------------------
class ProcTitle

  def initialize(app)
    @app = app
  end

  def call(env)
    $0 = "thin [port #{env['SERVER_PORT']}]: #{env['SERVER_NAME']}:
#{env['REQUEST_METHOD']} #{env['PATH_INFO']}".gsub(/\000/,'').gsub(/\s+
$/,'')
    @app.call(env)
  end

end
use ProcTitle
run Rack::Adapter::Rails.new(:root => '/home/gpopescu/bbprojects/
ipspace/R2.1.6', :environment => 'development')
-------------------

There aren't a whole lot of ENV variables available to make a very
useful proctitle, but you may find some useful. Here's the ENV
variables I get:

-------------------
"SERVER_NAME"=>"localhost"
"rack.url_scheme"=>"http"
"HTTP_ACCEPT_ENCODING"=>"gzip,deflate"
"HTTP_USER_AGENT"=>"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:
1.8.1.14) Gecko/20080418 Ubuntu/7.10 (gutsy) Firefox/2.0.0.14"
"PATH_INFO"=>"/bundles/js_finder/images/arrow_e.png"
"rack.run_once"=>false, "rack.input"=>#<StringIO:0xb69d9908>,
"SCRIPT_NAME"=>""
"SERVER_PROTOCOL"=>"HTTP/1.1"
"HTTP_ACCEPT_LANGUAGE"=>"en-us,en;q=0.5"
"HTTP_HOST"=>"localhost:3000"
"rack.errors"=>#<IO:0xb7cc8f50>, "REMOTE_ADDR"=>"127.0.0.1"
"HTTP_KEEP_ALIVE"=>"300"
"REQUEST_PATH"=>"/bundles/js_finder/images/arrow_e.png"
"SERVER_SOFTWARE"=>"thin 0.8.1 codename Rebel Porpoise"
"HTTP_REFERER"=>"http://localhost:3000/bundles/js_finder/stylesheets/
js_finder.css?1204243211"
"HTTP_COOKIE"=>"xxCOOKIExx=21a206d7c99b01475; xxCOOKIE2xx=bob"
"HTTP_ACCEPT_CHARSET"=>"ISO-8859-1,utf-8;q=0.7,*;q=0.7"
"HTTP_VERSION"=>"HTTP/1.1"
"rack.multithread"=>false, "rack.version"=>[0, 3], "REQUEST_URI"=>"/
bundles/js_finder/images/arrow_e.png"
"rack.multiprocess"=>false, "SERVER_PORT"=>"3000"
"QUERY_STRING"=>""
"GATEWAY_INTERFACE"=>"CGI/1.2"
"HTTP_ACCEPT"=>"image/png,*/*;q=0.5"
"HTTP_CONNECTION"=>"keep-alive"
"REQUEST_METHOD"=>"GET"
-------------------

(I munged my cookies in the above example). Anyway, you just make a
file called title.ru and run thin with "-R title.ru" for it to be
used. If you use a YAML file for the thin config, just add the line
"rackup: title.ru" to the YAML file.

--George

On May 6, 9:16 pm, Jeff <cohen.j...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
macournoyer  
View profile
 More options May 8, 9:25 am
From: macournoyer <macourno...@gmail.com>
Date: Thu, 8 May 2008 06:25:11 -0700 (PDT)
Local: Thurs, May 8 2008 9:25 am
Subject: Re: Thin, ps, rails, and me
I usually do "ps aux | grep thin"

On May 7, 9:01 am, gpop <gpop2...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gpop  
View profile
 More options May 8, 12:05 pm
From: gpop <gpop2...@gmail.com>
Date: Thu, 8 May 2008 09:05:08 -0700 (PDT)
Local: Thurs, May 8 2008 12:05 pm
Subject: Re: Thin, ps, rails, and me
On that note, on my system, the thin gem installs with a shebang that
calls env ruby as opposed to ruby directly. If the shebang calls env
ruby, then ps axc shows them as ruby processes, not thin processes,
but if you change the shebang to call ruby directly, ps axc shows them
as thin processes.

--George

On May 8, 8:25 am, macournoyer <macourno...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff  
View profile
 More options May 8, 2:55 pm
From: Jeff <cohen.j...@gmail.com>
Date: Thu, 8 May 2008 11:55:04 -0700 (PDT)
Local: Thurs, May 8 2008 2:55 pm
Subject: Re: Thin, ps, rails, and me
Great - thanks everyone for the input.

Jeff

On May 8, 11:05 am, gpop <gpop2...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff  
View profile
 More options May 8, 2:55 pm
From: Jeff <cohen.j...@gmail.com>
Date: Thu, 8 May 2008 11:55:58 -0700 (PDT)
Local: Thurs, May 8 2008 2:55 pm
Subject: Re: Thin, ps, rails, and me
On May 8, 8:25 am, macournoyer <macourno...@gmail.com> wrote:

> I usually do "ps aux | grep thin"

Right, but at leat on our servers, that isn't showing me what the
working directories are, so I'm not sure which apps they are.

Thanks
Jeff


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google