title | excerpt | updated |
---|---|---|
Configuring your database server |
Find out how to configure and optimise your database server |
2025-02-20 |
With the Web Cloud Databases database servers, you can influence your server’s global settings. You can also view your server's activity.
Find out how to configure and optimise your database server.
- A Web Cloud Databases instance (included in a Performance web hosting plan).
- Access to the OVHcloud Control Panel
In your OVHcloud Control Panel, go to the Web Cloud Databases
{.action} section, then select the SQL instance concerned. Click on the General information
{.action} tab.
You can also view important information on your SQL instance. Please take a few moments to ensure that the information displayed is correct, and corresponds to the instructions below.
Information | Details |
---|---|
Service status | Mainly shows if the instance has been rebooted, is in the process of rebooting, or is suspended. Your instance must be rebooted if you need to carry out any actions. |
Type | Shows the database system used by the server. If you are unsure if the correct type is being used, please note that the most common version is “MySQL”, but other types also exist (PostgreSQL, MariaDB). For example, if you are using WordPress for your website, a MySQL system is perfect for it. |
Version | Shows the database system version used by the server. Check that your website is compatible with the version you have chosen. |
CPU throttling | Displays the CPU time spent in saturation over the last 24 hours. |
RAM | Shows the RAM available for your instance, also shows if you are close to exceeding the RAM limit. Your database server has dedicated, guaranteed resources: its RAM. If required, you can scale the RAM, and receive warnings if you are consuming all of your instance’s RAM resources. |
Infrastructure | Shows the infrastructure used by your instance. This information is inherent to the OVHcloud infrastructure. |
Datacenter | Shows the data centre in which the instance has been created. Verify that your instance is hosted in is the same data centre as the OVHcloud Web Hosting plan that your website is based (or will be based) on. |
Host | Shows the OVHcloud server your instance has been created in. This information is inherent to the OVHcloud infrastructure, and can be used in our communications on OVHcloud incidents. |
You can access your Web Cloud Databases from your OVHcloud web hosting plans or from the public network.
In order for your Web Cloud Databases instance to be accessible, you must enter the IP addresses or ranges that can connect to your database.
In your OVHcloud Control Panel, go to the Web Cloud Databases
{.action} section, then select the Web Cloud Databases instance concerned. Click on the General information
{.action} tab.
To do this, click on the Authorised IPs
{.action} tab, then click Add an IP address/mask
{.action}.
In the window that pops up, enter the IP address or mask that you wish to authorise IP/mask
{.action}, together with a description, if you wish. You can then decide if you want to grant access to the databases only, or to the SFTP as well. Finally, click Confirm
{.action}.
For an OVHcloud web hosting plan, you can simply tick Authorise OVHcloud web hosting plans to access the database
.
Warning
If your Cloud Databases web hosting plan is linked to a Performance Web hosting plan, you will need detach the Cloud Databases web hosting plan from your Performance Web hosting plan beforehand in order to switch to a higher plan.
To detach a Cloud Databases web hosting plan from a Performance web hosting plan, please read our guide "How to detach the Web Cloud Databases solution from a web hosting plan".
This action cannot be undone, and the Cloud Databases web hosting plan will then be billed separately from your Performance web Hosting plan.
To modify the solution for your Web Cloud Databases instance, go to your OVHcloud Control Panel. Click the Web Cloud
tab, and then click Web Cloud Databases
{.action}. Select the name of your database server.
In the General information tab, displayed by default, click on ...
{.action} to the right of “RAM”, then on Change the amount of RAM
{.action} to access the order for this modification.
Choose the amount of RAM you want, then click Next
{.action}. You can then choose the duration you want.
[!primary]
The remaining term until expiration will be prorated. This pro rata calculation will be based on the expiration date of the Web Cloud Databases instance, not on the date of the purchase order.
Once you have confirmed your contracts, you will be redirected to the purchase order to pay for this change. It will then be effective within a few hours.
Warning
If you currently have a free Web Cloud Databases with your Performance hosting plan, it will no longer be free after modifying the plan.
In your OVHcloud Control Panel, go to the Web Cloud
section, and then click Web Cloud Databases
{.action}. Select the name of your Web Cloud Databases server.
- Click on the
Configuration
{.action} tab.
In the General configuration of MySQL box, you will see the configuration currently set for your database. You can modify it directly, then click Apply
{.action}.
- Tmpdir: Directory of temporary files. "/dev/shm" is the instance’s RAM. "/tmp" is the instance’s hard drive.
- MaxAllowedPacket: The maximum packet size.
- Max_user_connections: The number of concurrent connections authorised per user.
- AutoCommit: Sets whether requests are automatically committed or not.
- Interactive_timeout: Time (in seconds) for which the server will wait for activity on an interactive connection before closing the connection.
- InnodbBufferPoolSize: The selected buffer memory size.
- MaxConnections: The number of concurrent connections authorised on Web Cloud Databases.
- Wait_timeout: Time (in seconds) for which the server will wait for activity on a non-interactive connection before closing the connection.
- Event_scheduler: Is used to trigger the execution of requests programmed directly on the MySQL server.
- sql_mode: The sql_mode option affects the supported SQL syntax, and the data validation performed by MySQL/MariaDB.
[!primary] When you encounter an error on your website stating "Too many connections", this is due to the number of simultaneous connections on your database server being exceeded. You can then increase the MaxConnections variable if it is not at its maximum.
[!primary]
Tmpdir:
/dev/shm: The database server will allocate half of its RAM to this directory for higher performance.
/tmp: The server will allocate unlimited space on its hard disk for this directory, but this will be much less efficient. We recommend using this directory only for occasional heavy operations.
[!primary]
sql_mode:
Default mode of MariaDB 10.1:
NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER
Default mode of MariaDB 10.2 and higher:
STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Default mode of MySQL 5.6:
NO_ENGINE_SUBSTITUTION
Default mode of MySQL 5.7 and higher:
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
We recommend always using the default mode, unless your database was updated from a version with a default mode that is different from the current version.
Make the necessary changes, then click Confirm
{.action}.
Warning
Any changes require a restart of the database server.
- Click on the
Configuration
{.action} tab.
In the General PostgreSQL configuration box, you will find the configuration currently set for your database. You can modify it directly, then click Apply
{.action}.
- log_min_messages: Controls the levels of messages to be logged in the server logs. The levels available for a Web Cloud Databases solution are:
- WARNING: Provides warning messages about potential problems.
- ERROR: Sends the error that caused an ongoing order to be cancelled.
- LOG: Stores information for server administrators.
- FATAL: Sends the error that caused the current session to end.
- PANIC: Sends the error that caused all sessions to end.
Each level includes all levels that follow it. The higher the level, the fewer messages are recorded in the server logs.
By default, the value set is WARNING because it includes the values ERROR, LOG, FATAL, and PANIC.
You can also enable extensions for your databases. To do this, go to the Databases
{.action} tab, and click on the table icon for your database in the Extensions column.
To find out the version of MySQL, PostgreSQL or MariaDB of your database server, you must go to the General information tab after choosing your database server.
The current version appears in the Version row.
To edit this version, click Update version
{.action}.
Enter this command in phpPgAdmin by clicking on Your database in the SQL section, then click Launch
{.action}:
select version();
To do this, enter this command in phpMyAdmin, in the SQL section, then click Run
{.action}:
show variables like "version";
[!primary]
- Before migrating to a higher version, ensure that your database is compatible with the version you have chosen.
- The modification will be effective in a few minutes.
Warning
It is not possible to switch from an old version to the latest version directly. It is mandatory to use all intermediate versions.
To access the logs for your Web Cloud Databases solution, please refer to our guide "Web Cloud Databases - How to retrieve logs".
In your OVHcloud Control Panel, go to the Web Cloud
section, and then click Web Cloud Databases
{.action}. Select the name of your Web Cloud Databases server.
Go to the Metrics
tab in the OVHcloud Control Panel. You will find the graph RAM usage statistics.
This graph allows you to track, over the last 24 hours, the load of connections per minute on your database server.
In your OVHcloud Control Panel, go to the Web Cloud
section, and then click Web Cloud Databases
{.action}. Select the name of your Web Cloud Databases server.
Go to the Metrics
tab in the OVHcloud Control Panel. You will find the graph Statistics for total connections per minute.
It is recommended that you maintain your database to ensure high performance. Performance refers to the fact that the information contained in the database is most quickly returned to the script that requests it. This requires a structured and optimised database.
To increase the speed of searches during a query, you must index the fields that are used in WHERE clauses.
Example: you do a regular search for people in relation to the city. Index the “city” field with the following query:
ALTER TABLE 'test' ADD INDEX ('city')
Some of your data is no longer being accessed? By archiving it, your tables will be less crowded and searches will go faster.
Limit the display of records to a fixed number (for example: 10 per page) with the "LIMIT" portion of your SQL query.
Group your queries at the beginning of the script this way:
open_connection
request1
request2
...
close_connection
Display...
Treat data
Loop through data...
Display...
...
In your SQL queries, make sure you select only what you need, and especially that you have not forgotten the links between the tables.
Example:
(where table1.champs = table2.champs2)
Avoid using "HAVING" for example. It increases your requests. Similarly, avoid using “GROUP BY”, unless it is strictly necessary.
IP address list for Web Hosting clusters
For specialised services (SEO, development, etc.), contact OVHcloud partners.
If you would like assistance using and configuring your OVHcloud solutions, please refer to our support offers.
Join our community of users.