Results 1 to 9 of 9

Thread: Lighttpd problem

  1. #1
    Join Date
    Sep 2008
    Posts
    26

    Default Lighttpd problem

    I have lighty installed just for playing videos however i'm having to following problems:

    Described in error log (videos stop playing when 2.problem occurs):

    1. We waited 360 seconds. If this a problem increase server.max-write-idle

    2. "... accept() failed: Too many open files"


    The first problem is i think not server side , based on my invastigations in several forums. And it does not affect anything. However the second is a huge problem. After i install lighttpd. It works for about 5-6 hours, then the following message comes "... accept() failed: Too many open files" IT should mean there are too many open files or file descriptors, but i changed fd limit value to 4096 as i was guided from other forums, but the problem still exists.
    what shell i do? Make it unlimited?

    ps.: anyone having the same config must be having the first problem as well! Just check /var/log/lighttpd/error.log

  2. #2
    Join Date
    Sep 2008
    Posts
    1,019

    Default Re: Lighttpd problem

    The first error is a client-side problem. This is common if you are using connection throttling bandwidth throttling. What this means is that the person viewing the video stopped watching the video and went to another page before the video finished transferring to the client. The server will wait a specified amount of time to see if the connection comes back (so that it can resume transferring). If not, it closes the connection and moves on.

    The second error is due to you running out of file descriptors. There are three things that you will need to do.

    1. Make sure that you are running lighttpd as root and not as a normal user. Otherwise step two and three will not work.

    2. Increase the maximum file descriptors:

    Code:
    server.max-fds = 2048
    or

    Code:
    server.max-fds = 4096
    3. Decrease the wait time before the server drops the file descriptors to make room for new connections:

    Code:
    server.max-keep-alive-requests = 4
    server.max-keep-alive-idle = 4
    Note that step three waits 4 seconds before dropping a connection to move on. If you still run into problems, you can tell the server to not use keep-alive at all by changing the keep-alives to 0. However, this will hurt performance if you do.
    vShare Solutions
    Custom vShare Modules and Services

    Now, your visitors can watch videos on your site using their mobile or tablet device with the Mobility Mod for vShare 2.8!

  3. #3
    Join Date
    Apr 2007
    Posts
    2,202

    Default Re: Lighttpd problem

    Quote Originally Posted by gergokee
    1. We waited 360 seconds. If this a problem increase server.max-write-idle
    Is not a problem, just ignore it, it is normal.


    Quote Originally Posted by gergokee
    2. "... accept() failed: Too many open files"
    In /etc/sysctl.conf

    Add

    Code:
    # These ensure that TIME_WAIT ports either get reused or closed fast.
    net.ipv4.tcp_fin_timeout = 1
    net.ipv4.tcp_tw_recycle = 1
    
    # TCP memory
    net.core.rmem_max = 16777216
    net.core.rmem_default = 16777216
    net.core.netdev_max_backlog = 262144
    net.core.somaxconn = 262144
    
    net.ipv4.tcp_syncookies = 1
    net.ipv4.tcp_max_orphans = 262144
    net.ipv4.tcp_max_syn_backlog = 262144
    net.ipv4.tcp_synack_retries = 2
    net.ipv4.tcp_syn_retries = 2
    
    net.core.wmem_max = 1048576
    net.ipv4.tcp_wmem = 4096 87380 524288
    In lighttpd conf add

    Code:
    # http://trac.lighttpd.net/trac/wiki/D...erformance#id4
    server.max-keep-alive-requests = 4
    server.max-keep-alive-idle = 4
    server.event-handler = "linux-sysepoll"
    #server.network-backend = "linux-sendfile"
    server.network-backend = "writev"
    server.max-fds = 8192
    server.max-connections = 4096
    server.stat-cache-engine = "fam"

  4. #4
    Join Date
    Sep 2008
    Posts
    26

    Default Re: Lighttpd problem

    The 2.problem: i did what you advised but now i can't start lighttpd
    error message:
    Starting lighttpd: 2008-10-18 14:22:26: (configfile.c.236) server.stat-cache-engine can be one of "disable", "simple", but not: fam [FAILED]

    i don't know if that's important but now i'm trying to test if it works withous that...

  5. #5
    Join Date
    Apr 2007
    Posts
    2,202

    Default Re: Lighttpd problem

    For now set it to disabled by removing the line

    Code:
    server.stat-cache-engine = "fam"
    Or install

    Code:
    yum -y install gamin
    yum -y install gamin-devel
    Then install lighttpd with

    Code:
    make clean && make distclean
    ./configure --with-fam

  6. #6
    Join Date
    Sep 2008
    Posts
    26

    Default Re: Lighttpd problem

    Now it seems to be allright!!!

    But tell me what does that fam do? Is it necessary, i mean what does it improve?

  7. #7
    Join Date
    Apr 2007
    Posts
    2,202

    Default Re: Lighttpd problem

    fam do stat info caching, will slightly speed up.

  8. #8
    Join Date
    Apr 2007
    Posts
    2,202

    Default Re: Lighttpd problem

    Code:
    server.max-write-idle    = 6001
    This will keep many pen connections and create problem in busy servers.

    Wikipedia use

    Code:
    server.max-write-idle    = 30
    See

    http://www.buyscripts.in/vshare/wikiped ... k-2007.pdf

  9. #9
    Join Date
    Sep 2008
    Posts
    26

    Default Re: Lighttpd problem

    yes you're right , that thing would screw up things... so i deleted it from my post, so that it won't misguide people!

Similar Threads

  1. How to install lighttpd
    By RAMMSTEIN in forum General Discussions
    Replies: 10
    Last Post: 12-04-2009, 08:33 AM
  2. Is there a way to make apache and lighttpd work together
    By RAMMSTEIN in forum General Discussions
    Replies: 1
    Last Post: 05-14-2009, 09:22 AM
  3. lighttpd and hotlinking
    By pyrorain in forum Bug Reports
    Replies: 4
    Last Post: 04-14-2009, 11:30 PM
  4. rewrite rules for Lighttpd
    By dealspiggy in forum Feature Requests
    Replies: 0
    Last Post: 10-13-2008, 03:37 PM
  5. Using lighttpd(lightty) instead of apache with vShare
    By brianatthebeach in forum General Discussions
    Replies: 12
    Last Post: 02-05-2008, 12:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •