Here’s a few tips for managing your Linux server. Each is designed to help you in one way or another to diagnose issues or simply perform routine tasks.
Check current memory usage
If you need to determine the amount of memory that your server is currently using, use the command free -m. What you’ll see are numbers for total, used, free, shared, buffers and cached.
Let’s say your total shows 3995 megabytes (RAM), used shows 2825, free shows 1170 and cached shows 932. Those 932 megabytes stored in cache will remain there UNLESS the operating system requires that space.
This is where a number of folks get confused as they interpret the result as only 1170 available, when in reality, it’s 1170+932 or 2102. That is the real number of megabytes available to your server, for example when you initiate a new process, or run an application that requires additional memory.
Monitoring I/O usage
Let’s say you need to diagnose I/O related issues to determine status related to swap utilization, system activity, I/O wait and memory. Try using vmstat.
This is similar to the free -m command, but the column to look for here is wa, which shows the amount of time that the processor waits for I/O actions to complete.
When should you opt to initiate measures to address IO usage based on results here? It’s when that number very often reads much higher than 0. Intermittent issues are a little harder to diagnose as you’ll need to run this while the issue is ongoing.
Uploading files to a remote server
Try using scp to transfer files securely to your server. On your local computer, this is an example of what that command sequence would look like:
scp ecommerce-info.tar.gz email@example.com:/home/username/backups
As you can see, scp needs to know the path of the file on your local file system that you want to be transferred.
If you need to copy files the other direction, then simply reverse the order of the two paths.
Searching package databases
Every now and then, a package name is not exactly intuitive, so one way to overcome this could be to use a yum search. For CentOS, simply use yum search [package name].
Sometimes the name of a package isn’t intuitive, based on the name of the software. As a result, most package management tools make provide an option to search the package database. These search tools may be helpful if you’re looking for a specific piece of software but don’t know what it’s called.
You can also discover additional in-depth information concerning the searched package, specifically its origins, dependencies and purpose – by using the commend yum info [package-name].
Using grep to search for a string in files
Perhaps you need to search for a stream of text, for example, the output of a command or some type of pattern. The grep tool allows you to search a stream of text, such as a file or the output of a command, for a term or regex pattern.
It also features addition options like -n which outputs the line number, or -H which prints the file name for each match.
BROUGHT TO YOU BY PROLIMEHOST
We’ve been in the web hosting industry for over a decade, helping hundreds of clients succeed in what they do best and that’s running their business. We specialize in Virtual Private Servers (VPS) and dedicated servers, with data centers in Los Angeles, Denver & Singapore.
VPS SERVICES: LIGHTNING FAST SSD VIRTUAL SERVERS
Our Virtual Private Servers all feature high performance Xeon processors and SSD storage in a RAID10 configuration to optimize your server’s performance, which dramatically enhances visitor experiences on your site.
That speed is backed by unparalleled 24/7 support, featuring both outstanding response AND resolution times to maximize your uptime.
Now is the time to join the ProlimeHost virtual private server revolution.
DEDICATED SERVERS: BACKED BY A 99.9% SLA NETWORK UPTIME GUARANTEE
We only use enterprise-class hardware in our dedicated servers and offer a four (4) hour hardware replacement. Throw in IPMI for remote management, support for public and private networks, free operating system (OS) re-installs, and SATA, SAS & SSD (including NVMe) storage. For everything from gaming servers to cheap dedicated servers, we’re here to help.
ASIA OPTIMIZED SERVERS: IMPROVING CONNECTION SPEED AND QUALITY
Procuring an Asia optimized server improves the connection speed and quality between the server and the users in Asia or China. This can reduce latency, packet loss, jitter, and bandwidth issues that can affect the performance and reliability of the server and the applications hosted on it. For more information, please call 1-877-477-9454 or contact us.