gpt4 book ai didi

c++ - 保持cgi应用程序始终在c++中运行

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:30:52 25 4
gpt4 key购买 nike

我写了一个 CGI 应用程序,它由 Apache 服务器运行,等待请求处理。事实上,在收到每个请求后,Apache 运行应用程序,处理请求并相应地回复。它在性能方面有一些缺点,因为通过接收每个请求,它必须加载所有必要的要求和初始化。另一个问题是,在应用程序中,我必须跟踪客户端稍后发送的 ACK 的一些信息。我怎样才能运行一次应用程序,让它始终等待处理请求?

最佳答案

听起来您想使用 mod_fastcgi对于 Apache 。来自网站:

This 3rd party module provides support for the FastCGI protocol. FastCGI is a language independent, scalable, open extension to CGI that provides high performance and persistence without the limitations of server specific APIs. ... FastCGI applications are fast because they're persistent. There is no per-request startup and initialization overhead. This makes possible the development of applications which would otherwise be impractical within the CGI paradigm (e.g. a huge Perl script, or an application which requires a connection to one or more databases).

关于c++ - 保持cgi应用程序始终在c++中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12375979/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com