lshttpd & lscgid processes?

Discussion in 'General' started by 28122008, Dec 28, 2008.

  1. 28122008

    28122008 Member

    Hi everyone..

    Installing litespeed was so easy and now being a techy i am trying to understand the nitty-gritties of its working model. At the first start using "lswsctrl start", it launched 3 processes:

    root 27971 0.0 0.6 5104 1776 ? S 08:31 0:00 ./lshttpd
    root 27973 0.0 0.1 1584 320 ? S 08:31 0:00 httpd (lscgid)
    nobody 27974 0.0 0.6 5540 1612 ? S 08:31 0:00 ./lshttpd

    At quick look at the output of netstat revealed that the first process started by root is listening to both admin and http ports while the other two are its children. Now I wonder being a web server working on the ansynchrous select based model, why it has launched another copy of lshttpd? And whats the purpose of this "lscgid"? After replacing this file with a dummy executable I found out that although litespeed starts, and php scripts work but cgi scripts don't. So is it basically to provide just age old CGI functionality? Will PHP in fastcgi mode work without this daemon or this is required for FCGI too? If its just for CGI, I really don't need it so can it be stopped?

    Now back to my original question about two copies of "lshttpd" processes? Is the first one just to listen to ports and second one to handle connections? I tried changing "Auto Restart" to on and off but in both cases there are 2 copies of lshttpd running, contrary to the description of this feature. Under normal conditions does the parent process kills this one children after some number of connections and forks another child?

    I would be really glad to someone who can answer to my curiousities.

  2. mistwang

    mistwang LiteSpeed Staff

    cgid is for CGI and suEXEC, you should keep it running.
    the parent lshttpd process is the watchdog process, which will start new child process if any child process crash for any reason. It will not quit by itself.
  3. 28122008

    28122008 Member

    You didn't clarify about the "Auto Restart" function. Turning it on or off doesn't have any impact on the number of running processes contrary to its description.

    So 2 lshttpd processes are bare minimum required to be running in order to make litespeed start serving files? Isn't there anyway to give rest to the watchdog process and let the worker keep doing its task? Also by any chance is it possible to run the server as root?

    The reason why I wish to turn off lscgid is that I don't use CGI at all. Litespeed with PHP in SAPI or FCGI mode is enough for me. Also as I am the sole user on the server, serving my own files and I don't intend to use suexec either. So is there any way to do it?
    Last edited: Dec 29, 2008
  4. anewday

    anewday Moderator

    LSAPI is better than FCGI mode anyway.

    I've always wondered about the lscgid process too and I don't need to use CGI at all. It always show 1 under Pool in real-time statistics.

Share This Page