https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11974
--- Comment #23 from Olli-Antti Kivilahti <[email protected]> --- Created attachment 63940 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63940&action=edit Bug 11974 - Enable non-default unix socket location for database connections. ----------------- - BUSINESS CASE - ----------------- Currently Koha doesn't support using a non-default unix socket for database connections. Using unix sockets is generally ~20-30% faster compared to using TCP packets. Because Koha abuses the database a lot, this will make a difference. Using a non-default unix socket is useful if you want to run multiple databases (eg. mysql and mariadb) in the same OS (eg. for testing purposes). Also if one needs to move the unix socket, for example to share it between LXC containers using a shared partition, this feature might be handy. Using unix sockets for connections are faster than TCP because there is no need for TCP and IP layer packet generation. Instead applications can communicate directly without extra overhead. The benefit is marginal for a single query, around 0.5ms, but escalates linearly when hundreds of queries are performed. ------------ - SOLUTION - ------------ Mysql uses unix sockets for localhost connections only, but DBI::Mysql cannot automatically find the non-default socket path, thus it needs to be explicitly given. This patch modifies the Koha::Database->_new_schema routine to check for the presence of mysql_socket in koha-conf.xml and prioritize the socket connection. This patch works on MariaDB and Mysql and hopefully on PostgreSQL. ------------- - TEST PLAN - ------------- DEFAULT: 1. edit koha-conf.xml 1.1. put your socket path to the <socket>-attribute by default /var/run/mysqld/mysqld.sock or create the xml-entry <socket>/var/run/mysqld/mysqld.sock</socket> 2. load any koha's web-page. Shouldn't get any errors. BAD SOCKET: 1. but a bad path as your mysql_socket, eg /var/run/mysqld/mysqld.sockBADBAD 2. load any koha's web-page. It should fail due to DB connection error. Thank you for testing! -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
