DD-WRT httpd hangs / times out with multiple connections?

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
XP1
DD-WRT User


Joined: 18 Aug 2007
Posts: 59

PostPosted: Sun Aug 19, 2012 8:37    Post subject: DD-WRT httpd hangs / times out with multiple connections? Reply with quote
DD-WRT httpd hangs / times out with multiple connections bug?

I am experiencing slow downs of the web server with Opera 12 and with old and new DD-WRT builds (such as 17201 and 19519).

It takes at most 15 seconds to load a page, and it blocks the web server. I cannot access the web interface from any other browser during this 15-second loading period.

Try it out yourself:
http://www.opera.com/browser/download/

Load a page first in Opera and then load the page in Chrome, for example. The web server will not respond.

Opera 12 uses 16 max connections to server by default.

In Opera, setting "Max connections to server" to 1 or 2 causes DD-WRT's web server not to hang. Anything >= 4 causes slowness.

DD-WRT's httpd is milli_httpd:
http://svn.dd-wrt.com/browser/src/router/httpd/

Coincidentally, the timeout is 15:
Code:
#define TIMEOUT 15

http://svn.dd-wrt.com/browser/src/router/httpd/httpd.c#L85

In SSH session, I found the process ID of httpd, killed it, and then started it with a 1-second timeout.
Code:
ps
kill id
httpd -p 80 -t 1

It seems a bit faster now in Opera 12, but it is still slow, so I am thinking that there is a bug somewhere in milli_httpd.

I have tried running the top command in SSH session, but it is hard to see if the web server freezes.

2 x Belkin F7D8301: v24-sp2 (07/20/12) mega (BrainSlayer 19519)
1 x Linksys E4200: mega (18024)
1 x Netgear WNDR3700: v24-sp2 (06/14/11) std (17201)
5 x Netgear WNDR3300: v24-sp2 (07/20/12) std (BrainSlayer 19519)

_________________
2 x Belkin F7D8301: v24-sp2 (07/20/12) mega (BrainSlayer 19519)
1 x Linksys E4200: mega (18024)
1 x Netgear WNDR3700: v24-sp2 (06/14/11) std (17201)
5 x Netgear WNDR3300: v24-sp2 (07/20/12) std (BrainSlayer 19519)
Sponsor
XP1
DD-WRT User


Joined: 18 Aug 2007
Posts: 59

PostPosted: Thu Aug 23, 2012 15:12    Post subject: Reply with quote
I have modified the milli_httpd source code to work on Ubuntu, and I was able to reproduce the hanging bug in milli_httpd. When I tested mini-httpd 1.19-9.2build1 and micro-httpd 20051212-13, they did not hang. Although the bug is neither in mini-httpd nor micro-httpd, it appears to be a bug only in milli_httpd.

This time, milli_httpd hangs on a JS file for about 25 seconds instead of 15 seconds, probably because the 15-second timeout code is absent. When you check by going to Opera Dragonfly's network tab, make sure that you disable all caching in the network options so that Opera will send requests for all files.

Here is my milli_httpd modified source code and binary:

2012-08-23 httpd.tar.gz:
https://www.box.com/s/66c172b62401175e349b/

  1. Extract the archive.
  2. Open Terminal.
  3. Change to the "httpd" directory.
  4. Type "make clean && make" to compile.
  5. Type "sudo ./httpd" to run.
  6. Open Opera.
  7. Opera > Page > Developer Tools > Opera Dragonfly > Network > Network options > Under "Caching behavior", enable "Disable all caching".
  8. Navigate to http://127.0.0.1/index.html or to other IPs. Local host access may not reveal any hangs, so please also try accessing the web server on the local network.
The included "www" directory contains a sample webpage from the latest DD-WRT build 19519 (2012-07-20).

When you want to set a static IP address, in "httpd.c", you have to modify the string:
Code:
ipaddr = "";

Then, set:
Code:
disable_router = 0;

The working directory should contain the web files that you want to serve. You can change it on this line in "httpd.c":
Code:
chdir("www/");


---

There are also related threads on the Opera forums discussing this issue:

Is 12.x SLOW on local pages for you (routers, etc)?:
http://my.opera.com/community/forums/topic.dml?id=1511442

Very slow page loading within my Netgear router's configuration pages with Opera 12.:
http://my.opera.com/community/forums/topic.dml?id=1446322

[12.00 beta] issue with netgear router page:
http://my.opera.com/community/forums/topic.dml?id=1407422

_________________
2 x Belkin F7D8301: v24-sp2 (07/20/12) mega (BrainSlayer 19519)
1 x Linksys E4200: mega (18024)
1 x Netgear WNDR3700: v24-sp2 (06/14/11) std (17201)
5 x Netgear WNDR3300: v24-sp2 (07/20/12) std (BrainSlayer 19519)
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum