Skip to main content

4 posts tagged with "disks"

View All Tags

HDD, SSD, or NVMe: how to choose a storage type when renting a server

· 2 min read
Customer Care Engineer

hdd-vs-ssd-vs-nvme-storage-options-for-your-server

When renting a server, the choice of storage system directly affects the performance of your projects, storage reliability, and rental cost. It is important to understand the difference between HDD, SSD and NVMe to make the best choice for your needs.

HDD: durability and stability

Hard disk drives (HDD) are traditional storage devices that have served data centers for years, storing large volumes of data. They aren’t as fast as SSDs, but they provide long service life under moderate load.

HDD typically have a lifespan of around 20,000–25,000 hours. In practice, many HDD in data centers operate for about 3–5 years, depending on usage intensity.

HDD are highly sensitive to power outages because they use moving parts (e.g., read/write heads), which can lead to data damage. In the event of an abrupt shutdown, the risk of data loss is higher compared to SSD.

Advantages of HDD:

  • Durability: They operate for a long time under moderate load.
  • Cost: Cheaper than SSDs and NVMe, especially when calculated per TB of data.
  • Large storage capacity: Ideal for storing huge volumes of data at lower access speeds.

SSD: faster, but with limited lifespan

Solid-state drives (SSD) are fast and reliable devices for servers where speed is critical. However, SSD have a more limited write cycle lifespan. For SATA SSD, the endurance is about 300–500 full write cycles, which, under moderate usage, could theoretically last up to five years. Yet, if your workloads involve a lot of write operations—common for many websites—the lifetime of SSD can be significantly reduced.

SSD are more resistant to sudden power loss because they have no moving parts. However, intensive writes can quickly consume the drive’s write endurance, particularly in cheaper models.

Advantages of SSD:

  • High speed: Excellent for servers where performance is crucial.
  • Resistance to power outages: More resilient to hardware damage during abrupt shutdowns.

NVMe: maximum speed, but shorter lifespan

NVMe (Non-Volatile Memory Express) диски drives are a modern alternative to SATA SSDs, offering even higher performance. They provide significantly faster read and write speeds, which is ideal for servers handling large amounts of data or performing computationally intensive tasks.

However, NVMe drives tend to have a shorter lifespan than SATA SSDs. Due to their high write speeds, these drives can wear out faster under constant load.

Like SSD, NVMe drives are less prone to damage during abrupt shutdowns. However, they are still not as long-lasting as HDD due to the intense operational loads.

Advantages of NVMe:

  • Maximum speed: Ideal for servers that process large data volumes. 
  • High performance: Suitable for tasks with heavy workloads.

Which storage type should you choose?

  • If durability and cost matter more to you, and you don’t plan on heavy write operations, HDD is a great choice. It’s cheaper and will provide stable operation for years.
  • If you need fast data processing under moderate load, go for an SSD. It offers good speed and wears out less quickly compared to NVMe.
  • NVMe is suitable for servers with extremely high speed requirements, but keep in mind its shorter lifespan and higher price. 

Your choice of storage depends on your specific tasks: if longevity and affordability are the priority, choose HDD. If you need high performance, SSD or NVMe will be the optimal solution.

Additionally, we offer servers tailored to your needs and budget, providing the perfect fit for any requirement.

How to set up logrotate for automatic log archiving and saving server space

· 2 min read
Customer Care Engineer

Log management is a crucial part of any server administrator's job. Logs that are not rotated can quickly occupy all available disk space, slow down the server, and cause unpredictable errors. In this article, we’ll explain how to configure and use logrotate for automatic log cleanup and rotation on a server. 


What is logrotate and why is it important to use?

Logrotate is a tool designed for automatic log management. It helps to:

  • Clear old logs — automatically deletes or archives old log files.
  • Save disk space — compresses and removes unnecessary logs.

Log rotation prevents logs from accumulating and causing disk overflow, which could result in crashes and data loss. Logrotate automatically archives old logs and makes room for new data.


How does logrotate work?

When logrotate is active, it automatically performs the following steps:

  1. Log rotation — old logs are renamed and stored, while new files are created in their place.
  2. Compression — old logs can be compressed into .gz format to save space.
  3. Deletion — outdated logs can be deleted if they are no longer needed.

Example: A log file named access.log can be transformed into access.log.1, then compressed into access.log.1.gz, and eventually deleted after a specified retention period.


How to configure logrotate

1. Installing logrotate

On most Linux systems, logrotate is pre-installed. To check if logrotate is installed, run the command:

sudo logrotate --version

 If logrotate is not installed, it can be installed via a package manager. 

  • For Debian/Ubuntu:
sudo apt update && sudo apt install logrotate
  • For CentOS/RockyLinux/AlmaLinux:
sudo yum install logrotate

2. Configuring logrotate

Logrotate configuration is usually stored in /etc/logrotate.conf. This file contains general parameters for all logs on the server. To configure the rotation of individual logs, you can create separate configuration files for different services in the /etc/logrotate.d/ directory.

Example of a standard Nginx configuration:

