LINUX traffic monitor

There are many points and kinds of statistics one may want to monitor on a server (Or a desktop PC), the following are a sample of the things people commonly need

1- By Domain name, when you host people’s websites, you need to monitor there traffic, both Email and web, it may be worth mentioning that the only way this can be done is through log filres, he reason behind that is that HTTP and Email requests are pointed at IP addresses and Hostname (Domain name) is only available as data within the stream, something only parsed by the web server and the MTA (Mail transfer agent). Some software to analyze Log files exists and can give you the answers to Domain based network traffic.

2- By PORT, Ethernet card, and IP, For such uses i recomment IPTRAF for live monitoring, and ….

3- By Virtual machine in environments such as XEN, in that case you can use the ifconfig command to see every virtual adapter’s traffic usage.

I will come to this post with more soon.

NOTE, for windows network captures (packet sniffers), i have always used a windows utility called wireshark (previously etherial), Microsoft released a very similar utility called Microsoft Network Monitor 3.4 that is compatible with Windows XP and above, When i simply want a graph of usage, i have once used a utility that does the trick called bwmonitor that is for $25, but it does provide you with a 30 day testing period (There is certainly a different application that can do the job and most probably a free one too, i just used this because it was the first i found)

MySQL Windows VS MySQL on Linux

Comming across Robin Schumacher’s “MySQL on Windows? Absolutely!” i have some stuff to say

First, I absolutly LOVE windows on my Desktop, and i LOVE Linux on my servers, and i have nothing against windows servers or Linux Desktops, i like Operating systems that get the Job done faster and with least effort, so what suits a job suits me, having never used a mac, i would jump to a mac if they tell me it can help you develop application X faster, why not, but the article here http://dev.mysql.com/tech-resources/articles/mysql_on_windows.html does not seem to make sense to me. Here is why

In the comparison of number of downloads, it clearly reads that windows has 600K downloads VS linux that has 200K downloads, but are you serious ?

On Linux, MySQL is hardly if ever downloaded from mysql.com , while on Windows it is always downloaded from MySQL.COM and therefore i beg an explanation on why you say this statistic tells anything, Also, most developers are like me, they use the Windows edition for development on there development PCs, and then deploy the actual application on a Linux server.

For example, on a debian system i would simply issue

apt-get install mysql-client mysql-server

this will get MySQL binaries from Debian, not from MySQL, and therefore making the statistic not available to you.

Then the article talks about how insignificant the differences between the Linux and Windows edition is, to tell you the truth, this is not the case at least for me, here are SOME examples

Most of my applications can not make good use of RAID because RAID does not help with disk seek time (And therefore latency), My answer to this is usually separating tables to more than 1 hard disk , and although having databases moved to other hard drives is supported in windows by creating a text file, moving individual tables on windows is not, On linux, i simply create a symbolic link to the MYD file, and one to the MYI file, i can even split a single table to 2 hard drives with the indexes on 1 drive and the actual data on the other.

Clustering anyone ??

For a longer list check out http://dev.mysql.com/doc/refman/5.0/en/windows-vs-unix.html , this is certainly is inferior to the Linux counterpart for something like a shared hosting environment (See number of open files and connection timeouts etc..)

Now to add more to that, Linux is a free OS, you install and upgrade it for free, and MySQL is also free, if your business uses many many MySQL servers, your savings on Windows Server licenses can be significant.

The bottom line is, when a company like Oracle (Since it has acquired SUN) gets hold of an open source database engine, you can rest assured objectivity will still be there only when it supports the paying product.

Thanks for listening.

Multi Disk MySQL

For performance reasons, separating DBs to Multiple hard disks can be beneficial

In Linux, when you want to include a directory for a database, you add a symbolic link ( Using the ln -s targetdir command), in Windows, there are no symbolic links, and Windows Shortcuts ( Via right click create shortcut ) don’t work

The truth is, MySQL enables Symbolic Links in Windows by default, but you have to do it the MySQL way

MySQL is a file based database engine, you should be able to see a folder for every database run by your database engine, Now to move one of those DBs to a different directory or hard drive, you just copy it to the new destination and create a file db_name.sym then, within that plain text file, you can add D:datadb_name where D:datadb_name is the folder containing the MySQL files.

You should be good to go if you have moved the directory of the database to d:data, but if you copied it, the copy in the original MySQL data directory will be used

You are done, Now you should experience the extra performance of combining disks, the closest it gets without RAID and a reformat, surely this is assuming the DBs are used evenly

But there are other reasons why you may want to do this, one of which is, when you want to compile all user data in a directory, So DBs that person creates using your server management software puts all that person’s software in one place so that when he or she requests a backup, you know what to send him/her

Enjoy