Register or log in (lost password?):

Low End Talk

Hosting Websites on Bare Minimum VPS/Dedicated Servers

Low End Talk » Low End Talk

Single-threaded webserver software

(4 posts)
  • Started 1 year ago by BillFletcher
  • Latest reply from LowEndAdmin

Tags:

  1. BillFletcher
    Member

    Hi all,

    In various discussions I have seen lighttpd and nginx characterized as "single threaded". On a couple of my PHP / MySQL websites I have recursive database queries that can taken up to a minute or two to return results. Would that mean that other users would have to wait until a previous thread has been completed before their pages are served?

    Otherwise I am very much attracted to these solutions -- I hate Apache's huge memory footprint!

    Thanks,
    Bill

    Posted 1 year ago #
  2. rstonehouse
    Member

    I think for your long running queries you would have problems if you only configured for one thread - other queries would be blocked

    But I think you still should be able to use lighttpd or nginx using a suitable config e.g.
    http://wiki.nginx.org/NginxHttpMainModule#worker_processes

    Posted 1 year ago #
  3. bekanosky
    Member

    Other queries wouldn't be blocked.
    nginx is asynchronous, not synchronous.
    Simply speaking, asynchronous means while you waiting for something, you can do something else.

    Posted 1 year ago #
  4. LowEndAdmin
    Key Master

    while your webserver (nginx/lighttpd) is single threaded, asynchronous, and event based -- but that does not mean the actual backend (PHP over FastCGI in this case) is the same. If you only have one single PHP backend process, then yes a long query will block subsequent requests to PHP. However for larger sites you usually have multiple backend process that nginx would do round-robin in dispatching requests to those backend processes.

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.