Webspeed with Ngnix on Centos 7

Posted by wwaechter on 08-Dec-2015 02:49

Hi to all,

has anybody tried to run Webspeed with Ngnix-Webserver ?

We look for an Server with high throughput, but Ngnix does not support cgi out of the box, so can anybody help how to implement a secure and fast cgi-scripting environment ?

We don´t use PAS yet so we need this kind of Webspeed-Services.

Thanks in advance.

All Replies

Posted by rayherring on 08-Dec-2015 03:02

Nginx no, Lighttpd yes, and haproxy.

Have a test system set up at work for a Webspeed that runs on Debian 8 instead of RHEL.

User goes to the website via the HAproxy port (running on port 80), depending on the request, if it is just for a standard web request it gets pushed over to LightTPD+CGI+WebSpeed port, if it is for websocket it gets pushed over to the redis-server port.

IMHO I find LightTPD to be much faster than Nginx, but that's just personal preference really.

Posted by CMI on 31-Jul-2018 01:16

This is interesting. I am interested in how you set-up LightTPD working with WebSpeed. In theroy it should work on Windows Server...right?

Posted by rayherring on 31-Jul-2018 01:37

I scrapped the HAproxy side of it since I decided to do websockets a different way, but the lighttpd side of things has been working quite nicely (and so much faster than Apache).

For lighttpd, I am just running a stock standard setup (with the exception of the cgi-bin side of things).

lighttpd.conf:

server.modules = (
        "mod_access",
        "mod_accesslog",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
        "mod_setenv",
)

server.document-root        = "/var/www"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
accesslog.filename          = "/var/log/lighttpd/access.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80

# Keep-Alive stuff
# Was at 32 and 3
server.max-keep-alive-requests = 0
server.max-keep-alive-idle     = 3

index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.allowed-encodings  = ("gzip", "deflate")
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

10-cgi.conf (in /etc/lighttpd/conf-enabled)

server.modules += ( "mod_cgi" )

$HTTP["url"] =~ "^/cgi-bin/" {
        cgi.assign = ( "" => "" )
}

alias.url += ( "/cgi-bin" => "/usr/lib/cgi-bin/" )



Then in the /usr/lib/cgi-bin directory I just have my cgi script for my broker (eg. cgiip) which points to the host the DB is running on (that also has the actual broker and agents on it).

I had to reduce the max-keep-alive-requests from the default as having it at 32 was causing issues.

Response times (according to 'wtbman -i broker' have basically gone from 200ms or so down to about 10ms just by switching to lighttpd).

This thread is closed