Tampilkan postingan dengan label Unix. Tampilkan semua postingan
Tampilkan postingan dengan label Unix. Tampilkan semua postingan

Kamis, 16 Januari 2014

Linux vs Windows Web Server Hosting: Which one to choose and why?

Linux vs Windows Web Server Hosting: Which one to choose and why?

Linux vs Windows Web Server Hosting: Which one to choose and why?

When you think of hosting your website, the first question strikes in your mind is that which web server hosting should you choose? Should you go for Linux web server hosting or Windows web server hosting. I have tried to compare both Linux and Windows web server hosting. Choosing between Linux and Windows web server hosting mainly depends upon your need and the nature of your website, which programming language and database are you using etc. Let's discuss in detail on choosing between Linux and Windows web server hosting.

1. Which programming language are you using?

You should choose a Linux Web Server Hosting if you are using PHP, Perl, Python, or CGI scripting. On the other hand, if you are using ASP.NET, go for Windows Web Server Hosting.

2. Which database are you using?

Mainly, the Linux Web Server Hosting accounts use MySQL database and Windows Web Server Hosting accounts use SQL Server (MS SQL). 

Advantages of Linux Web Server Hosting over Windows Web Server Hosting

The following are the advantages of using Linux based web server compared to Windows based web server:

Stable: Linux/Unix operating systems have traditionally been believed to be very stable and robust. A web site housed on a Linux operating system will have very high up-time (of the order of 99.9%). Of course, other factors such as power supply, network admin skills, and network load etc. also matter when it comes to maintaining the system uptime.

Low cost: The Linux OS comes free of cost (or at very insignificant cost, usually cost of distribution). Also, it has full fledged server, and desk top applications that comes free along with the OS. These server applications (such as FTP, Web Server, DNS Server, File Server etc.) being free, are also very stable.

Ease of use: When it comes to web hosting, it is easy to host on Linux web servers. The process of uploading and hosting is almost same for both Linux and Windows web servers. 

Easy to move between hosts: A web site designed to be hosted on a Linux based web server can be hosted on a Windows web server easily, where as the reverse is not always true.

Most widely used: Linux/Unix based web hosting is most widely used compared to Windows based web hosting.

Scalability: A web site is dynamic. Usually, a web site starts with a few pages of html and grows over a period of time to suit the customers requirements. It is preferable to design a web site keeping this requirements in mind. A web site designed for compatibility with a Linux/Unix based web server meets the scalability requirement easily without making any site wide design changes.

Disadvantage of Linux Web Server Hosting 

Less ASP and .NET support: Linux based web server is not fully compatible with Microsoft technologies. While there are many software that enable ASP.NET on Linux machines, it is far less common to find a Linux web hosting platform that supports ASP or .NET. If you are using Microsoft based technologies for your web site, it is preferable to host with a Windows based web server. 

Selasa, 08 Oktober 2013

Linux Server Monitoring and Networking Commands for Linux Server Administrators - Part 2

Linux Server Monitoring and Networking Commands for Linux Server Administrators - Part 2

Linux Server Monitoring and Networking Commands for Linux Server Administrators - Part 2

I have complied a list Linux server monitoring and networking commands for Linux server administrators. These are the very basic monitoring and networking commands which each Linux server administrator should know. I had also compiled a list of basic Linux Networking and Monitoring commands in my previous article. I will talk about iostat, meminfo, free, mpstat, netstat, nmon, pmap, ps, pstree, sar, strace, tcpdump, top, uptime, vmstat, wireshark Linux server monitoring and networking commands for Linux server administrators. These networking and monitoring Linux server commands helps Linux server administrators to identify input/output problems on your Linux server, memory management of Linux server, performance of Linux server, CPU usage, socket usage, routing, interface, protocol, network statistics and lot more.

1. iostat

The iostat command shows in detail what your storage subsystem is up to. You usually use iostat to monitor how well your storage sub-systems are working in general and to spot slow input/output problems before your clients notice that the server is running slowly. 

2. meminfo and free

