You can monitor your servers nicely graphs using iStat for iphone.
these are instructions for Gentoo:
1 2 3 4 5 6 7 8 9 | wget http://github.com/downloads/tiwilliam/istatd/istatd-0.5.7.tar.gz tar xpf istatd-0.5.7.tar.gz cd istatd-0.5.7 ./configure make make install useradd istat mkdir -p /var/{run,cache}/istat /home/istat chown istat.istat /var/{run,cache}/istat /home/istat |
Create and edit /etc/istat.conf to match your server specs.
This config is for my OpenVZ vps.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # # /etc/istat.conf: Configuration for iStat server # # IP Address to listen network_addr 77.88.xx.xx # choose any port, Default is 5109 network_port 55666 # this is password, 5 digits server_code 12345 server_user istat server_socket /var/run/istat/istat.sock server_pid /var/run/istat/istat.pid cache_dir /var/cache/istat monitor_net venet0 monitor_disk ( /dev/simfs ) |
Start istatd server:
1 | sudo -u istat istatd -d -c /etc/istat.conf |
you might add it to /etc/conf.d/local.start to auload on startup
Then download iStat for iphone http://bjango.com/apps/istat/ it’s only $0.99
and add your server to the list.
Here are some screenshots, first is server and second image is my macbook discovered with bonjour.
To install the great Mod_Rails on Gentoo linux it’s as easy as 5 steps.
Since you are Gentoo user, i don’t need to go to details. You know what you doing.
Update: Mod-rails now works with apache mpm-worker
1. Recompile Apache non-threaded
add this to /etc/portage/package.use
www-servers/apache -threads
and this to /etc/make.conf
APACHE2_MPMS="prefork"
2. Re emerge apache
# emerge -va apache
3. Passenger is in gentoo portage, but its in testing. Currently Version 2.0.1
# echo "www-apache/passenger" >> /etc/portage/package.keywords
4. Install Passenger
# emerge -va passenger
If it tries to install rails 2.2.2, rake, and lots of other gems that you already have installed trough rubygems, then run emerge with –nodeps option
# emerge -va --nodeps passenger
5. Edit /etc/conf.d/apache and add “-D PASSENGER” to apache options
for example mine looks like this:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D PROXY -D PASSENGER"
That’s it.
Now just drop a similar vhost config file inside /etc/apache/vhosts.d/
This is a sample vhost file for a rails app.
<VirtualHost *:80>
ServerName mydomain.com
DocumentRoot /myapp/public
Include /etc/apache2/vhosts.d/deflate.conf
RailsBaseURI /
# The maximum number of Ruby on Rails application instances that may be simultaneously active.
# A larger number results in higher memory usage, but improved ability to handle concurrent HTTP clients.
# normally 1 to 10. (1 for each 50mb ram)
RailsMaxPoolSize 1
# The maximum number of seconds that a Ruby on Rails application instance may be idle.
# That is, if an application instance hasn't done anything after the given number of seconds,
# then it will be shutdown in order to conserve memory. ( 1 hour)
RailsPoolIdleTime 3600
RailsEnv 'production'
<Directory /myapp/public>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
My sample deflate.conf,
used to gzip the content
<Location />
SetOutputFilter DEFLATE
#
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
#
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
#
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
CustomLog /var/log/apache2/deflate_log deflate
* Update on July 10, 2008.
- Now using gentoo portage to install it. it’s more smooth.
Note:
Personally I found that Thin + nginx uses less memory(Nginx 4MB + each thin server) than
apache + passenger, which uses quite more. (Apache: 50MB + each rails spawner)


