Applicable to:
- Plesk for Linux
Question
- Is there a way to use the ionice command to start the
vhostmng-find
tool in Plesk with a lower IO priority?
Answer
Warning: Be advised that the bash script part will be removed automatically during the next Plesk update and will have to be applied again. Also, bear in mind that this solution does reduce the disk I/O load, but it also increases the execution time.
The purpose of the bash script we are creating in the steps below is to run the original vhostmng-find
utility of Plesk (after it has been renamed to real-vhostmng-find
) with a lower priority via the ionice
command.
You may use a bash script in combination with ionice
in order to lower the I/O that vhostmng-find is using by following these steps:
1. Log into your server via SSH
2. Execute the following command in order to find where exactly the original vhostmng-find
utility of Plesk is stored within your disk:
# find / -type f -iname "*vhostmng-find*"
Warning: The expected output is different for the different Linux operating systems on which Plesk can be installed and subsequent steps depend on it
/usr/local/psa/admin/bin/vhostmng-find
3. Move vhostmng-find
to /usr/local/psa/admin/sbin/
and rename it by running this command:
# mv /usr/local/psa/admin/bin/vhostmng-find /usr/local/psa/admin/sbin/real-vhostmng-find
4. Create a new file named /usr/local/psa/admin/bin/vhostmng-find
by executing the following command (this one will replace the one that was just moved and renamed and will contain the bash script):
# touch /usr/local/psa/admin/bin/vhostmng-find
5. Open the new file for editing by using your favorite command-line text editor. As an example, you may execute the following command:
# nano /usr/local/psa/admin/bin/vhostmng-find
6. Input the following bash script lines within the newly created file and save the changes:
Note: You can replace 2
and 6
with the scheduling class and priority level that you find suitable for your specific situation while referring to the information on this link:
#!/bin/sh
ionice -c 2 -n 6 /usr/local/psa/admin/sbin/real-vhostmng-find $@
7. Apply the necessary permissions to the newly created vhostmng-find
file that contains your bash script:
# chmod 755 /usr/local/psa/admin/bin/vhostmng-find
/usr/local/psa/admin/sbin/vhostmng-find
3. Move vhostmng-find
to /usr/local/psa/admin/sbin/
and rename it by running this command:
# mv /usr/local/psa/admin/sbin/vhostmng-find /usr/local/psa/admin/sbin/real-vhostmng-find
4. Create a new file named /usr/local/psa/admin/sbin/vhostmng-find
by executing the following command (this one will replace the one that was just moved and renamed and will contain the bash script):
# touch /usr/local/psa/admin/sbin/vhostmng-find
5. Open the new file for editing by using your favorite command-line text editor. As an example, you may execute the following command:
# nano /usr/local/psa/admin/sbin/vhostmng-find
6. Input the following bash script lines within the newly created file and save the changes:
Note: You can replace 2
and 6
with the scheduling class and priority level that you find suitable for your specific situation while referring to the information on this link:
#!/bin/sh
ionice -c 2 -n 6 /usr/local/psa/admin/sbin/real-vhostmng-find $@
7. Apply the necessary permissions to the newly created vhostmng-find
file that contains your bash script:
# chmod 755 /usr/local/psa/admin/sbin/vhostmng-find
/opt/psa/admin/sbin/vhostmng-find
3. Move vhostmng-find
to /usr/local/psa/admin/sbin/
and rename it by running this command:
# mv /opt/psa/admin/sbin/vhostmng-find /usr/local/psa/admin/sbin/real-vhostmng-find
4. Create a new file named /usr/local/psa/admin/sbin/vhostmng-find
by executing the following command (this one will replace the one that was just moved and renamed and will contain the bash script):
# touch /opt/psa/admin/sbin/vhostmng-find
5. Open the new file for editing by using your favorite command-line text editor. As an example, you may execute the following command:
# nano /opt/psa/admin/sbin/vhostmng-find
6. Input the following bash script lines within the newly created file and save the changes:
Note: You can replace 2
and 6
with the scheduling class and priority level that you find suitable for your specific situation while referring to the information on this link:
#!/bin/sh
ionice -c 2 -n 6 /usr/local/psa/admin/sbin/real-vhostmng-find $@
7. Apply the necessary permissions to the newly created vhostmng-find
file that contains your bash script:
# chmod 755 /opt/psa/admin/sbin/vhostmng-find
Comments
5 comments
This measure causes this error in WP Toolkit when clicking the search button.
Please update.
Error:
vhostmng-find failed: sh: 1: /opt/psa/admin/bin/vhostmng-find: Permission denied
The article has now been updated to prevent the appearance of the
Error:
vhostmng-find failed: sh: 1: /opt/psa/admin/bin/vhostmng-find: Permission denied
error in WP Toolkit whenever the search button is pressed.Daniel Yordanov: Please fix the paths in question: Is there a way to use the ionice command to start the
/var/loca/psa/admin/bin/vhostmng-find
tool with a lower IO priority?Daniel Yordanov Apart from the typo earlier reported in my previous comment, I think the article is still wrong. I don't want to mislead anyone, so please check your instructions carefully.
Thank you for the feedback. The typo in the Question section of the article has been corrected now.
Please sign in to leave a comment.