Meminfo gives you a detailed list of what's going on in memory. Typically you access meminfo's data by using another program such as cat or grep. For example,

cat /proc/meminfo

gives you the details of what's going on in your server’s memory at any given moment.

For a quick “just the facts” look at memory, you can use the free command. In short, free gives you the overview; meminfo gives you the details.

3. mpstat

The mpstat command reports on the activities of each of the available CPUs on a multi-processor server. These days, thanks to multi-core processors, that’s almost all servers. mpstat also reports on the average activities of all your server's CPUs. It enables you to display overall CPU statistics per system or per processor. This overview can alert you to possible application problems before they get to the point of annoying users.

4. netstat

Netstat, like ps, is a Linux tool that administrators use every day. It displays a lot of network related information, such as socket usage, routing, interface, protocol, network statistics, and more. Some of the most commonly used options are:

-a Show all socket information
-r Show routing information
-i Show network interface statistics
-s Show network protocol statistics

5. nmon

Nmon, short for Nigel's Monitor, is a popular open-source tool to monitor Linux systems performance. Nmon watches the performance information for several subsystems, such as processor utilization, memory utilization, run queue information, disk I/O statistics, network I/O statistics, paging activity, and process metrics. You can then view nmon's real-time system measurements via its curses “graphical” interface.

To run nmon, you start the tool from the shell. Once up, you select the subsystems to monitor by typing in its one-key commands. For example, to get CPU, memory, and disk statistics, you type c, m, and d. You can also use nmon with the -f flag to save performance statistics to a CSV file for later analysis.

For day to day server monitoring I find nmon to be the single most useful program in my Linux system management tool-kit.

6. pmap

The pmap command reports the amount of memory that your server's processes are using. You can use this tool to determine which processes on the server are being allocated memory and whether any of these processes are being piggy with RAM.

7. ps and pstree

The ps and pstree commands are two of the Linux administrator’s best friends. They both provide a list of all currently running processes. Ps tells you how much memory and processor time the server’s programs are using. Pstree shows less information, but highlights which processes are the children of other processes. Armed with this information, you can spot out–of-control processes and kill them off with Linux's “take no prisoners” kill command.

8. sar

The sar program is a Swiss-army knife of a system monitoring tool. The sar command is actually made up of three programs: sar, which displays the data, and sa1 and sa2, which collect and store it. Once installed, sar creates a detailed overview of CPU utilization, memory paging, network I/O and transfer statistics, process creation activity, and storage device activity. The big difference between sar and nmon is that the former is better at long-term system monitoring, while I find nmon to be better at giving me a quick read on my server's status.

9. strace

strace is often thought of a programmer's debugging tool, but it's more than that. It intercepts and records the system calls that are called by a process. This makes it a useful diagnostic, instructional, and debugging tool. For example, you can use strace to find out which configuration file a program is actually using when it starts up.

Strace does have one flaw though. When it's checking out a specific process, that process' performance will fall through the floor. Thus, I only use strace when I already have a darned good reason to think that that program is causing trouble.

10. tcpdump

Tcpdump is a simple, robust network monitoring utility. Its basic protocol analyzing capability enables you to get a rough view of what is happening on your network. To really dig into what's going on with your network however, you'll want to use Wireshark.

11. top

The top command shows what's going on with your active processes. By default, it displays the most CPU-intensive tasks running on the server and updates the list every five seconds. You can sort the processes by PID (Process ID); age, newest first; time, by cumulative time; and resident memory usage and total time it's been using the CPU since startup. I find this a fast and easy way to see if any process is starting to go out of control and about to get into trouble.

12. uptime

Use uptime to see how long the server has been running and how many users are logged on. It also gives you an overview of the average server load. The optimal value of the load is 1 or less, which means that each process has immediate access to the CPU and there are no CPU cycles lost.

14. vmstat

For the most part, you use vmstat to monitor what's going on with virtual memory. Linux constantly uses virtual memory to get the best possible storage performance.

