Vely logo install | documentation | examples | articles | changelog
16.6.0 released on Mar 08, 2023 | articles updated on Mar 20, 2023

FastCGI


To run Vely web application with FastCGI protocol, you need to setup a reverse proxy, i.e. a web server that will forward request and send replies back to clients. Vely application runs as a number of (zero or more) background processes in parallel, processing requests.

Setting up reverse proxy (web server)

To access your application via a reverse proxy (i.e. web server), generally you need to add a proxy directive and restart the web server.

If you use Apache, you need to connect it to your application, see connect_apache_tcp_socket (for using TCP sockets) and connect_apache_unix_socket (for using Unix sockets).

If you use Nginx, you need to connect it to your application, see connect_nginx_tcp_socket (for using TCP sockets) and connect_nginx_unix_socket (for using Unix sockets).

Starting FastCGI server processes

Use vf, for example:
vf <app name>
which in general will start zero or more background resident process(es) (daemons) that process requests in parallel.

Connection timeout

In a heavy-load environment, a client's connection may be rejected by the server. This may happen if the client runs very slowly due to swapping perhaps. Once a client establishes a connection, it has up to 5 seconds by default to send data; if it doesn't, the server will close the connection. Typically, FastCGI clients send data right away, but due to a heavy load, this time may be longer. To set the connection timeout in milliseconds, set the following variable before starting the application server, for instance:
export "LIBFCGI_IS_AF_UNIX_KEEPER_POLL_TIMEOUT"="8000"
vf -w 1 <app name>
In this case, the timeout is set to 8 seconds.

See also

Running application ( application_setup   CGI   Client_API   command_line   containerize_application   FastCGI   FastCGI_client   plain_C_FCGI  )  SEE ALL (documentation)


Copyright (c) 2017-2023 DaSoftver LLC. Vely is a trademark of Dasoftver LLC. The software and information herein are provided "AS IS" and without any warranties or guarantees of any kind. Vely elephant logo (c) 2022 DaSoftver LLC. This web page is licensed under CC-BY-SA-4.0. Contact email vely@vely.dev.