Just as we’ve provided a series of tips on how to make your Windows 2008 Server run at its utmost maximum efficiency and speed, Monitis has put together advice on making the Linux OS work miracles for you. Our interest is in making your life easier, whether it’s through informational guides such as these or by continually enhancing our monitoring cloudware with cutting-edge services, for example, new monitoring stations around the world and mobile apps for free server monitoring.
In our first post, we offered Linux Server tips on the OS’ features and security set up. You might want to check it out before reading on. In this post, we’re going to discuss tips to improve performance based on Linux’s Configuration, third-party applications that work with the OS and miscellaneous areas.
Keep in mind – as you read through these tips – that you can apply them to get your Linux server to run like a fox – not waddle like a penguin.
Here are some regular ways to get the best performance out of your Linux Server by making updates in its configuration.
To run enterprise applications smoothly and successfully, such as a database server on Linux distribution, it is required to update some of the default kernel parameter settings. For example, the 2.4.x series kernel message queue parameter “msgmni” has a default value (for example, shared memory, or shmmax is only 33,554,432 bytes on Red Hat Linux by default), and that allows only a limited number of simultaneous connections to a database. Mentioned below are some recommended values (by the IBM DB2 Support Web site) for database servers to run optimally:
Tuning the TCP protocol helps to improve network throughput for connection-hungry applications. Larger TCP Linux sizes are recommended for communications across wide-area networks with large bandwidth and long delay characteristics – in order to improve data transfer rates. The TCP Linux size determines how much data that a sending host can transmit to a receiving host, without receiving an acknowledgment of data transfer.
Use “ext4″ file system in Linux.
Use the ‘noatime’ File System Mount Option
Linux limits the number of file descriptors that any one process may open. The default limits are 1,024 per process. These limits can hinder optimum performance of both benchmarking clients (such as ‘httperf’ and ‘apachebench’) and of the web servers themselves. Apache uses a process per connection — hence is not affected, but single process web servers like Zeus use a file descriptor per connection, and can thus easily get affected by the default limit.
The open file limit is one of the limits that can be tuned with the ‘ulimit’ command. The command ’ulimit-aS’ displays the current limit, and ulimit-aH displays the hard limit (you cannot increase the limit without tuning kernel parameters in /proc).
There are various performance tips which you can apply to third-party tools that work well with Linux. It will help you improve performance of the Linux Server and thus minimizing the cost. Some of the third party application based performance tips follow:
In order to increase the accessible RAM (or allot more RAM to MySQL), set up the MySQL cache sizes. In case MySQL server instance is utilizing more memory, reduce the cache sizes. Increase the MySQL cache if MySQL gets bogged down with large requests.
Check for how much memory Apache is utilizing and accordingly adjust the ‘StartServers’ and ‘MinSpareServers’ directives in order to free up more memory. It will help you save RAM by as much as 30-40%.
Here are some tips for improving monitoring and troubleshooting for Linux Servers:
The best way to improve efficiency of a system is to target bottlenecks that result in limiting overall speed. They usually can be identified by knowing the specifications of the system, but there are some basic indications:
Managing performance on Linux systems is a lot easier with a few commands. Listed below are some of commands including top, vmstat, iostat, free, and sar. They may help in resolving performance issues quickly and easily.
The ‘top’ command shows not only the current tasks being serviced by the kernel but also some broad statistical data about the state of a host. By default, it automatically updates this data every five seconds (this update period is configurable).The top command tells several things, for example: the current uptime, system load, number of processes and memory usage. In addition, the command shows those processes using the most CPU (including a variety of pieces of information about each process such as the running user and the command being executed).
The ‘vmstat’ command gives a snapshot of current CPU, IO, processes and memory usage. Similar to the top command, it dynamically updates and can be executed with this command:
$ vmstat 10
The ‘iostat’ command (provided via the sysstat package on Ubuntu and Red Hat/Fedora) offers three reports. These are CPU utilization, device utilization, and network file system utilization. In case of running the command without options,it will display all three reports. The individual reports can be specified with the -c, -d and -h switches respectively.
The ‘free’ command shows memory statistics for both main memory and swap. A total memory amount can be displayed by specifying the -t switch. The amounts in bytes can also be displayed by specifying the -b switch and megabytes using the -m switch (it displays in kilobytes by default).
Free can also be run continuously using the -s switch with a delay specified in seconds:
$ free -s 5
Use the ‘sar’ command line tool to collect, view and record performance data. This command is considerably more sophisticated than all the commands discussed above. It can collect and display data over longer periods.
Following are some other performance tips that are categorized as miscellaneous.
When a machine is running, it is better to keep system logs in RAM and copy them to disk when the system is shut down. When you’re running a laptop or mobile device with ‘syslog’ enabled, ‘Ramlog’ might help to improve system battery life or the life of the flash drive on a mobile device. One advantage of using ‘Ramlog’ is that you’re less likely to be caught by a daemon that suddenly starts sending a message to ‘syslog’ every 30 seconds and – worse – saps battery by keeping the hard disk spinning.
When there is a fixed chunk of RAM containing the log files, it means that a laptop’s hard disk doesn’t have to spin up regularly if something needs to be logged by an overly verbose daemon. The fixed-size RAM disk ‘Ramlog’ will keep an overly verbose daemon from exhausting all the system RAM. By using a solid-state disk on a laptop with a few gigabytes of RAM, ‘Ramlog’ can save many write cycles by sacrificing 50-80MB of RAM.
We at Monitis hope that you can take some of these tips and improve the performance of your Linux servers. One of the best ways to guarantee your servers give you the utility you require is also to employ 24/7 Linux server monitoring services. Monitis performs internal and external server monitoring from the cloud – which means that, even if you have your firewall down and, heaven forbid, your network fails, we can still notify you of problems with your server.