/var/log/nginx/*.log {
daily          # Logs are rotated daily
missingok      # Do not display an error if the log is missing
rotate 7       # Keep 7 archived files
compress       # Compress old logs
delaycompress  # Delay compression until the next rotation
notifempty     # Do not rotate empty files
create 0640 www-data adm  # Create new logs with specific permissions
}

3. Key configuration parameters

  • daily/weekly/monthly — defines how often the log file will be rotated (daily, weekly, or monthly).
  • rotate [N] — specifies the number of archived logs to retain.
  • compress — enables log file compression (typically into .gz).
  • missingok — prevents errors if a log file is missing.
  • notifempty — skips rotation for empty files.
  • create — creates new logs with specified permissions.

4. Running logrotate

Logrotate usually runs automatically via cron. However, you can run it manually if you need to check the configuration or perform a rotation immediately:

sudo logrotate -f /etc/logrotate.conf

5. Verifying logrotate's operation

To ensure that logrotate is working correctly, you can check the latest entries in its service log:

sudo journalctl -u logrotate -n 10

Logs are taking up too much space on your server. How to fix it?

· 2 min read
Customer Care Engineer
info

Most log files are stored in the /var/log directory, but they are not limited to it. The principles described in this section apply to all *.log files in any directory on your server.

Logs are files that store information about server events: application and operating system activity, various errors, user requests to websites, and more. Over time, logs can take up a significant amount of disk space, especially under heavy load or if there are software errors.

One critical aspect of log files is that, in most cases, deleting them can cause issues for the program generating them — whether it’s a web server or even the operating system itself.

Additionally, logs often contain valuable diagnostic information that can help identify software issues on your server and prevent larger problems. Therefore, it’s important to handle them properly and carefully.


How to identify logs that can be cleaned

Use ncdu to locate large logs on the server. If a log file is unusually large, check its latest entries:

sudo tail /path/to/log

If there are no anomalies, check the beginning of the file to determine whether the log grew large simply due to age (pay attention to the date of the earliest entries):

sudo head /path/to/log

After this, you can proceed with cleaning the file.

info

If you’re unsure why the log file has grown so large, it’s better to save it and contact your hosting provider’s support team for clarification.


How to safely clean logs

The truncate command clears the contents of a file without deleting it:

sudo truncate -s 0 /var/log/nginx/error.log

Separately note the files that are logs, despite the lack of *.log extension:

  • /var/log/btmp
  • /var/log/syslog
  • /var/log/messeges
  • /var/log/secure
  • /var/log/maillog

These files can also be safely cleaned using the truncate command.

A special case is the log located in the /var/log/journal directory. You can find more details about working with it in separate article.   


How to prevent logs from growing too large

While analyzing logs, you may notice some of them have names like:

  • syslog.1
  • yoursite.access.log.1

These appear when log rotation is applied, for example, using the logrotate program. Old files can be deleted or compressed during rotation, saving disk space.

You can read more about configuring this mechanism in a separate article.

How to find and delete files that are "eating up" space on the server

· 2 min read
Customer Care Engineer

Running out of space on your server? This may cause the site and database to malfunction. To free up space, you need to identify the files taking up the most room and delete them. In this article, we’ll explain how to easily accomplish this using the ncdu utility and how to safely clean up logs.


Step 1: Installing and running ncdu

ncdu  is a handy tool for disk space analysis. It displays all folders and files sorted by size in an easy-to-use text interface.

To use this program, you’ll need to connect to your server via SSH.  

Installation

  • Debian/Ubuntu:
sudo apt update && sudo apt install ncdu
  • CentOS/AlmaLinux/Rocky Linux:
sudo yum install ncdu

Running disk analysis

  • To scan the root directory /, execute:
sudo ncdu -x /

The -x option in ncdu restricts the scan to a single file system, excluding mounted virtual directories (e.g., /proc, /dev, /sys) and any other volumes mounted via separate mount points (e.g., network or external drives).

  • To analyze a specific directory:
sudo ncdu /path/to/directory

For example, to scan only the logs directory, run:

sudo ncdu /var/log

Step 2: Analyzing and deleting unnecessary files

After running ncdu, you will see a list of files and folders sorted by size. Navigation is simple:

  • Up/Down arrow keys — move through the list.
  • Enter — navigate into a directory.
  • D — delete the selected file or folder.

ncdu-how-to-find-large-files

danger

Be careful when deleting system files. Delete only those files that you are sure of.

When files are deleted in Linux, they are permanently removed! Recovery is only possible through backups, and only if available.

It is safer to create a list of files and directories taking up significant space (highlight rows in ncdu and copy them to a notepad on your local PC), then review each individually and delete them using the command line.

To delete a file, run:

sudo rm -f /path/to/file

To delete a directory:

sudo rm -rf /path/to/directory

  Here's a list of the major directories that tend to take up a lot of space:

  1. /var/www/ - directory with your sites

Often, the largest directories are upload and cache in the root directory of the website, containing user-uploaded files and the site cache, respectively. For example:

/var/www/user/data/www/yoursite.com/upload/

Files in these directories are relatively safe to delete. However, only you, as the administrator of your website, know which files in the upload directory are important and which are no longer needed. It is recommended to leave the directory itself intact to avoid errors. 

  1. /var/lib/mysql/

This is the directory containing your website databases. 

danger

Please do not delete anything from this directory!

If it is taking up an unusually large amount of space, contact your hosting provider for a deeper analysis of the issue. 

  1. /var/log/

This directory stores logs generated by software running on your server. Logs have specific characteristics, and their cleanup is covered in a separate article.


Step 3: Finalizing and verifying

After deleting unnecessary files, check how much space has been freed using the command:

df -h