How Do I Monitor a Server?

How Do I Monitor a Server?

Daily short news for you
  • For a long time, I have been thinking about how to increase brand presence, as well as users for the blog. After much contemplation, it seems the only way is to share on social media or hope they seek it out, until...

    Wearing this shirt means no more worries about traffic jams, the more crowded it gets, the more fun it is because hundreds of eyes are watching 🤓

    (It really works, you know 🤭)

    » Read more
  • A cycle of developing many projects is quite interesting. Summarized in 3 steps: See something complex -> Simplify it -> Add features until it becomes complex again... -> Back to a new loop.

    Why is that? Let me give you 2 examples to illustrate.

    Markdown was created with the aim of producing a plain text format that is "easy to write, easy to read, and easy to convert into something like HTML." At that time, no one had the patience to sit and write while also adding formatting for how the text displayed on the web. Yet now, people are "stuffing" or creating variations based on markdown to add so many new formats that… they can’t even remember all the syntax.

    React is also an example. Since the time of PHP, there has been a desire to create something that clearly separates the user interface from the core logic processing of applications into two distinct parts for better readability and writing. The result is that UI/UX libraries have developed very robustly, providing excellent user interaction, while the application logic resides on a separate server. The duo of Front-end and Back-end emerged from this, with the indispensable REST API waiter. Yet now, React doesn’t look much different from PHP, leading to Vue, Svelte... all converging back to a single point.

    However, the loop is not bad; on the contrary, this loop is more about evolution than "regression." Sometimes, it creates something good from something old, and people rely on that goodness to continue the loop. In other words, it’s about distilling the essence little by little 😁

    » Read more
  • Alongside the official projects, I occasionally see "side" projects aimed at optimizing or improving the language in some aspects. For example, nature-lang/nature is a project focused on enhancing Go, introducing some changes to make using Go more user-friendly.

    Looking back, it resembles JavaScript quite a bit 😆

    » Read more

Issue

Having a website means you need to manage it. One of the essential management skills is to be able to monitor if the website is accessible. This is particularly important because no one wants to use a website that is unstable. Additionally, a highly stable website builds trust and positive user experience.

Server administration can be a challenging task or we may not have enough time to do it. Usually, administrators do not need to be constantly with the server. Instead, they need to know how to detect and resolve pending or ongoing issues. In fact, the components that make up a website are not simply a service. Microarchitecture allows us to break down larger features into independent services. However, this creates difficulties in managing because there are many discrete services that can become problematic at any time. Monitoring is an essential solution to gather information from them.

I am not a professional server administrator, but I have some experience in maintaining a few servers. I hope to share my experience with everyone through this article and also receive more experiences from others!

Why Monitor?

Monitor to ensure the stability of your system. The more stable a software application is, the more it retains users. No one wants to use a system that intermittently fails. Therefore, you always need to know if your system is working as expected or not, and if not, you need to find out quickly to take action.

Monitor to detect runtime errors and potential future issues. Through logging and analysis, we can identify unusual signs in the system, such as high CPU usage or full memory, which have not occurred before.

Monitor to train the ability to handle emergency situations. These are situations where your services or servers are inaccessible. If a system is too stable, it can create another worry, which is the worry that the monitoring system is malfunctioning. Sometimes there will be a simulated session when the system "fails" to test if the monitoring tools are working as expected or not.

Context

In the past, the image of server administrators was associated with a large number of servers and intricate network cables. However, with the development of virtualization and the cloud, everything can be brought to the "cloud", and of course, servers are no exception. A decade ago, to monitor a server, we had to install additional system monitoring software, but now providers actively add many monitoring and system alert tools. Through the administration page, you are provided with information about the server you rent in a visualized manner, such as statistics or charts.

Sometimes, using the integrated monitoring feature of the provider is not enough to meet the needs. You can install many other system monitoring software tools, depending on the needs of each person and system.

In summary, with the help of cloud technology and virtualization, monitoring systems have been simplified to some extent. However, the monitoring methods and approaches can vary depending on the monitoring needs. For me, it's just as simple as ensuring 99.99% uptime for the system. To achieve this, I have been using the following methods.

Server Monitoring Methods

Choose a reliable provider with high reliability

First, you should choose a reputable service provider. To ensure system stability, the foundation must be strong, and in this case, it is the service provider. Choose a provider with experience in operating systems for a sufficient amount of time or is highly regarded by the community. Names like Google Cloud or AWS are well-known, but relatively expensive. However, they offer great reliability, stability, and excellent support. You can also choose smaller providers such as Vultr, DigitalOcean, Linode, Bizfly, etc. I have tried them all and found them to be very stable.

Use Cloud's resource monitoring feature

Resource Monitoring

Take some time to check how your system is using its resources. Is there anything unusual that needs immediate action? You can find the system resource monitoring feature in the server management section. The data is displayed as a timeline, updated in real-time, helping us quickly identify abnormalities.

Use Cloud's alert feature

Cloud Alert

Many service providers offer the feature to send system alerts via email or messaging channels. This is useful for quick notifications to system administrators. These alerts can include information such as high CPU usage or full memory. This setting is very useful for those who are concerned about resource consumption.

Use system monitoring software

These are the system monitoring software tools that I mentioned earlier. Although I have not had many opportunities to use them, their tasks are to monitor system resources and generate alerts. They also provide many other complex features that require experience in operation.

Use service monitoring tools

The previous methods focused on system resources. What about managing internal services at a more detailed level?

My blog is composed of many microservices, and my task is to know which ones are running, which ones are failing, and which ones need immediate attention. There are many tools that can monitor this issue, collectively called Monitors or Application Performance Monitoring (APM) tools. By integrating them into each service, we can monitor them through the log records collected by these tools. They also have real-time alerting capabilities.

uptimerobot.com is a useful tool for me. It monitors the uptime of my website and quickly sends alerts when it is not accessible. The working principle is simple, it tries to access the website every 5 minutes, and if it fails, it promptly sends an email alert. A few times, my website had a 500 error, and thanks to the tool, I knew about it and fixed it immediately after receiving the alert.

Uptime Robot

There are many other tips and tricks as well. For example, in my article Telegram and Real-time Notification Channels, I mentioned using the Telegram messaging app as a notification channel for multiple recipients to know about issues.

Conclusion

Monitoring servers helps maintain the stability of your system. Nowadays, with the help of virtualization and cloud technologies operated by professional teams, server monitoring has become easier. However, we need to apply monitoring methods effectively. I hope that this article helps readers understand a part of server monitoring tasks and that it also provides an opportunity to receive more experiences from others.

Premium
Hello

The secret stack of Blog

As a developer, are you curious about the technology secrets or the technical debts of this blog? All secrets will be revealed in the article below. What are you waiting for, click now!

As a developer, are you curious about the technology secrets or the technical debts of this blog? All secrets will be revealed in the article below. What are you waiting for, click now!

View all

Subscribe to receive new article notifications

or
* The summary newsletter is sent every 1-2 weeks, cancel anytime.

Comments (0)

Leave a comment...