Articles tagged network

Network delay caused by pix firewall
Dorren_mii_thumb by dorren, 10/15/2007
For past few days, access time to the site becomes quite unpredictable. Half of the time page loads right away, but other half of the time it would take 5-10 seconds. DNS resolves domain names right away, but hangs while connecting to the server.

when I do "wget groups.wuyasea.com" from home, process hangs. But if i ssh to the server and do wget, there's no delays, so I'm totally clueless what's causing it. After diligent work done by my hosting company's staff, they tracked down the Cisco pix was the root of the problem. Reboot the pix, and no more delay!

The pix has been running for more than a year, so I guess it's time for a fresh restart.
Views: 1458   Replies: 0   Tags: network
How to setup Ganglia to monitor server stats
Dorren_mii_thumb by dorren, 09/10/2007

Background

If you don't know what Ganglia is, then take a look at wikimedia's farm. That's what ganglia does, monitor server's CPU usage, memory, processes count, disk space, bandwidth, etc.

For server monitoring, I initially was going to use cacti, but then I discovered Ganglia, a much better solution.

Here are a few thing I found when comparing cacti and ganglia,
  • Installation cacti's installation steps are quite involved, it requires the use of mysql, while ganglia is completely standalone without additional dependency.
  • Data Collection Cacti collects data by cron schedule a php script, while ganglia has persistent daemon process running, which is much more resource friendly.
  • Configuration After installed, Cacti provides very few data values. Ganglia runs right out of the box, and provide all server hardware indicators by default.
  • User Interface Cacti's interface is too complicated and hard to navigate. Ganglia's interface is quite bare, but works.
  • Extensibility Both allow you to add additional paramter to monitor. But ganglia was created for super computer cluster, so it'll be easier to link and monitor your growing server farm all from one place in the future.

Due to reasons above, I chosed ganglia for server monitoring.


1. Install Ganglia

This installation step is for gentoo linux, if you use other linux OS, please follow instruction on ganglia's site, then proceed to configuration steps.

Add "sys-cluster/ganglia" to /etc/portage/package.keywords, then emerge.
emerge gangliaThen generate default configuration
cd /etc gmond --default_config > gmond.conf

To monitor just one server, here's the configuration.

edit /etc/gmond.conf,
  • change cluster name to "cluster1", "ny_cluster", or other meaningful names.
  • change mcast_join to "localhost", which will display your host name in web interface.
    if you don't want to display host name on the web, then set mcast_join to something like "server1", where "server1" entry must exist in your /etc/hosts file. like "1.2.3.4 server1.mysite.com server1"

Here's the the diff of /etc/gmond.conf
cluster { name = "unspecifiedcluster1" owner = "unspecified" latlong = "unspecified" url = "unspecified" } /* The host section describes attributes of the host, like the location */ host { location = "unspecifiedlocalhost" } /* Feel free to specify as many udp_send_channels as you like. Gmond used to only support having a single channel */ udp_send_channel { mcast_join = 239.2.11.71localhost /* or server1 */ port = 8649 } /* You can specify as many udp_recv_channels as you like as well. */ udp_recv_channel { mcast_join = 239.2.11.71 port = 8649 bind = 239.2.11.71 family = inet4 /* add this line */ }
for multiple server setup, please see the IBM link at the bottom reference section.

2. Install web interface

since ganglia only offers front-end in rpm package, and gentoo and rpm don't mix, so we have to get the php front end from source directly.

cd /var/www svn export http://ganglia.svn.sourceforge.net/svnroot/ganglia/trunk/monitor-core/web/ ganglia_web # SVN msg: Exported revision 820. chown -R nginx:nginx ganglia_web

Manually create the required version.php file. If anyone knows how to generate it dynamically, please let me know.
cd ganglia_web cp version.php.in version.php

edit version.php's content to below
<?php # This file is autogenerated $majorversion = "3"; $minorversion = "0"; $microversion = "3";; $ganglia_version = "3.0.3"; $ganglia_release_name = "GANGLIA_303"; ?>

3. Setup Webserver and fastcgi

Now last step, create nginx vhost for it. Edit /etc/nginx/nginx.conf
server { listen 80; server_name monitor.mysite.com; location / { fastcgi_pass 127.0.0.1:1026; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/ganglia$fastcgi_script_name; include /etc/nginx/fastcgi_params; } }
To run php fastcgi processes, I used spawn-fcgi , which comes with lighttpd, and runs on port 1026 by default. You can edit /etc/conf.d/spawn-fcgi to tweak the settings.

reload the nginx webserver.
/etc/init.d/nginx reload
now view http://monitor.mysite.com, and you shall see the stats.

Finally, to add nginx and spawnfcgi to the init sequence.
rc-update -a nginx default rc-update -a spawn-fcgi default

Reference

http://www-941.ibm.com/collaboration/wiki/display/WikiPtype/ganglia
http://www.ganglia.info/docs/ganglia.html
Views: 2078   Replies: 0   Tags: network
 




login or sign up to participate.
Money_dollar moneywill