Dino Geek, try to help you

How to configure connection pool in MariaDB?


Configuring a connection pool for MariaDB is usually done through application server or middleware, like Apache Tomcat, JBoss or JDBC-based connection pooling libraries like HikariCP, C3P0 or DBCP. However, the database also offers built-in connection pooling starting from MariaDB 10.1.1.

Here are some general steps on how to do this:

1. Enable the thread pool in MariaDB: Open `/etc/my.cnf` (on Linux) or `my.ini` (on Windows), and under the `[mysqld]` section, add the following lines: \`\`\` thread\_handling=pool-of-threads thread_pool_size= 20 \`\`\` The above lines enable built-in connection pooling and set the thread pool size to 20.

1. Configuring the pool through an application server or middleware: If you’re using a JDBC-based connection pooling, the configuration would usually go into a `Context.xml file` (for Apache Tomcat) or a `standalone.xml` file (for JBoss).

Here’s an example for Apache Tomcat: \`\`\` \`\`\` In the above example, `maxActive` is the maximum number of active connections that can be allocated from this pool at the same time, `maxIdle` is the maximum number of connections that can sit idle in the pool without being closed, and `minIdle` is the minimum number of idle connections that can remain in the pool without being closed.

1. Restart MariaDB or application server to apply changes: After you’ve made changes in the configuration file. You have to restart the MariaDB server or application server to apply these changes.

Note that these are general steps and might differ according to your specific setup. Always refer to your application server’s or connection pooling library’s documentation for precise steps.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use