C++ CGI和MySQL问题(mysql++)

发布于 2024-07-25 10:33:26 字数 230 浏览 4 评论 0原文

我正在尝试在 cgi 程序中使用 c++,如果我不使用 mysql,一切都可以。 如果没有 mysql,我的网站将在大约 1-2 毫秒内生成,但如果我仅添加 mysql++ 库中的一个变量或函数,网站将在大约 35 毫秒内生成! (对于 php 来说大约是 15 - 25 毫秒)我想这是 dll 加载的问题(有两个,mysql dll 大约是 2 MB!)。 那么,如何使用mysql而不导致性能下降呢?

克里斯

I'm trying to use c++ in cgi programs and everything is ok if i don't use mysql. Without mysql my site is generated in about 1-2 ms, but if I add only one variable or function from mysql++ library, site is generated in ~35 ms! (with php it's about 15 - 25 ms all time) I suppose it's a problem with dll loading ( there are two, and mysql dll is about 2 MB! ). So, how can I use mysql without such performance decrease?

Chris

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不爱素颜 2024-08-01 10:33:26

也许你可以看看 fastcgi,fastcgi 的目的是防止必须启动可执行文件对于每个请求,可执行文件始终运行,并且每个请求都通过套接字传输到您的 cgi。 fastcgi 提供了一个库,可以用多种语言轻松地完成此操作。 然后,您必须配置 Web 服务器,例如 Apache 的 mod_fastcgi。

Maybe you could have a look fastcgi, the aim of fastcgi is to prevent from having to launch the executable for each request, the executable is always running and each request is transmitted through a socket to your cgi. fastcgi provides a library to easily do this in several languages. You then have to configure your web server, for example mod_fastcgi for Apache.

你好,陌生人 2024-08-01 10:33:26

小心

由于许可证 (LGPL) - 如果我不想共享我的代码,我必须动态链接 – chris 6 月 19 日 14:05

请看一下此讨论:
关于 MySQL++、GPL 和 LGPL
如果您不发布已编译的二进制文件,也可以,但如果您想发布二进制文件,则还必须发布源代码,因为 MySQL++ 基于 GPL 库(mysql C 连接器)。< br>
或者购买商业许可证。

干杯,

CAREFUL

beacuse of license (LGPL) - if I don't want to share my code I have to link dynamically – chris Jun 19 at 14:05

Please take a look at this discussion:
About MySQL++, GPL and LGPL
In case you don't release your compiled binaries, is ok, but if you want to release your binaries you will have to release the sources as well due to the fact MySQL++ is based on a GPL library (the mysql C connector).
Or buy the commecrial license.

Cheers,

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文