diff --git a/databases/proxysql/Makefile b/databases/proxysql/Makefile index b611737d97d8..c3d62bb928f0 100644 --- a/databases/proxysql/Makefile +++ b/databases/proxysql/Makefile @@ -1,80 +1,79 @@ PORTNAME= proxysql PORTVERSION= 2.6.1 +PORTREVISION= 1 CATEGORIES= databases MAINTAINER= zi@FreeBSD.org COMMENT= High performance, high availability, protocol-aware proxy for MySQL WWW= https://www.proxysql.com/ LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= aclocal:devel/automake \ autoreconf:devel/autoconf \ bash:shells/bash \ cmake:devel/cmake-core \ ${LOCALBASE}/bin/grep:textproc/gnugrep \ libgcrypt>0:security/libgcrypt \ libtoolize:devel/libtool \ e2fsprogs-libuuid>0:misc/e2fsprogs-libuuid \ gnutls>0:security/gnutls RUN_DEPENDS= libgcrypt>0:security/libgcrypt \ e2fsprogs-libuuid>0:misc/e2fsprogs-libuuid \ gnutls>0:security/gnutls -USES= compiler:gcc-c++11-lib gmake libtool perl5 python:build shebangfix +USES= compiler:c++11-lang gmake libtool perl5 python:build shebangfix USE_PERL5= build USE_GCC= yes MAKE_ENV= GIT_VERSION=${PORTVERSION} USE_GITHUB= yes ALL_TARGET= build_deps default SHEBANG_FILES= deps/libssl/verify-bio_st-match.sh -MAKE_JOBS_UNSAFE=yes LDFLAGS+= -L${LOCALBASE}/lib -CFLAGS+= -fPIC -CXXFLAGS+= -fPIC BINARY_ALIAS= python3=${PYTHON_CMD} USE_RC_SUBR= ${PORTNAME} USERS= ${PORTNAME} GROUPS= ${PORTNAME} GH_ACCOUNT= sysown post-patch: @${REINPLACE_CMD} -e 's,/etc/,${ETCDIR}/,g' ${WRKSRC}/lib/ProxySQL_GloVars.cpp @${REINPLACE_CMD} \ -e 's|strftime(__buffer, 25, "%Y-%m-%d %H:%M:%S", __tm_info);|snprintf(__buffer, 3, "%s", "");|g' \ -e 's,"%s \[,"%s\[,g' \ -e '/__timer/d' \ -e '/__tm_info/d' \ ${WRKSRC}/include/proxysql_debug.h @${REINPLACE_CMD} \ -e 's,/var/lib,/var/db,g' \ -e '7s/^/errorlog="\/var\/log\/proxysql\/proxysql-error.log"\n\n/g' \ -e '7s/^/pid="\/var\/run\/${PORTNAME}\/${PORTNAME}.pid"\n/g' \ ${WRKSRC}/src/proxysql.cfg @${REINPLACE_CMD} \ -e 's,grep,${LOCALBASE}/bin/grep,g' \ -e 's,ln -fsT,ln -fs,' \ -e 's,PROXYSQLCLICKHOUSE=1 ,,g' \ + -e 's,--enable-fastopen=false ,--enable-fastopen=false --enable-shared=no ,g' \ ${WRKSRC}/Makefile ${WRKSRC}/deps/Makefile \ ${WRKSRC}/lib/Makefile ${WRKSRC}/src/Makefile do-install: ${INSTALL_PROGRAM} ${WRKSRC}/src/proxysql ${STAGEDIR}${LOCALBASE}/sbin post-install: ${MKDIR} ${STAGEDIR}${ETCDIR} ${STAGEDIR}/var/db/${PORTNAME} \ ${STAGEDIR}/var/run/${PORTNAME} \ ${STAGEDIR}${LOCALBASE}/etc/syslog.d \ ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d \ ${STAGEDIR}/var/log/${PORTNAME} ${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.conf \ ${STAGEDIR}${LOCALBASE}/etc/syslog.d ${INSTALL_DATA} ${FILESDIR}/proxysql.conf-newsyslog \ ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/proxysql.conf.sample ${INSTALL_DATA} ${WRKSRC}/src/proxysql.cfg \ ${STAGEDIR}${ETCDIR}/proxysql.cfg.sample .include diff --git a/databases/proxysql/files/patch-lib_ProxySQL__RESTAPI__Server.cpp b/databases/proxysql/files/patch-lib_ProxySQL__RESTAPI__Server.cpp new file mode 100644 index 000000000000..72ae22c8e798 --- /dev/null +++ b/databases/proxysql/files/patch-lib_ProxySQL__RESTAPI__Server.cpp @@ -0,0 +1,11 @@ +--- lib/ProxySQL_RESTAPI_Server.cpp.orig 2024-04-01 15:50:50 UTC ++++ lib/ProxySQL_RESTAPI_Server.cpp +@@ -346,7 +346,7 @@ ProxySQL_RESTAPI_Server::ProxySQL_RESTAPI_Server( + // NOTE: Right now ProxySQL is using the simplest mode of 'libhttpserver' for serving 'REST' queries, + // in the current mode concurrency on serving requests is low, and throughput is directly related with + // the time required to execute the target script, since each of the calls are blocking. +- ws = std::unique_ptr(new webserver(create_webserver(p))); ++ ws = std::unique_ptr(new webserver(create_webserver(p).start_method(http::http_utils::start_method_T::THREAD_PER_CONNECTION))); + // NOTE: Enable for benchmarking purposes. In this mode each request will be served by it's own thread. + // ws = std::unique_ptr(new webserver(create_webserver(p).start_method(http::http_utils::start_method_T::THREAD_PER_CONNECTION))); + auto sr = new sync_resource(); diff --git a/databases/proxysql/files/proxysql.in b/databases/proxysql/files/proxysql.in index 781d5b4bdf1f..3e6b805315ee 100644 --- a/databases/proxysql/files/proxysql.in +++ b/databases/proxysql/files/proxysql.in @@ -1,62 +1,61 @@ #!/bin/sh # PROVIDE: proxysql # REQUIRE: LOGIN mysql # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # # proxysql_enable (bool): Set to NO by default. # Set it to YES to enable proxysql. # proxysql_user (string): Set user that proxysql will run under # Default is "proxysql". # proxysql_group (string): Set group that proxysql will run under # Default is "proxysql". # proxysql_config (string): Set path to config file # Default is "%%ETCDIR%%/proxysql.cfg". # proxysql_args (string): Set extra arguments to pass to proxysql # Default is "". . /etc/rc.subr name=proxysql rcvar=proxysql_enable load_rc_config $name : ${proxysql_enable:="NO"} : ${proxysql_user:="proxysql"} : ${proxysql_group:="proxysql"} : ${proxysql_config:="%%ETCDIR%%/proxysql.cfg"} -: ${proxysql_socket:="/var/run/proxysql/proxysql.sock"} : ${proxysql_datadir:="/var/db/proxysql"} : ${proxysql_args:=""} : ${proxysql_restart_delay:="10"} pidfile="/var/run/proxysql/proxysql.pid" command="/usr/sbin/daemon" proxysql_command="%%PREFIX%%/sbin/proxysql" command_args="-rP ${pidfile} -S -R ${proxysql_restart_delay} \ -T ${name} ${proxysql_command} \ - -f -c ${proxysql_config} -S ${proxysql_socket} \ + -f -c ${proxysql_config} \ -D ${proxysql_datadir} \ --no-version-check ${proxysql_args}" required_files="${proxysql_config}" extra_commands="reload initialize" reload_cmd=proxysql_reload initialize_cmd=proxysql_initialize proxysql_initialize() { su -m ${proxysql_user} -c "${proxysql_command} --initial" } proxysql_reload() { su -m ${proxysql_user} -c "${proxysql_command} --reload" } load_rc_config $name run_rc_command "$1"