Dedicated Server: Lighty, Rails, MySQL...Maintenance?

Slightly OT, but wanted some specific advice from other railers…

We have just set up a dedicated Debian box, with a lean installation of
Lighttpd, MySQL and Rails (with the obvious Ruby libraries underneath).
We have our first app up and running, with lighttpd set up for one fcgi
proc (for now). This is an internal, authenticated app with relatively
low traffic, but we plan to add additional rails apps to this server in
the future.

Now to my question: I am looking to set up some cron jobs to maintain
everything. Any suggestions, particularly with regard to lighttpd and
cleaning up after FCGI? Should I be gracefully restarting the server
every once and again?

The setup is a dual 800 Xeon with 1.25 GB of RAM. Everything is stored
on an a ~70GB SCSI array.

Just a self update, here are a few things that are already making my
life a bit easier. Still open for suggestions…

  1. SCGI - So simple to setup and no more fretting about FCGI processes.
    This took me literally 5 minutes to install, change the lighttpd config,
    and start a process…

  2. Added the following line to a daily cron job to clean up session
    files in /tmp
    find /tmp/ -name “ruby_sess*” -cmin +600 -exec rm {} ;

Brad D. [email protected] wrote:

Slightly OT, but wanted some specific advice from other railers…

We have just set up a dedicated Debian box, with a lean installation of
Lighttpd, MySQL and Rails (with the obvious Ruby libraries underneath).
We have our first app up and running, with lighttpd set up for one fcgi
proc (for now). This is an internal, authenticated app with relatively
low traffic, but we plan to add additional rails apps to this server in
the future.

Now to my question: I am looking to set up some cron jobs to maintain
everything. Any suggestions, particularly with regard to lighttpd and
cleaning up after FCGI? Should I be gracefully restarting the server
every once and again?

The setup is a dual 800 Xeon with 1.25 GB of RAM. Everything is stored
on an a ~70GB SCSI array.

On Nov 27, 2005, at 7:21 PM, Brad D. wrote:

server in
the future.

Now to my question: I am looking to set up some cron jobs to maintain
everything. Any suggestions, particularly with regard to lighttpd and
cleaning up after FCGI? Should I be gracefully restarting the server
every once and again?

The setup is a dual 800 Xeon with 1.25 GB of RAM. Everything is stored
on an a ~70GB SCSI array.

Brad-

I run a largish site on lighttpd/fcgi on a dedicated server. The

things to keep your eye on are mostly the /tmp/ruby-sess* files and
the lighttpd_access.log. The lighttpd_access.log gets to be around 1
gig in about 5 days if I don’t rotate it. So I have cron jobs to
rotate that log file and also to erase the session files in /tmp that
are older than 12 hours every twelve hours. Now there might be a
difference in how long you need to keep your sessions so adjust
accordingly, but those things pile up quick.

As far as restarting the fcgi's or lighttpd goes, I don't have to do

that at all. They run great without problems for months now. The only
time I need to restart the lighty server/fcgi’s is when I push a new
production version of my app to go live. Then I restart just because
I need a restart to get production mode to pick up the new code.
Other than that the lighttpd/fcgi p[latform is awesome and I heartily
recommend it.

Cheers-

-Ezra Z.
WebMaster
Yakima Herald-Republic Newspaper
[email protected]
509-577-7732

Thanks a lot Ezra. I found a nice log rotator called cronolog
(http://cronolog.org) and now logs are rotating, tmp is being cleared
and everything seems to be running great. The switch to SCGI also seems
to have really stabilized memory usage, I was seeing some bleed in FCGI
processes.

ezra wrote:

Brad-

I run a largish site on lighttpd/fcgi on a dedicated server. The
things to keep your eye on are mostly the /tmp/ruby-sess* files and
the lighttpd_access.log. The lighttpd_access.log gets to be around 1
gig in about 5 days if I don’t rotate it. So I have cron jobs to
rotate that log file and also to erase the session files in /tmp that
are older than 12 hours every twelve hours. Now there might be a
difference in how long you need to keep your sessions so adjust
accordingly, but those things pile up quick.

As far as restarting the fcgi’s or lighttpd goes, I don’t have to do
that at all. They run great without problems for months now. The only
time I need to restart the lighty server/fcgi’s is when I push a new
production version of my app to go live. Then I restart just because
I need a restart to get production mode to pick up the new code.
Other than that the lighttpd/fcgi p[latform is awesome and I heartily
recommend it.

Cheers-

-Ezra Z.
WebMaster
Yakima Herald-Republic Newspaper
[email protected]
509-577-7732