If your applications are taking up too much memory you get excessive page-outs — programs moving from RAM to your system's swap space, which is on the hard drive. Your server can reach a point where it's spending more time managing memory paging than running your applications, a condition called thrashing. When your computer is thrashing, its performance falls through the floor. 

Vmstat, which can display either average data or actual samples, can help you spot memory pig programs and processes before they bring your server to a crawl.

15. Wireshark

Wireshark, formerly known as Ethereal (and still often referred to that way), is tcpdump's big brother, though it is more sophisticated and with far more advanced protocol analyzing and reporting. Wireshark has both a GUI interface and a shell interface. 

If you can master these commands, you'll be well on your way to being a good Linux system administrator.
10 Basic Linux Networking and Monitoring Commands You Should Know

10 Basic Linux Networking and Monitoring Commands You Should Know

10 Basic Linux Networking and Monitoring Commands You Should Know

I have listed down 10 basic Linux networking and monitoring commands which each Linux user should know. These Linux basic networking and monitoring commands like hostname, ping, ifconfig, iwconfig, netstat, nslookup, traceroute, finger, telnet, ethtool are used for viewing the IP address of the Linux server, managing Linux server network adapter configuration, making network connections among Linux servers over telnet and ethernet, Linux server information etc. Lets have a look on the following Linux networking and monitoring commands.

1. hostname

hostname with no options displays the machines host name

hostname –d displays the domain name the machine belongs to
hostname –f displays the fully qualified host and domain name
hostname –i displays the IP address for the current machine

2. ping

ping sends packets of information to the user-defined source. If the packets are received, the destination device sends packets back. ping can be used for two purposes

1. To ensure that a network connection can be established.
2. Timing information as to the speed of the connection.

If you do ping www.yahoo.com it will display its IP address. Use ctrl+C to stop the test. 

3. ifconfig

View network configuration, it displays the current network adapter configuration. It is handy to determine if you are getting transmit (TX) or receive (RX) errors.

4. iwconfig

The iwconfig tool is like ifconfig and ethtool for wireless cards. You can view and set the basic Wi-Fi network details, such as the SSID, channel, and encryption. There's also many advanced settings you can view and change, including receive sensitivity, RTS/CTS, fragmentation, and retries.

5. nslookup

If you know the IP address it will display hostname. To find all the IP addresses for a given domain name, the command nslookup is used. You must have a connection to the internet for this utility to be useful.

e.g. nslookup blogger.com

You can also use nslookup to convert hostname to IP Address and from IP Address from hostname.

6. traceroute

A handy utility to view the number of hops and response time to get to a remote system or web site is traceroute. Again you need an internet connection to make use of this tool.

7. finger

View user information, displays a user’s login name, real name, terminal name and write status. this is pretty old unix command and rarely used now days.

8. telnet

Connects destination host via telnet protocol, if telnet connection establish on any port means connectivity between two hosts is working fine.

telnet hostname port - will telnet hostname with the port specified. Normally it is used to see whether host is alive and network connection is fine or not.

9. ethtool

Ethtool lets you view and change many different settings for ethernet adapters (which does not include Wi-Fi cards). You can manage many different advanced settings, including tx/rx, checksumming, and wake-on-LAN settings. However, here are more basic commands you might be interested in:

Display the driver information for a specific network adapter, great when checking for software compatibility.

ethtool -i

Initiate an adapter-specific action, usually blinking the LED lights on the adapter, to help you identify between multiple adapters or interface names:

ethtool -p

Display network statistics:

ethtool -s

Set the connection speed of the adapter in Mbps:

ethtool speed <10|100|1000>

10. netstat

Most useful and very versatile Linux command for finding connection to and from the host. You can find out all the multicast groups (network) subscribed by this host by issuing "netstat -g"

netstat -nap | grep port will display process id of application which is using that port
netstat -a  or netstat –all will display all connections including TCP  and UDP  
netstat --tcp  or netstat –t will display only TCP  connection
netstat --udp or netstat –u will display only UDP  connection
netstat -g will display all multicast network subscribed by this host.