25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

Need help?

Our experts have had an average response time of 11.43 minutes in March 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Database import hang in Plesk – How we fix it

by | May 7, 2021

Often the database import in Plesk hangs at 100%. Users often notice errors even while importing a comparatively small database.

At Bobcares, our Support Engineers often get the request to solve Plesk usage problems as a part of our Server Management Services.

Today, let’s analyze the cause and see how our Support Team fix Database import issues for our customers.

What causes Database import to hang in Plesk

Recently we received a request from one of our customers that the database import task from Plesk was getting hang. This was even the case with considerably smaller databases. Mysql error log at “/var/log/mysql/error.log” was reporting the error as shown below:

Database import hang in Plesk

While we cross-checked the Mysql CPU usage, we noticed that the usage has spiked to a great extend. A typical usage that we noticed resembled the one below:

PID     USER   PR    NI   VIRT         RES       SHR   S    %CPU    %MEM    TIME+     COMMAND
16164  mysql   20     0    2654656   748200   8044  S     201.0      18.3   2698:08    mysqld

This error generally triggers due to non-optimized client databases.

 

How to fix Database import hang in Plesk

As the database import tasks normally hang at 100% due to non-optimized databases, we need to optimize the databases to fix this error permanently.

One solution here would be to allocate RAM to the MySQL server. For this, we need to connect to the Plesk server via SSH. Then, we need to open the MySQL configuration file my.cnf or my.ini with any text editor. Locations of these files vary for different Linux distros.

For CentOS/RHEL:

/etc/my.cnf

For Debian/Ubuntu:

/etc/mysql/my.cnf

Then, we need to add the following directives under the [mysqld] section or increase the values if these directives are already defined:

innodb_buffer_pool_size=1024M
query_cache_size=64M

Once the changes are made, save the changes and close the file. Also, note to restart the MySQL service with the appropriate command:

For CentOS/RHEL:
# systemctl restart mariadb
For Debian/Ubuntu:
# systemctl restart mysqld

Now, we need to monitor CPU usage. If CPU consumption increases again, our Support Engineers consider reviewing the SQL code of a database that has slow queries.

During a high level of CPU usage, we can find queries that are currently running and taking a lot of time with the command below:

plesk db "SHOW FULL PROCESSLIST"

This would help us to note down the queries that are getting stuck up. We also note to check the MySQL error log file /var/log/mysqld.log for errors.

Another possible reason could be low RAM and disk space available in the server. We can check RAM and free disk space with the command below:

# free -h
# df -h

[Need any further assistance to fix Plesk server errors? – We’re available 24*7 ]

Conclusion

In short, the database import task in Plesk fails due to non-optimized client databases. Today, we saw some tips that our Support Engineers use to optimize the databases.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

SEE SERVER ADMIN PLANS

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Categories

Tags

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF